Bug 981252 - Initialize all values in MaskLayerUserData so that equality comparisons make sense. r=dbaron
authorMatt Woodrow <mwoodrow@mozilla.com>
Tue, 11 Mar 2014 11:12:48 +1300
changeset 172876 2cc7b484d797bd10da7c942494e4794ec7cebfb9
parent 172875 947d7ce90e2615c1af15e54a8ea7bedf30107530
child 172877 c55a8ec9e66fe591faf1606381c0e493454a0cad
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersdbaron
bugs981252
milestone30.0a1
Bug 981252 - Initialize all values in MaskLayerUserData so that equality comparisons make sense. r=dbaron
layout/base/FrameLayerBuilder.cpp
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -795,17 +795,21 @@ public:
   nsRefPtr<ImageLayer> mImageLayer;
 };
 
 /*
  * User data for layers which will be used as masks.
  */
 struct MaskLayerUserData : public LayerUserData
 {
-  MaskLayerUserData() : mImageKey(nullptr) {}
+  MaskLayerUserData()
+    : mScaleX(-1.0f)
+    , mScaleY(-1.0f)
+    , mAppUnitsPerDevPixel(-1)
+  { }
 
   bool
   operator== (const MaskLayerUserData& aOther) const
   {
     return mRoundedClipRects == aOther.mRoundedClipRects &&
            mScaleX == aOther.mScaleX &&
            mScaleY == aOther.mScaleY &&
            mOffset == aOther.mOffset &&
@@ -3970,16 +3974,18 @@ ContainerState::SetupMaskLayer(Layer *aL
   maskTransform.Invert();
   Matrix4x4 matrix = Matrix4x4::From2D(maskTransform);
   matrix.Translate(mParameters.mOffset.x, mParameters.mOffset.y, 0);
   maskLayer->SetBaseTransform(matrix);
 
   // save the details of the clip in user data
   userData->mScaleX = newData.mScaleX;
   userData->mScaleY = newData.mScaleY;
+  userData->mOffset = newData.mOffset;
+  userData->mAppUnitsPerDevPixel = newData.mAppUnitsPerDevPixel;
   userData->mRoundedClipRects.SwapElements(newData.mRoundedClipRects);
   userData->mImageKey = lookupKey;
 
   aLayer->SetMaskLayer(maskLayer);
   SetClipCount(thebesData, aRoundedRectClipCount);
   return;
 }