Bug 1526045 - Part 3: Ensure DrawTarget validity inside gfxBlur::InitDrawTarget. r=rhunt a=lizzard
authorBas Schouten <bschouten@mozilla.com>
Mon, 04 Mar 2019 10:49:02 +0100
changeset 516304 5892e926a68ca496e7b2539b2f0795239ca6d962
parent 516303 aff13d214a3514d92f72f54c9f482b898927d6cc
child 516305 cc6fc6015015707bdacbeaf206679df6ff78b6d2
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhunt, lizzard
bugs1526045
milestone66.0
Bug 1526045 - Part 3: Ensure DrawTarget validity inside gfxBlur::InitDrawTarget. r=rhunt a=lizzard 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;
     }