Bug 1508393 - Enable animated images producing full frames by default. r=tnikkel

Also, fix a minor bug where when we discard an animated image that is a
full frame animated image, we need to reset
AnimationState::mCompositedFrameInvalid to false, just like we do for
animated images blended by FrameAnimator. This is because it is used as
part of our state checking in FrameAnimator::GetCompositedFrame before
we are willing to yield frame data.

Differential Revision: https://phabricator.services.mozilla.com/D12362
This commit is contained in:
Andrew Osmond 2018-11-19 21:05:54 -05:00
parent 76236b5c34
commit 229f450427
2 changed files with 9 additions and 4 deletions

View File

@ -496,10 +496,15 @@ FrameAnimator::RequestRefresh(AnimationState& aState,
// We should only mark the composited frame as valid and reset the dirty rect
// if we advanced (meaning the next frame was actually produced somehow), the
// composited frame was previously invalid (so we may need to repaint
// everything) and the frame index is valid (to know we were doing blending
// on the main thread, instead of on the decoder threads in advance).
// everything) and either the frame index is valid (to know we were doing
// blending on the main thread, instead of on the decoder threads in advance),
// or the current frame is a full frame (blends off the main thread).
//
// If for some reason we forget to reset aState.mCompositedFrameInvalid, then
// GetCompositedFrame will fail, even if we have all the data available for
// display.
if (currentFrameEndTime > aTime && aState.mCompositedFrameInvalid &&
mLastCompositedFrameIndex >= 0) {
(mLastCompositedFrameIndex >= 0 || currentFrame->IsFullFrame())) {
aState.mCompositedFrameInvalid = false;
ret.mDirtyRect = IntRect(IntPoint(0,0), mSize);
}

View File

@ -4686,7 +4686,7 @@ pref("image.animated.decode-on-demand.recycle", true);
// Whether we should generate full frames at decode time or partial frames which
// are combined at display time (historical behavior and default).
pref("image.animated.generate-full-frames", false);
pref("image.animated.generate-full-frames", true);
// Resume an animated image from the last displayed frame rather than
// advancing when out of view.