From ab85c1ac986e1b57b846f789129fac2942c6a3e6 Mon Sep 17 00:00:00 2001 From: Iris Hsiao Date: Thu, 4 May 2017 11:30:45 +0800 Subject: [PATCH] Backed out changeset dda520b4ed32 (bug 1360572) for Assertion failure at RasterImage.cpp --- image/FrameAnimator.cpp | 1 - image/RasterImage.cpp | 25 +++++++++++-------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/image/FrameAnimator.cpp b/image/FrameAnimator.cpp index f96952ee1ac6..4602782af990 100644 --- a/image/FrameAnimator.cpp +++ b/image/FrameAnimator.cpp @@ -425,7 +425,6 @@ FrameAnimator::RequestRefresh(AnimationState& aState, // Advanced to the correct frame, the composited frame is now valid to be drawn. if (*currentFrameEndTime > aTime) { aState.mCompositedFrameInvalid = false; - ret.mDirtyRect = IntRect(IntPoint(0,0), mSize); } MOZ_ASSERT(!aState.mIsCurrentlyDecoded || !aState.mCompositedFrameInvalid); diff --git a/image/RasterImage.cpp b/image/RasterImage.cpp index f89573b1d300..f5d62d6259d1 100644 --- a/image/RasterImage.cpp +++ b/image/RasterImage.cpp @@ -1262,20 +1262,17 @@ RasterImage::Decode(const IntSize& aSize, mSourceBuffer, mSize, decoderFlags, surfaceFlags); // We may not be able to send an invalidation right here because of async - // notifications but that shouldn't be a problem because we shouldn't be - // getting a non-empty rect back from UpdateState. This is because UpdateState - // will only return a non-empty rect if we are currently decoded, or the - // animation is finished. We can't be decoded because we are creating a decoder - // here. If the animation is finished then the composited frame would have - // been valid when the animation finished, and it's not possible to mark - // the composited frame as invalid when the animation is finished. So - // the composited frame can't change from invalid to valid in this UpdateState - // call, and hence no rect can be returned. -#ifdef DEBUG - gfx::IntRect rect = -#endif - mAnimationState->UpdateState(mAnimationFinished, this, mSize); - MOZ_ASSERT(rect.IsEmpty()); + // notifications but that's not a problem because the first frame + // invalidation (when it comes) will invalidate for us. So we can ignore + // the return value of UpdateState. This also handles the invalidation + // from setting the composited frame as valid below. + mAnimationState->UpdateState(mAnimationFinished, this, mSize); + // If the animation is finished we can draw right away because we just draw + // the final frame all the time from now on. See comment in + // AnimationState::UpdateState. + if (mAnimationFinished) { + mAnimationState->SetCompositedFrameInvalid(false); + } } else { task = DecoderFactory::CreateDecoder(mDecoderType, WrapNotNull(this), mSourceBuffer, mSize, aSize,