Bug 1404749: Release our DrawTargetCapture on the main thread. r=mattwoodrow

MozReview-Commit-ID: 7uRdl2ZWtGS
This commit is contained in:
Bas Schouten 2017-10-02 04:20:40 +02:00
Родитель 937cb6ea5e
Коммит 43c3e5a40a
3 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -200,6 +200,13 @@ PaintThread::AsyncPaintContents(CompositorBridgeChild* aBridge,
if (!mDrawTargetsToFlush.Contains(target)) {
mDrawTargetsToFlush.AppendElement(target);
}
if (gfxPrefs::LayersOMTPReleaseCaptureOnMainThread()) {
// This should ensure the capture drawtarget, which may hold on to UnscaledFont objects,
// gets destroyed on the main thread (See bug 1404742). This assumes (unflushed) target
// DrawTargets do not themselves hold on to UnscaledFonts.
NS_ReleaseOnMainThreadSystemGroup("CapturePaintState::DrawTargetCapture", aState->mCapture.forget());
}
}
void

Просмотреть файл

@ -619,6 +619,7 @@ private:
DECL_GFX_PREF(Once, "layers.offmainthreadcomposition.force-disabled", LayersOffMainThreadCompositionForceDisabled, bool, false);
DECL_GFX_PREF(Live, "layers.offmainthreadcomposition.frame-rate", LayersCompositionFrameRate, int32_t,-1);
DECL_GFX_PREF(Live, "layers.omtp.force-sync", LayersOMTPForceSync, bool, false);
DECL_GFX_PREF(Live, "layers.omtp.release-capture-on-main-thread", LayersOMTPReleaseCaptureOnMainThread, bool, true);
DECL_GFX_PREF(Live, "layers.orientation.sync.timeout", OrientationSyncMillis, uint32_t, (uint32_t)0);
DECL_GFX_PREF(Once, "layers.prefer-opengl", LayersPreferOpenGL, bool, false);
DECL_GFX_PREF(Live, "layers.progressive-paint", ProgressivePaint, bool, false);

Просмотреть файл

@ -5915,4 +5915,5 @@ pref("toolkit.crashreporter.include_context_heap", true);
pref("dom.noopener.newprocess.enabled", true);
pref("layers.omtp.enabled", false);
pref("layers.omtp.release-capture-on-main-thread", true);
pref("layers.omtp.force-sync", false);