mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 695275 - Fix conversion of ThebesLayers to ImageLayers. r=roc
This commit is contained in:
parent
4fec733686
commit
7fbe271e00
@ -970,6 +970,12 @@ ContainerState::PopThebesLayerData()
|
||||
nsRefPtr<ImageLayer> imageLayer = CreateOrRecycleImageLayer();
|
||||
imageLayer->SetContainer(imageContainer);
|
||||
data->mImage->ConfigureLayer(imageLayer);
|
||||
if (mParameters.mInActiveTransformedSubtree) {
|
||||
// The layer's current transform is applied first, then the result is scaled.
|
||||
gfx3DMatrix transform = imageLayer->GetTransform()*
|
||||
gfx3DMatrix::ScalingMatrix(mParameters.mXScale, mParameters.mYScale, 1.0f);
|
||||
imageLayer->SetTransform(transform);
|
||||
}
|
||||
NS_ASSERTION(data->mImageClip.mRoundedClipRects.IsEmpty(),
|
||||
"How did we get rounded clip rects here?");
|
||||
if (data->mImageClip.mHaveClipRect) {
|
||||
@ -1124,6 +1130,17 @@ ContainerState::ThebesLayerData::Accumulate(ContainerState* aState,
|
||||
{
|
||||
nscolor uniformColor;
|
||||
bool isUniform = aItem->IsUniform(aState->mBuilder, &uniformColor);
|
||||
|
||||
/* Mark as available for conversion to image layer if this is a nsDisplayImage and
|
||||
* we are the first visible item in the ThebesLayerData object.
|
||||
*/
|
||||
if (aItem->GetType() == nsDisplayItem::TYPE_IMAGE && mVisibleRegion.IsEmpty()) {
|
||||
mImage = static_cast<nsDisplayImage*>(aItem);
|
||||
mImageClip = aClip;
|
||||
} else {
|
||||
mImage = nsnull;
|
||||
}
|
||||
|
||||
// Some display items have to exist (so they can set forceTransparentSurface
|
||||
// below) but don't draw anything. They'll return true for isUniform but
|
||||
// a color with opacity 0.
|
||||
@ -1152,16 +1169,6 @@ ContainerState::ThebesLayerData::Accumulate(ContainerState* aState,
|
||||
mDrawRegion.Or(mDrawRegion, aDrawRect);
|
||||
mDrawRegion.SimplifyOutward(4);
|
||||
}
|
||||
|
||||
/* Mark as available for conversion to image layer if this is a nsDisplayImage and
|
||||
* we are the first visible item in the ThebesLayerData object.
|
||||
*/
|
||||
if (aItem->GetType() == nsDisplayItem::TYPE_IMAGE && mVisibleRegion.IsEmpty()) {
|
||||
mImage = static_cast<nsDisplayImage*>(aItem);
|
||||
mImageClip = aClip;
|
||||
} else {
|
||||
mImage = nsnull;
|
||||
}
|
||||
|
||||
bool forceTransparentSurface = false;
|
||||
nsRegion opaque = aItem->GetOpaqueRegion(aState->mBuilder, &forceTransparentSurface);
|
||||
|
@ -544,6 +544,7 @@ nsImageFrame::OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage)
|
||||
*/
|
||||
nsPresContext *presContext = PresContext();
|
||||
aImage->SetAnimationMode(presContext->ImageAnimationMode());
|
||||
mImageContainer = nsnull;
|
||||
|
||||
if (IsPendingLoad(aRequest)) {
|
||||
// We don't care
|
||||
@ -621,6 +622,7 @@ nsImageFrame::OnStopDecode(imgIRequest *aRequest,
|
||||
nsPresContext *presContext = PresContext();
|
||||
nsIPresShell *presShell = presContext->GetPresShell();
|
||||
NS_ASSERTION(presShell, "No PresShell.");
|
||||
mImageContainer = nsnull;
|
||||
|
||||
// Check what request type we're dealing with
|
||||
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent);
|
||||
@ -1237,7 +1239,10 @@ nsDisplayImage::ConfigureLayer(ImageLayer* aLayer)
|
||||
nsRefPtr<ImageContainer>
|
||||
nsImageFrame::GetContainer(LayerManager* aManager, imgIContainer* aImage)
|
||||
{
|
||||
if (mImageContainer && mImageContainer->Manager() == aManager) {
|
||||
if (mImageContainer &&
|
||||
(mImageContainer->Manager() == aManager ||
|
||||
(!mImageContainer->Manager() &&
|
||||
(mImageContainer->GetBackendType() == aManager->GetBackendType())))) {
|
||||
return mImageContainer;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user