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 191092 2cc7b484d797bd10da7c942494e4794ec7cebfb9
parent 191091 947d7ce90e2615c1af15e54a8ea7bedf30107530
child 191093 c55a8ec9e66fe591faf1606381c0e493454a0cad
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs981252
milestone30.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 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;
 }