Bug 1192159: Do not forget about the transform when not using an active target. r=jrmuizel a=ritu
authorBas Schouten <bschouten@mozilla.com>
Wed, 02 Sep 2015 12:20:59 +0000
changeset 289174 d051ce96953306b33726ab417cf4c56233a5bbf0
parent 289173 2bf9fc66f663e4659a4af83a157fdf28090bba88
child 289175 4929041d9806546e5d20f498f02248d784b7309e
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, ritu
bugs1192159
milestone42.0a2
Bug 1192159: Do not forget about the transform when not using an active target. r=jrmuizel a=ritu
dom/canvas/CanvasRenderingContext2D.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -1199,16 +1199,19 @@ bool CanvasRenderingContext2D::SwitchRen
   RefPtr<SourceSurface> snapshot;
   Matrix transform;
 
   if (mTarget) {
     snapshot = mTarget->Snapshot();
     transform = mTarget->GetTransform();
   } else {
     MOZ_ASSERT(mBufferProvider);
+    // When mBufferProvider is true but we have no mTarget, our current state's
+    // transform is always valid. See ReturnTarget().
+    transform = CurrentState().transform;
     snapshot = mBufferProvider->GetSnapshot();
   }
   mTarget = nullptr;
   mBufferProvider = nullptr;
   mResetLayer = true;
 
   // Recreate target using the new rendering mode
   RenderingMode attemptedMode = EnsureTarget(aRenderingMode);