diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h index deb06e31fe5f..3a3ef4e99b05 100644 --- a/gfx/thebes/gfxPrefs.h +++ b/gfx/thebes/gfxPrefs.h @@ -523,6 +523,7 @@ private: DECL_GFX_PREF(Once, "gfx.webrender.all.qualified", WebRenderAllQualified, bool, true); DECL_GFX_PREF(Live, "gfx.webrender.blob-images", WebRenderBlobImages, bool, true); DECL_GFX_PREF(Live, "gfx.webrender.blob.invalidation", WebRenderBlobInvalidation, bool, false); + DECL_GFX_PREF(Live, "gfx.webrender.blob.paint-flashing", WebRenderBlobPaintFlashing, bool, false); DECL_GFX_PREF(Live, "gfx.webrender.dl.dump-parent", WebRenderDLDumpParent, bool, false); DECL_GFX_PREF(Live, "gfx.webrender.dl.dump-content", WebRenderDLDumpContent, bool, false); DECL_GFX_PREF(Once, "gfx.webrender.enabled", WebRenderEnabledDoNotUseDirectly, bool, false); diff --git a/gfx/webrender_bindings/Moz2DImageRenderer.cpp b/gfx/webrender_bindings/Moz2DImageRenderer.cpp index 53308d506ae2..44cf6785eeb0 100644 --- a/gfx/webrender_bindings/Moz2DImageRenderer.cpp +++ b/gfx/webrender_bindings/Moz2DImageRenderer.cpp @@ -4,6 +4,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include "gfxPrefs.h" #include "gfxUtils.h" #include "mozilla/Mutex.h" #include "mozilla/Range.h" @@ -447,13 +448,13 @@ static bool Moz2DRenderCallback(const Range aBlob, offset = extra_end; } -#if 0 - dt->SetTransform(gfx::Matrix()); - float r = float(rand()) / RAND_MAX; - float g = float(rand()) / RAND_MAX; - float b = float(rand()) / RAND_MAX; - dt->FillRect(gfx::Rect(0, 0, aSize.width, aSize.height), gfx::ColorPattern(gfx::Color(r, g, b, 0.5))); -#endif + if (gfxPrefs::WebRenderBlobPaintFlashing()) { + dt->SetTransform(gfx::Matrix()); + float r = float(rand()) / RAND_MAX; + float g = float(rand()) / RAND_MAX; + float b = float(rand()) / RAND_MAX; + dt->FillRect(gfx::Rect(origin.x, origin.y, aSize.width, aSize.height), gfx::ColorPattern(gfx::Color(r, g, b, 0.5))); + } if (aDirtyRect) { dt->PopClip(); diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 0cb545d23425..0d96637a9c55 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -906,6 +906,7 @@ pref("gfx.compositor.glcontext.opaque", false); pref("gfx.webrender.highlight-painted-layers", false); pref("gfx.webrender.blob-images", true); pref("gfx.webrender.blob.invalidation", true); +pref("gfx.webrender.blob.paint-flashing", false); // WebRender debugging utilities. pref("gfx.webrender.debug.texture-cache", false);