Bug 703231 - [Mac] Fix scan lines while decoding images caused by high quality down scaling. r=joe

This commit is contained in:
Benoit Girard 2011-11-24 18:23:19 -05:00
parent 6ea3a93652
commit 6af0f7b28d

View File

@ -187,6 +187,20 @@ Decoder::FlushInvalidations()
// Fire OnDataAvailable
if (mObserver) {
#ifdef XP_MACOSX
// Bug 703231
// Because of high quality down sampling on mac we show scan lines while decoding.
// Bypass this problem by redrawing the border.
PRInt32 width;
PRInt32 height;
mImage.GetWidth(&width);
mImage.GetHeight(&height);
nsIntRect mImageBound(0, 0, width, height);
mInvalidRect.Inflate(1);
mInvalidRect = mInvalidRect.Intersect(mImageBound);
#endif
bool isCurrentFrame = mImage.GetCurrentFrameIndex() == (mFrameCount - 1);
mObserver->OnDataAvailable(nsnull, isCurrentFrame, &mInvalidRect);
}