From 1b64928d1730c69ba715ba411d5ede83bd903575 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 10 Jul 2017 19:09:34 -0700 Subject: [PATCH] Don't draw diagnostic overlays during drawWindow. (bug 1379828, r=mattwoodrow) --- gfx/layers/composite/LayerManagerComposite.cpp | 5 +++++ gfx/layers/mlgpu/LayerManagerMLGPU.cpp | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gfx/layers/composite/LayerManagerComposite.cpp b/gfx/layers/composite/LayerManagerComposite.cpp index e5d2884081ba..7a019cdabd11 100644 --- a/gfx/layers/composite/LayerManagerComposite.cpp +++ b/gfx/layers/composite/LayerManagerComposite.cpp @@ -603,6 +603,11 @@ LayerManagerComposite::RenderDebugOverlay(const IntRect& aBounds) bool drawFps = gfxPrefs::LayersDrawFPS(); bool drawFrameColorBars = gfxPrefs::CompositorDrawColorBars(); + // Don't draw diagnostic overlays if we want to snapshot the output. + if (mTarget) { + return; + } + if (drawFps) { float alpha = 1; #ifdef ANDROID diff --git a/gfx/layers/mlgpu/LayerManagerMLGPU.cpp b/gfx/layers/mlgpu/LayerManagerMLGPU.cpp index 4cd11ff29d3f..a5fada1c6688 100644 --- a/gfx/layers/mlgpu/LayerManagerMLGPU.cpp +++ b/gfx/layers/mlgpu/LayerManagerMLGPU.cpp @@ -263,7 +263,8 @@ LayerManagerMLGPU::EndTransaction(const TimeStamp& aTimeStamp, EndTransactionFla } } - mDrawDiagnostics = gfxPrefs::LayersDrawFPS(); + // Don't draw the diagnostic overlay if we want to snapshot the output. + mDrawDiagnostics = gfxPrefs::LayersDrawFPS() && !mTarget; mUsingInvalidation = gfxPrefs::AdvancedLayersUseInvalidation(); // Compute transforms - and the changed area, if enabled.