Bug 1526045 - Part 3: Ensure DrawTarget validity inside gfxBlur::InitDrawTarget. r=rhunt
authorBas Schouten <bschouten@mozilla.com>
Mon, 04 Mar 2019 10:49:02 +0100
changeset 520476 6c61045cda2feffcbd74af5646e5dc868a4d8dcd
parent 520475 0d10f1a69e9a989db9acae2a9ec49a46ee4dbec8
child 520477 fb993d3d4e66cb1ff3e63ff1377a5d495f8e4d0a
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhunt
bugs1526045
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1526045 - Part 3: Ensure DrawTarget validity inside gfxBlur::InitDrawTarget. r=rhunt Differential Revision: https://phabricator.services.mozilla.com/D21900
gfx/thebes/gfxBlur.cpp
--- a/gfx/thebes/gfxBlur.cpp
+++ b/gfx/thebes/gfxBlur.cpp
@@ -83,16 +83,20 @@ already_AddRefed<DrawTarget> gfxAlphaBox
           blurDataSize);
     }
   } else if (mAccelerated) {
     // Note: CreateShadowDrawTarget is only implemented for Cairo, so we don't
     // care about mimicking this in the DrawTargetCapture case.
     mDrawTarget = aReferenceDT->CreateShadowDrawTarget(
         mBlur.GetSize(), SurfaceFormat::A8,
         AlphaBoxBlur::CalculateBlurSigma(aBlurRadius.width));
+    if (mDrawTarget) {
+      // See Bug 1526045 - this is to force DT initialization.
+      mDrawTarget->ClearRect(gfx::Rect());
+    }
   } else {
     // Make an alpha-only surface to draw on. We will play with the data after
     // everything is drawn to create a blur effect.
     // This will be freed when the DrawTarget dies
     mData = static_cast<uint8_t*>(calloc(1, blurDataSize));
     if (!mData) {
       return nullptr;
     }