Bug 1291071 (Part 5) - Pass the decoder's final status explicitly to FinalizeDecoder(). r=edwin

This commit is contained in:
Seth Fowler
2016-08-02 17:12:36 -07:00
parent 7dce2e7e42
commit 4f4921678b
5 changed files with 64 additions and 16 deletions

View File

@@ -64,6 +64,7 @@ IDecodingTask::NotifyDecodeComplete(NotNull<RasterImage*> aImage,
"Decode complete in the middle of a frame?");
// Capture the decoder's state.
DecoderFinalStatus finalStatus = aDecoder->FinalStatus();
ImageMetadata metadata = aDecoder->GetImageMetadata();
DecoderTelemetry telemetry = aDecoder->Telemetry();
Progress progress = aDecoder->TakeProgress();
@@ -74,7 +75,7 @@ IDecodingTask::NotifyDecodeComplete(NotNull<RasterImage*> aImage,
// Synchronously notify if we can.
if (NS_IsMainThread() &&
!(aDecoder->GetDecoderFlags() & DecoderFlags::ASYNC_NOTIFY)) {
aImage->FinalizeDecoder(aDecoder, metadata, telemetry, progress,
aImage->FinalizeDecoder(aDecoder, finalStatus, metadata, telemetry, progress,
invalidRect, frameCount, surfaceFlags);
return;
}
@@ -83,8 +84,8 @@ IDecodingTask::NotifyDecodeComplete(NotNull<RasterImage*> aImage,
NotNull<RefPtr<RasterImage>> image = aImage;
NotNull<RefPtr<Decoder>> decoder = aDecoder;
NS_DispatchToMainThread(NS_NewRunnableFunction([=]() -> void {
image->FinalizeDecoder(decoder.get(), metadata, telemetry, progress,
invalidRect, frameCount, surfaceFlags);
image->FinalizeDecoder(decoder.get(), finalStatus, metadata, telemetry,
progress, invalidRect, frameCount, surfaceFlags);
}));
}