Bug 1629490. In RasterImage invalidate if we get a non-empty dirty rect, don't ignore it if mFrameAdvanced is false. r=aosmond

We invalidate for more things than just frames advancing (if we are redecoding and still showing the same frame as before discarding for example). So there is no reason that the dirty rect and a frame being advanced should be linked.

Differential Revision: https://phabricator.services.mozilla.com/D71483
This commit is contained in:
Timothy Nikkel 2020-04-20 03:38:40 +00:00
parent 288dbdf3a5
commit 008ffcf520
2 changed files with 6 additions and 7 deletions

View File

@ -360,9 +360,6 @@ RefreshResult FrameAnimator::RequestRefresh(AnimationState& aState,
ret.mDirtyRect = aState.UpdateStateInternal(result, mSize);
if (aState.IsDiscarded() || !result) {
aState.MaybeAdvanceAnimationFrameTime(aTime);
if (!ret.mDirtyRect.IsEmpty()) {
ret.mFrameAdvanced = true;
}
return ret;
}

View File

@ -166,14 +166,16 @@ RasterImage::RequestRefresh(const TimeStamp& aTime) {
res = mFrameAnimator->RequestRefresh(*mAnimationState, aTime);
}
if (res.mFrameAdvanced) {
// Notify listeners that our frame has actually changed, but do this only
// once for all frames that we've now passed (if AdvanceFrame() was called
// more than once).
#ifdef DEBUG
if (res.mFrameAdvanced) {
mFramesNotified++;
}
#endif
// Notify listeners that our frame has actually changed, but do this only
// once for all frames that we've now passed (if AdvanceFrame() was called
// more than once).
if (!res.mDirtyRect.IsEmpty() || res.mFrameAdvanced) {
auto dirtyRect = UnorientedIntRect::FromUnknownRect(res.mDirtyRect);
NotifyProgress(NoProgress, dirtyRect);
}