Bug 1456679 - Make SampleAnimations return boolean to tell there is any animations even if the animation in delay phase. r=kats

If the animation is in delay phase, we shouldn't produce any values for the
animation but we have to make sure subsequent ticks happen in order to the time
when the animation starts.  So what we should do here is that

1) Make AnimationHelper::SampleAnimations() return boolean, return true if
   there is any animation.
2) Schedule the next tick if AnimationHelper::SampleAnimations return true

This setup is equivalent to what we do non-WebRender.

So that we don't need to set non-animated value as AnimatedValue for delay
phase to make subsequent ticks happen for the delay phase animations.  The
non-animated value will be dropped in the next patch.

MozReview-Commit-ID: IwltLGgvT7K
This commit is contained in:
Hiroyuki Ikezoe
2018-05-08 15:48:27 +09:00
parent 228ebec9e2
commit 5d9c74e4b5
4 changed files with 31 additions and 17 deletions

View File

@@ -613,16 +613,17 @@ AnimationHelper::GetNextCompositorAnimationsId()
return nextId;
}
void
bool
AnimationHelper::SampleAnimations(CompositorAnimationStorage* aStorage,
TimeStamp aPreviousFrameTime,
TimeStamp aCurrentFrameTime)
{
MOZ_ASSERT(aStorage);
bool isAnimating = false;
// Do nothing if there are no compositor animations
if (!aStorage->AnimationsCount()) {
return;
return isAnimating;
}
//Sample the animations in CompositorAnimationStorage
@@ -633,6 +634,7 @@ AnimationHelper::SampleAnimations(CompositorAnimationStorage* aStorage,
continue;
}
isAnimating = true;
RefPtr<RawServoAnimationValue> animationValue;
InfallibleTArray<AnimData> animationData;
AnimationHelper::SetAnimations(*animations,
@@ -697,6 +699,8 @@ AnimationHelper::SampleAnimations(CompositorAnimationStorage* aStorage,
MOZ_ASSERT_UNREACHABLE("Unhandled animated property");
}
}
return isAnimating;
}
} // namespace layers