Bug 1285263 - Restore clips with the proper transform when in CanvasRenderingContext2D::EnsureTarget. r=bas
authorNicolas Silva <nsilva@mozilla.com>
Thu, 21 Jul 2016 11:02:12 +0200
changeset 306052 fff92b2a76ecb3b4d81a33e10fa98dcfd167ed93
parent 306051 bdbb5822afe1851c0df23d33a591b4001e221831
child 306053 d3c449980296db1bc307e56ca78022bc49dd823b
push id30474
push usercbook@mozilla.com
push dateThu, 21 Jul 2016 14:25:10 +0000
treeherdermozilla-central@6b180266ac16 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas
bugs1285263
milestone50.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 1285263 - Restore clips with the proper transform when in CanvasRenderingContext2D::EnsureTarget. r=bas
dom/canvas/CanvasRenderingContext2D.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -1557,18 +1557,18 @@ CanvasRenderingContext2D::EnsureTarget(c
     } else {
       mTarget = mBufferProvider->BorrowDrawTarget(IntRect(0, 0, mWidth, mHeight));
     }
 
     ScheduleStableStateCallback();
 
     if (mTarget) {
       // Restore clip and transform.
-      mTarget->SetTransform(CurrentState().transform);
       for (uint32_t i = 0; i < mStyleStack.Length(); i++) {
+        mTarget->SetTransform(mStyleStack[i].transform);
         for (uint32_t c = 0; c < mStyleStack[i].clipsPushed.Length(); c++) {
           mTarget->PushClip(mStyleStack[i].clipsPushed[c]);
         }
       }
       return mRenderingMode;
     } else {
       mBufferProvider = nullptr;
     }