mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 04:38:02 +00:00
Bug 885277 - Fix animation timing and resetAnimation in the presence of changing animationMode
This commit is contained in:
parent
3bfcccec9b
commit
9e116dddaa
@ -218,11 +218,9 @@ FrameAnimator::SetAnimationMode(uint16_t aAnimationMode)
|
||||
}
|
||||
|
||||
void
|
||||
FrameAnimator::InitAnimationFrameTimeIfNecessary()
|
||||
FrameAnimator::InitAnimationFrameTime()
|
||||
{
|
||||
if (mCurrentAnimationFrameTime.IsNull()) {
|
||||
mCurrentAnimationFrameTime = TimeStamp::Now();
|
||||
}
|
||||
mCurrentAnimationFrameTime = TimeStamp::Now();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -99,10 +99,9 @@ public:
|
||||
void UnionFirstFrameRefreshArea(const nsIntRect& aRect);
|
||||
|
||||
/**
|
||||
* If the animation frame time has not yet been set, set it to
|
||||
* TimeStamp::Now().
|
||||
* Set the animation frame time to TimeStamp::Now().
|
||||
*/
|
||||
void InitAnimationFrameTimeIfNecessary();
|
||||
void InitAnimationFrameTime();
|
||||
|
||||
/**
|
||||
* Set the animation frame time to @aTime.
|
||||
|
@ -529,12 +529,12 @@ RasterImage::Init(const char* aMimeType,
|
||||
NS_IMETHODIMP_(void)
|
||||
RasterImage::RequestRefresh(const mozilla::TimeStamp& aTime)
|
||||
{
|
||||
if (!ShouldAnimate()) {
|
||||
EvaluateAnimation();
|
||||
|
||||
if (!mAnimating) {
|
||||
return;
|
||||
}
|
||||
|
||||
EvaluateAnimation();
|
||||
|
||||
FrameAnimator::RefreshResult res;
|
||||
if (mAnim) {
|
||||
res = mAnim->RequestRefresh(aTime);
|
||||
@ -1441,7 +1441,8 @@ RasterImage::StartAnimation()
|
||||
|
||||
// We need to set the time that this initial frame was first displayed, as
|
||||
// this is used in AdvanceFrame().
|
||||
mAnim->InitAnimationFrameTimeIfNecessary();
|
||||
if (!mAnimating)
|
||||
mAnim->InitAnimationFrameTime();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@ -1487,8 +1488,8 @@ RasterImage::ResetAnimation()
|
||||
// Note - We probably want to kick off a redecode somewhere around here when
|
||||
// we fix bug 500402.
|
||||
|
||||
// Update display if we were animating before
|
||||
if (mAnimating && mStatusTracker) {
|
||||
// Update display
|
||||
if (mStatusTracker) {
|
||||
nsIntRect rect = mAnim->GetFirstFrameRefreshArea();
|
||||
mStatusTracker->FrameChanged(&rect);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user