Bug 1456555 - Fix SourceSurface offset handling in DTSkia::PushLayer. r=lsalzman
☠☠ backed out by 1a5817b175de ☠ ☠
authorMatt Woodrow <mwoodrow@mozilla.com>
Tue, 06 Nov 2018 00:42:09 +0000
changeset 444512 afb19dd185566aa0ad509cf40c449923d9302b96
parent 444511 d46e2737134f292baa56a768e7b9b9b6cd754661
child 444513 1f269ed43301564c7d2341ea7696317bdafb0ff3
push id34996
push userrgurzau@mozilla.com
push dateTue, 06 Nov 2018 09:53:23 +0000
treeherdermozilla-central@e160f0a60e4f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1456555, 1429508, 1451845
milestone65.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 1456555 - Fix SourceSurface offset handling in DTSkia::PushLayer. r=lsalzman This got added in bug 1429508 and then removed in bug 1451845. Tiled blobs adds tests for this, so it shouldn't break again. MozReview-Commit-ID: 3azL7SoWlr2 Depends on D10038 Differential Revision: https://phabricator.services.mozilla.com/D10041
gfx/2d/DrawTargetSkia.cpp
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -2120,16 +2120,20 @@ DrawTargetSkia::PushLayerWithBlend(bool 
     } else {
       bounds.setEmpty();
     }
   }
 
   sk_sp<SkImage> clipImage = aMask ? GetSkImageForSurface(aMask) : nullptr;
   SkMatrix clipMatrix;
   GfxMatrixToSkiaMatrix(aMaskTransform, clipMatrix);
+  if (aMask) {
+    clipMatrix.postTranslate(aMask->GetRect().X(), aMask->GetRect().Y());
+  }
+
   SkCanvas::SaveLayerRec saveRec(aBounds.IsEmpty() ? nullptr : &bounds,
                                  &paint,
                                  nullptr,
                                  clipImage.get(),
                                  &clipMatrix,
                                  SkCanvas::kPreserveLCDText_SaveLayerFlag |
                                    (aCopyBackground ? SkCanvas::kInitWithPrevious_SaveLayerFlag : 0));