Bug 705580 - Remove the cached ImageContainer when the current frame changes. r=joe
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 05 Dec 2011 11:53:38 +1300
changeset 82020 1a44df2a172bf6560a11815c59615890c5e2edec
parent 82019 66a382d48b09bebd9505d35bef6a95f996056988
child 82021 180b47429ff32a178724ec9910ea041ee009e5f1
push idunknown
push userunknown
push dateunknown
reviewersjoe
bugs705580
milestone11.0a1
Bug 705580 - Remove the cached ImageContainer when the current frame changes. r=joe
image/src/RasterImage.cpp
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -320,16 +320,17 @@ RasterImage::AdvanceFrame(TimeStamp aTim
 {
   NS_ASSERTION(aTime <= TimeStamp::Now(),
                "Given time appears to be in the future");
 
   imgFrame* nextFrame = nsnull;
   PRUint32 currentFrameIndex = mAnim->currentAnimationFrameIndex;
   PRUint32 nextFrameIndex = mAnim->currentAnimationFrameIndex + 1;
   PRUint32 timeout = 0;
+  mImageContainer = nsnull;
 
   // Figure out if we have the next full frame. This is more complicated than
   // just checking for mFrames.Length() because decoders append their frames
   // before they're filled in.
   NS_ABORT_IF_FALSE(mDecoder || nextFrameIndex <= mFrames.Length(),
                     "How did we get 2 indices too far by incrementing?");
 
   // If we don't have a decoder, we know we've got everything we're going to
@@ -1404,16 +1405,17 @@ RasterImage::ResetAnimation()
 
   mAnimationFinished = false;
 
   if (mAnimating)
     StopAnimation();
 
   mAnim->lastCompositedFrameIndex = -1;
   mAnim->currentAnimationFrameIndex = 0;
+  mImageContainer = nsnull;
 
   // Note - We probably want to kick off a redecode somewhere around here when
   // we fix bug 500402.
 
   // Update display if we were animating before
   nsCOMPtr<imgIContainerObserver> observer(do_QueryReferent(mObserver));
   if (mAnimating && observer)
     observer->FrameChanged(this, &(mAnim->firstFrameRefreshArea));