Bug 1120279 - Ensure the animated image state is consistent if redecoding fails or is asynchronous. r=edwin
☠☠ backed out by 17242152a8fb ☠ ☠
authorAndrew Osmond <aosmond@mozilla.com>
Thu, 15 Sep 2016 15:13:48 -0400
changeset 355539 c0021d576b3a738e055b0c1c6608823038cba3a0
parent 355538 d4a745bc5f82648fb968ef1e6e5fd123be847505
child 355540 17fd06efdbb7b7a9a0006c0ab02ddbab6a0c9376
child 355577 caa8a9c7d1223eda20bb5fa91d57750d5e1ba6e3
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs1120279
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1120279 - Ensure the animated image state is consistent if redecoding fails or is asynchronous. r=edwin
image/RasterImage.cpp
--- a/image/RasterImage.cpp
+++ b/image/RasterImage.cpp
@@ -1168,16 +1168,17 @@ RasterImage::Decode(const IntSize& aSize
     task = DecoderFactory::CreateDecoder(mDecoderType, WrapNotNull(this),
                                          mSourceBuffer, mSize, aSize,
                                          decoderFlags, surfaceFlags,
                                          mRequestedSampleSize);
   }
 
   // Make sure DecoderFactory was able to create a decoder successfully.
   if (!task) {
+    DoError();
     return NS_ERROR_FAILURE;
   }
 
   mDecodeCount++;
 
   // We're ready to decode; start the decoder.
   LaunchDecodingTask(task, this, aFlags, mHasSourceData);
   return NS_OK;
@@ -1222,16 +1223,17 @@ RasterImage::RecoverFromInvalidFrames(co
   // Relock the image if it's supposed to be locked.
   if (mLockCount > 0) {
     SurfaceCache::LockImage(ImageKey(this));
   }
 
   // Animated images require some special handling, because we normally require
   // that they never be discarded.
   if (mAnimationState) {
+    mAnimationState->SetDoneDecoding(false);
     Decode(mSize, aFlags | FLAG_SYNC_DECODE, PlaybackType::eAnimated);
     ResetAnimation();
     return;
   }
 
   // For non-animated images, it's fine to recover using an async decode.
   Decode(aSize, aFlags, PlaybackType::eStatic);
 }