diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index b01168d18d4f..9464d8724e79 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -2434,7 +2434,7 @@ nsDisplayBackgroundImage::CanOptimizeToImageLayer(LayerManager* aManager, // layer pixel boundaries. This should be OK for now. int32_t appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel(); - mDestRect = + mImageLayerDestRect = LayoutDeviceRect::FromAppUnits(state.mDestArea, appUnitsPerDevPixel); // Ok, we can turn this into a layer if needed. @@ -2527,7 +2527,7 @@ nsDisplayBackgroundImage::GetLayerState(nsDisplayListBuilder* aBuilder, mImage->GetHeight(&imageHeight); NS_ASSERTION(imageWidth != 0 && imageHeight != 0, "Invalid image size!"); - const LayerRect destLayerRect = mDestRect * aParameters.Scale(); + const LayerRect destLayerRect = mImageLayerDestRect * aParameters.Scale(); // Calculate the scaling factor for the frame. const gfxSize scale = gfxSize(destLayerRect.width / imageWidth, @@ -2589,10 +2589,10 @@ nsDisplayBackgroundImage::ConfigureLayer(ImageLayer* aLayer, // aParameters.Offset() is always zero. MOZ_ASSERT(aParameters.Offset() == LayerIntPoint(0,0)); - const LayoutDevicePoint p = mDestRect.TopLeft(); + const LayoutDevicePoint p = mImageLayerDestRect.TopLeft(); Matrix transform = Matrix::Translation(p.x, p.y); - transform.PreScale(mDestRect.width / imageWidth, - mDestRect.height / imageHeight); + transform.PreScale(mImageLayerDestRect.width / imageWidth, + mImageLayerDestRect.height / imageHeight); aLayer->SetBaseTransform(gfx::Matrix4x4::From2D(transform)); } diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index 7478e40adb3a..45e5aa7f6825 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -2634,7 +2634,7 @@ protected: const nsStyleBackground* mBackgroundStyle; nsCOMPtr mImage; RefPtr mImageContainer; - LayoutDeviceRect mDestRect; + LayoutDeviceRect mImageLayerDestRect; /* Bounds of this display item */ nsRect mBounds; uint32_t mLayer;