Be sure to preserve the current transform when restoring an SkCanvas (bug 1431813, r=lsalzman) a=RyanVM
authorRyan Hunt <rhunt@eqrion.net>
Fri, 02 Feb 2018 09:22:20 -0600
changeset 454732 f546a01d96f18c00972908f500c88311d576d588
parent 454731 fc55ea1db218ace64f3e2579e3bb145afa09685f
child 454733 54b1046e68b8d38471402e0062ab66de57dd7243
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman, RyanVM
bugs1431813
milestone59.0
Be sure to preserve the current transform when restoring an SkCanvas (bug 1431813, r=lsalzman) a=RyanVM
gfx/2d/DrawTargetSkia.cpp
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -2054,16 +2054,17 @@ DrawTargetSkia::PushClipRect(const Rect&
   mCanvas->save();
   mCanvas->clipRect(rect, SkClipOp::kIntersect, true);
 }
 
 void
 DrawTargetSkia::PopClip()
 {
   mCanvas->restore();
+  SetTransform(GetTransform());
 }
 
 void
 DrawTargetSkia::PushLayer(bool aOpaque, Float aOpacity, SourceSurface* aMask,
                           const Matrix& aMaskTransform, const IntRect& aBounds,
                           bool aCopyBackground)
 {
   PushedLayer layer(GetPermitSubpixelAA(), aOpaque, aOpacity, aMask, aMaskTransform,
@@ -2177,16 +2178,17 @@ DrawTargetSkia::PopLayer()
 
         mCanvas->restore();
       }
     }
   } else {
     mCanvas->restore();
   }
 
+  SetTransform(GetTransform());
   SetPermitSubpixelAA(layer.mOldPermitSubpixelAA);
 
   mPushedLayers.pop_back();
 
 #ifdef MOZ_WIDGET_COCOA
   CGContextRelease(mCG);
   mCG = nullptr;
 #endif