Bug 1535159 - Apply snapping to mask Layer transforms like we do for other Layer types. r=lsalzman
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 10 Apr 2019 05:13:26 +0000
changeset 468748 f704b21e1ab590ed60b5372fb77c10c6cf6a0fc1
parent 468747 dd9d6be5d2717bfc50d6c4b8f8ac8848de2d9327
child 468749 473b3a558405d1d0661101909a17cb1c58208f40
push id112755
push userdvarga@mozilla.com
push dateWed, 10 Apr 2019 22:06:41 +0000
treeherdermozilla-inbound@606f85641d0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1535159
milestone68.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 1535159 - Apply snapping to mask Layer transforms like we do for other Layer types. r=lsalzman Differential Revision: https://phabricator.services.mozilla.com/D26851
gfx/layers/Layers.cpp
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -670,27 +670,25 @@ void Layer::ComputeEffectiveTransformFor
     Layer* maskLayer = GetAncestorMaskLayerAt(i);
     ComputeEffectiveTransformForMaskLayer(maskLayer, aTransformToSurface);
   }
 }
 
 /* static */
 void Layer::ComputeEffectiveTransformForMaskLayer(
     Layer* aMaskLayer, const gfx::Matrix4x4& aTransformToSurface) {
-  aMaskLayer->mEffectiveTransform = aTransformToSurface;
-
 #ifdef DEBUG
   bool maskIs2D = aMaskLayer->GetTransform().CanDraw2D();
   NS_ASSERTION(maskIs2D, "How did we end up with a 3D transform here?!");
 #endif
   // The mask layer can have an async transform applied to it in some
   // situations, so be sure to use its GetLocalTransform() rather than
   // its GetTransform().
-  aMaskLayer->mEffectiveTransform =
-      aMaskLayer->GetLocalTransform() * aMaskLayer->mEffectiveTransform;
+  aMaskLayer->mEffectiveTransform = aMaskLayer->SnapTransformTranslation(
+      aMaskLayer->GetLocalTransform() * aTransformToSurface, nullptr);
 }
 
 RenderTargetRect Layer::TransformRectToRenderTarget(const LayerIntRect& aRect) {
   LayerRect rect(aRect);
   RenderTargetRect quad = RenderTargetRect::FromUnknownRect(
       GetEffectiveTransform().TransformBounds(rect.ToUnknownRect()));
   return quad;
 }