mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 795722 - Clear our cached ImageContainer when the imgFrame changes. r=joe
This commit is contained in:
parent
1c469a0cf7
commit
10c1bdf174
@ -943,6 +943,10 @@ RasterImage::GetCurrentImage()
|
||||
nsresult rv = GetFrame(FRAME_CURRENT, FLAG_SYNC_DECODE, getter_AddRefs(imageSurface));
|
||||
NS_ENSURE_SUCCESS(rv, nullptr);
|
||||
|
||||
if (!mImageContainer) {
|
||||
mImageContainer = LayerManager::CreateImageContainer();
|
||||
}
|
||||
|
||||
CairoImage::Data cairoData;
|
||||
cairoData.mSurface = imageSurface;
|
||||
GetWidth(&cairoData.mSize.width);
|
||||
@ -968,8 +972,6 @@ RasterImage::GetImageContainer(ImageContainer **_retval)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
mImageContainer = LayerManager::CreateImageContainer();
|
||||
|
||||
nsRefPtr<layers::Image> image = GetCurrentImage();
|
||||
if (!image) {
|
||||
return NS_ERROR_FAILURE;
|
||||
@ -1292,9 +1294,9 @@ RasterImage::FrameUpdated(uint32_t aFrameNum, nsIntRect &aUpdatedRect)
|
||||
|
||||
frame->ImageUpdated(aUpdatedRect);
|
||||
|
||||
if (aFrameNum == GetCurrentImgFrameIndex()) {
|
||||
// The image has changed, so we need to invalidate our cached ImageContainer.
|
||||
UpdateImageContainer();
|
||||
if (aFrameNum == GetCurrentImgFrameIndex() &&
|
||||
!IsInUpdateImageContainer()) {
|
||||
mImageContainer = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user