forked from mirrors/gecko-dev
Bug 1765116. Don't ignore any potential invalidation rect from calling UpdateState in FrameAnimator::ResetAnimation. r=aosmond
I added this in bug 1676990, I'm not sure why I ignored the rect return value, probably should have either asserted it was empty if I thought that or dealt with the return value. Depends on D143894 Differential Revision: https://phabricator.services.mozilla.com/D143895
This commit is contained in:
parent
6755393273
commit
5702c6bb2c
1 changed files with 11 additions and 1 deletions
|
|
@ -338,7 +338,17 @@ void FrameAnimator::ResetAnimation(AnimationState& aState) {
|
||||||
|
|
||||||
// Calling Reset on the surface of the animation can cause discarding surface
|
// Calling Reset on the surface of the animation can cause discarding surface
|
||||||
// providers to throw out all their frames so refresh our state.
|
// providers to throw out all their frames so refresh our state.
|
||||||
aState.UpdateState(mImage, mSize);
|
OrientedIntRect rect =
|
||||||
|
OrientedIntRect::FromUnknownRect(aState.UpdateState(mImage, mSize));
|
||||||
|
|
||||||
|
if (!rect.IsEmpty()) {
|
||||||
|
nsCOMPtr<nsIEventTarget> eventTarget = do_GetMainThread();
|
||||||
|
RefPtr<RasterImage> image = mImage;
|
||||||
|
nsCOMPtr<nsIRunnable> ev = NS_NewRunnableFunction(
|
||||||
|
"FrameAnimator::ResetAnimation",
|
||||||
|
[=]() -> void { image->NotifyProgress(NoProgress, rect); });
|
||||||
|
eventTarget->Dispatch(ev.forget(), NS_DISPATCH_NORMAL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RefreshResult FrameAnimator::RequestRefresh(AnimationState& aState,
|
RefreshResult FrameAnimator::RequestRefresh(AnimationState& aState,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue