Bug 1098958 - Call UpdateImageContainer whenever we send invalidations in RasterImage. r=tn
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -2674,23 +2674,25 @@ RasterImage::FinishedSomeDecoding(Shutdo
mDecodingMonitor.AssertCurrentThreadIn();
// Ensure that, if the decoder is the last reference to the image, we don't
// destroy it by destroying the decoder.
nsRefPtr<RasterImage> image(this);
bool done = false;
bool wasSize = false;
+ bool wasDefaultFlags = false;
nsIntRect invalidRect;
nsresult rv = NS_OK;
Progress progress = aProgress;
if (image->mDecoder) {
invalidRect = image->mDecoder->TakeInvalidRect();
progress |= image->mDecoder->TakeProgress();
+ wasDefaultFlags = image->mDecoder->GetDecodeFlags() == DECODE_FLAGS_DEFAULT;
if (!image->mDecoder->IsSizeDecode() && image->mDecoder->ChunkCount()) {
Telemetry::Accumulate(Telemetry::IMAGE_DECODE_CHUNKS,
image->mDecoder->ChunkCount());
}
if (!image->mHasSize && image->mDecoder->HasSize()) {
image->mDecoder->SetSizeOnImage();
@@ -2739,16 +2741,20 @@ RasterImage::FinishedSomeDecoding(Shutdo
// RequestRefresh take care of that.
invalidRect = nsIntRect();
}
if (mHasBeenDecoded && !invalidRect.IsEmpty()) {
// Don't send partial invalidations if we've been decoded before.
invalidRect = mDecoded ? GetFirstFrameRect()
: nsIntRect();
}
+ if (!invalidRect.IsEmpty() && wasDefaultFlags) {
+ // Update our image container since we're invalidating.
+ UpdateImageContainer();
+ }
if (mNotifying) {
// Accumulate the progress changes. We don't permit recursive notifications
// because they cause subtle concurrency bugs, so we'll delay sending out
// the notifications until we pop back to the lowest invocation of
// FinishedSomeDecoding on the stack.
mNotifyProgress |= progress;
mNotifyInvalidRect.Union(invalidRect);