diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index e20b04edc916..3563960d24be 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -667,7 +667,8 @@ struct MaskLayerUserData : public LayerUserData return mRoundedClipRects == aOther.mRoundedClipRects && mScaleX == aOther.mScaleX && mScaleY == aOther.mScaleY && - mOffset == aOther.mOffset; + mOffset == aOther.mOffset && + mAppUnitsPerDevPixel == aOther.mAppUnitsPerDevPixel; } nsRefPtr mImageKey; @@ -678,6 +679,7 @@ struct MaskLayerUserData : public LayerUserData float mScaleX, mScaleY; // The ContainerParameters offset which is applied to the mask's transform. nsIntPoint mOffset; + int32_t mAppUnitsPerDevPixel; }; /** @@ -3414,6 +3416,7 @@ ContainerState::SetupMaskLayer(Layer *aLayer, const DisplayItemClip& aClip, newData.mScaleX = mParameters.mXScale; newData.mScaleY = mParameters.mYScale; newData.mOffset = mParameters.mOffset; + newData.mAppUnitsPerDevPixel = mContainerFrame->PresContext()->AppUnitsPerDevPixel(); if (*userData == newData) { aLayer->SetMaskLayer(maskLayer); @@ -3422,8 +3425,8 @@ ContainerState::SetupMaskLayer(Layer *aLayer, const DisplayItemClip& aClip, } // calculate a more precise bounding rect - const int32_t A2D = mContainerFrame->PresContext()->AppUnitsPerDevPixel(); - gfxRect boundingRect = CalculateBounds(newData.mRoundedClipRects, A2D); + gfxRect boundingRect = CalculateBounds(newData.mRoundedClipRects, + newData.mAppUnitsPerDevPixel); boundingRect.Scale(mParameters.mXScale, mParameters.mYScale); uint32_t maxSize = mManager->GetMaxTextureSize(); @@ -3479,7 +3482,10 @@ ContainerState::SetupMaskLayer(Layer *aLayer, const DisplayItemClip& aClip, // paint the clipping rects with alpha to create the mask context->SetColor(gfxRGBA(1, 1, 1, 1)); - aClip.DrawRoundedRectsTo(context, A2D, 0, aRoundedRectClipCount); + aClip.DrawRoundedRectsTo(context, + newData.mAppUnitsPerDevPixel, + 0, + aRoundedRectClipCount); // build the image and container container = aLayer->Manager()->CreateImageContainer();