зеркало из https://github.com/mozilla/gecko-dev.git
Bug 610601 - re-use the frame only if there is image data. r+a=joe
This commit is contained in:
Родитель
c2163496cc
Коммит
702b90e2aa
|
@ -918,22 +918,22 @@ RasterImage::EnsureCleanFrame(PRUint32 aFrameNum, PRInt32 aX, PRInt32 aY,
|
|||
|
||||
// See if we can re-use the frame that already exists.
|
||||
nsIntRect rect = frame->GetRect();
|
||||
if (rect.x != aX || rect.y != aY || rect.width != aWidth || rect.height != aHeight ||
|
||||
frame->GetFormat() != aFormat) {
|
||||
DeleteImgFrame(aFrameNum);
|
||||
return InternalAddFrame(aFrameNum, aX, aY, aWidth, aHeight, aFormat,
|
||||
/* aPaletteDepth = */ 0, imageData, imageLength,
|
||||
/* aPaletteData = */ nsnull,
|
||||
/* aPaletteLength = */ nsnull);
|
||||
if (rect.x == aX && rect.y == aY && rect.width == aWidth &&
|
||||
rect.height == aHeight && frame->GetFormat() == aFormat) {
|
||||
// We can re-use the frame if it has image data.
|
||||
frame->GetImageData(imageData, imageLength);
|
||||
if (*imageData) {
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// We can re-use the frame.
|
||||
frame->GetImageData(imageData, imageLength);
|
||||
|
||||
return NS_OK;
|
||||
DeleteImgFrame(aFrameNum);
|
||||
return InternalAddFrame(aFrameNum, aX, aY, aWidth, aHeight, aFormat,
|
||||
/* aPaletteDepth = */ 0, imageData, imageLength,
|
||||
/* aPaletteData = */ nsnull,
|
||||
/* aPaletteLength = */ nsnull);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
RasterImage::FrameUpdated(PRUint32 aFrameNum, nsIntRect &aUpdatedRect)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче