| Index: cc/animation/animation_host.cc
|
| diff --git a/cc/animation/animation_host.cc b/cc/animation/animation_host.cc
|
| index cc68c340502ab1839bc0bff2d2c69da5880a1841..5d30516a53c3289fed11f5e317c4cded11484bca 100644
|
| --- a/cc/animation/animation_host.cc
|
| +++ b/cc/animation/animation_host.cc
|
| @@ -157,7 +157,7 @@ void AnimationHost::UnregisterPlayerForElement(ElementId element_id,
|
| element_animations->SetAnimationHost(nullptr);
|
| }
|
|
|
| - DeactivateAnimationPlayer(player);
|
| + RemoveFromTicking(player);
|
| }
|
|
|
| void AnimationHost::SetMutatorHostClient(MutatorHostClient* client) {
|
| @@ -270,44 +270,44 @@ bool AnimationHost::SupportsScrollAnimations() const {
|
| return supports_scroll_animations_;
|
| }
|
|
|
| -bool AnimationHost::NeedsAnimateLayers() const {
|
| - return !active_players_.empty();
|
| +bool AnimationHost::NeedsTickAnimations() const {
|
| + return !ticking_players_.empty();
|
| }
|
|
|
| bool AnimationHost::ActivateAnimations() {
|
| - if (!NeedsAnimateLayers())
|
| + if (!NeedsTickAnimations())
|
| return false;
|
|
|
| TRACE_EVENT0("cc", "AnimationHost::ActivateAnimations");
|
| - PlayersList active_active_players_copy = active_players_;
|
| - for (auto& it : active_active_players_copy)
|
| + PlayersList ticking_players_copy = ticking_players_;
|
| + for (auto& it : ticking_players_copy)
|
| it->ActivateAnimations();
|
|
|
| return true;
|
| }
|
|
|
| -bool AnimationHost::AnimateLayers(base::TimeTicks monotonic_time) {
|
| - if (!NeedsAnimateLayers())
|
| +bool AnimationHost::TickAnimations(base::TimeTicks monotonic_time) {
|
| + if (!NeedsTickAnimations())
|
| return false;
|
|
|
| - TRACE_EVENT0("cc", "AnimationHost::AnimateLayers");
|
| - PlayersList active_active_players_copy = active_players_;
|
| - for (auto& it : active_active_players_copy)
|
| - it->Animate(monotonic_time);
|
| + TRACE_EVENT0("cc", "AnimationHost::TickAnimations");
|
| + PlayersList ticking_players_copy = ticking_players_;
|
| + for (auto& it : ticking_players_copy)
|
| + it->Tick(monotonic_time);
|
|
|
| return true;
|
| }
|
|
|
| bool AnimationHost::UpdateAnimationState(bool start_ready_animations,
|
| MutatorEvents* mutator_events) {
|
| - if (!NeedsAnimateLayers())
|
| + if (!NeedsTickAnimations())
|
| return false;
|
|
|
| auto animation_events = static_cast<AnimationEvents*>(mutator_events);
|
|
|
| TRACE_EVENT0("cc", "AnimationHost::UpdateAnimationState");
|
| - PlayersList active_active_players_copy = active_players_;
|
| - for (auto& it : active_active_players_copy)
|
| + PlayersList ticking_players_copy = ticking_players_;
|
| + for (auto& it : ticking_players_copy)
|
| it->UpdateState(start_ready_animations, animation_events);
|
|
|
| return true;
|
| @@ -326,9 +326,8 @@ void AnimationHost::SetAnimationEvents(
|
| ++event_index) {
|
| ElementId element_id = events->events_[event_index].element_id;
|
|
|
| - // Use the map of all ElementAnimations, not just active ones, since
|
| - // non-active ElementAnimations may still receive events for impl-only
|
| - // animations.
|
| + // Use the map of all ElementAnimations, not just ticking players, since
|
| + // non-ticking Players may still receive events for impl-only animations.
|
| const ElementToAnimationsMap& all_element_animations =
|
| element_to_animations_map_;
|
| auto iter = all_element_animations.find(element_id);
|
| @@ -520,9 +519,9 @@ bool AnimationHost::HasAnyAnimation(ElementId element_id) const {
|
| return element_animations ? element_animations->HasAnyAnimation() : false;
|
| }
|
|
|
| -bool AnimationHost::HasActiveAnimationForTesting(ElementId element_id) const {
|
| +bool AnimationHost::HasTickingAnimationForTesting(ElementId element_id) const {
|
| auto element_animations = GetElementAnimationsForElementId(element_id);
|
| - return element_animations ? element_animations->HasActiveAnimation() : false;
|
| + return element_animations ? element_animations->HasTickingAnimation() : false;
|
| }
|
|
|
| void AnimationHost::ImplOnlyScrollAnimationCreate(
|
| @@ -557,28 +556,26 @@ void AnimationHost::ScrollAnimationAbort(bool needs_completion) {
|
| return scroll_offset_animations_impl_->ScrollAnimationAbort(needs_completion);
|
| }
|
|
|
| -void AnimationHost::ActivateAnimationPlayer(
|
| - scoped_refptr<AnimationPlayer> player) {
|
| - DCHECK(std::find(active_players_.begin(), active_players_.end(), player) ==
|
| - active_players_.end());
|
| - active_players_.push_back(player);
|
| +void AnimationHost::AddToTicking(scoped_refptr<AnimationPlayer> player) {
|
| + DCHECK(std::find(ticking_players_.begin(), ticking_players_.end(), player) ==
|
| + ticking_players_.end());
|
| + ticking_players_.push_back(player);
|
| }
|
|
|
| -void AnimationHost::DeactivateAnimationPlayer(
|
| - scoped_refptr<AnimationPlayer> player) {
|
| +void AnimationHost::RemoveFromTicking(scoped_refptr<AnimationPlayer> player) {
|
| auto to_erase =
|
| - std::find(active_players_.begin(), active_players_.end(), player);
|
| - if (to_erase != active_players_.end())
|
| - active_players_.erase(to_erase);
|
| + std::find(ticking_players_.begin(), ticking_players_.end(), player);
|
| + if (to_erase != ticking_players_.end())
|
| + ticking_players_.erase(to_erase);
|
| }
|
|
|
| -const AnimationHost::PlayersList& AnimationHost::active_players_for_testing()
|
| +const AnimationHost::PlayersList& AnimationHost::ticking_players_for_testing()
|
| const {
|
| - return active_players_;
|
| + return ticking_players_;
|
| }
|
|
|
| const AnimationHost::ElementToAnimationsMap&
|
| -AnimationHost::all_element_animations_for_testing() const {
|
| +AnimationHost::element_animations_for_testing() const {
|
| return element_to_animations_map_;
|
| }
|
|
|
|
|