mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 641770. Apply correct clip rect to a layerized image. r=tnikkel
This commit is contained in:
parent
4bd5d3cedf
commit
d13eeaf01c
@ -282,6 +282,10 @@ protected:
|
||||
* convert this to an ImageLayer.
|
||||
*/
|
||||
nsDisplayImage* mImage;
|
||||
/**
|
||||
* Stores the clip that we need to apply to the image.
|
||||
*/
|
||||
FrameLayerBuilder::Clip mImageClip;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -917,7 +921,7 @@ ContainerState::FindOpaqueBackgroundColorFor(PRInt32 aThebesLayerIndex)
|
||||
nsRefPtr<ImageContainer>
|
||||
ContainerState::ThebesLayerData::CanOptimizeImageLayer(LayerManager* aManager)
|
||||
{
|
||||
if (!mImage) {
|
||||
if (!mImage || !mImageClip.mRoundedClipRects.IsEmpty()) {
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
@ -942,6 +946,15 @@ ContainerState::PopThebesLayerData()
|
||||
nsRefPtr<ImageLayer> imageLayer = CreateOrRecycleImageLayer();
|
||||
imageLayer->SetContainer(imageContainer);
|
||||
data->mImage->ConfigureLayer(imageLayer);
|
||||
NS_ASSERTION(data->mImageClip.mRoundedClipRects.IsEmpty(),
|
||||
"How did we get rounded clip rects here?");
|
||||
if (data->mImageClip.mHaveClipRect) {
|
||||
nsPresContext* presContext = mContainerFrame->PresContext();
|
||||
nscoord appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel();
|
||||
nsIntRect clip = data->mImageClip.mClipRect.ToNearestPixels(appUnitsPerDevPixel);
|
||||
imageLayer->IntersectClipRect(
|
||||
data->mImageClip.mClipRect.ToNearestPixels(appUnitsPerDevPixel));
|
||||
}
|
||||
layer = imageLayer;
|
||||
} else {
|
||||
nsRefPtr<ColorLayer> colorLayer = CreateOrRecycleColorLayer();
|
||||
@ -1118,6 +1131,7 @@ ContainerState::ThebesLayerData::Accumulate(nsDisplayListBuilder* aBuilder,
|
||||
*/
|
||||
if (aItem->GetType() == nsDisplayItem::TYPE_IMAGE && mVisibleRegion.IsEmpty()) {
|
||||
mImage = static_cast<nsDisplayImage*>(aItem);
|
||||
mImageClip = aClip;
|
||||
} else {
|
||||
mImage = nsnull;
|
||||
}
|
||||
|
6
layout/reftests/bugs/641770-1-ref.html
Normal file
6
layout/reftests/bugs/641770-1-ref.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<div style="position:absolute; background:green; width:1500px; height:1500px;"></div>
|
||||
</body>
|
||||
</html>
|
7
layout/reftests/bugs/641770-1.html
Normal file
7
layout/reftests/bugs/641770-1.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<img style="position:fixed; width:1500px;" src="repeatable-diagonal-gradient.png">
|
||||
<div style="position:absolute; background:green; width:1500px; height:1500px;"></div>
|
||||
</body>
|
||||
</html>
|
@ -1623,4 +1623,5 @@ fails-if(Android) == 634232-1.html 634232-1-ref.html
|
||||
fails-if(Android) == 635302-1.html 635302-1-ref.html
|
||||
HTTP(..) == 635639-1.html 635639-1-ref.html
|
||||
HTTP(..) == 635639-2.html 635639-2-ref.html
|
||||
== 641770-1.html 641770-1-ref.html
|
||||
== 641856-1.html 641856-1-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user