Bug 1291071 (Part 5) - Pass the decoder's final status explicitly to FinalizeDecoder(). r=edwin
This commit is contained in:
@@ -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);
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user