| Index: cc/animation/animation_player.cc
|
| diff --git a/cc/animation/animation_player.cc b/cc/animation/animation_player.cc
|
| index 634d64948ae4637ce642ec66a4364a60e88cec81..3174dcbdab096b0c5b8c3269e6a638372bdbfa47 100644
|
| --- a/cc/animation/animation_player.cc
|
| +++ b/cc/animation/animation_player.cc
|
| @@ -374,6 +374,10 @@ bool AnimationPlayer::NotifyAnimationFinished(const AnimationEvent& event) {
|
| }
|
| }
|
|
|
| + // This is for the case when an animation is already removed on main thread,
|
| + // but the impl version of it sent a finished event and is now waiting for
|
| + // deletion. We would need to delete that animation during push properties.
|
| + SetNeedsPushProperties();
|
| return false;
|
| }
|
|
|
| @@ -795,6 +799,21 @@ void AnimationPlayer::MarkFinishedAnimations(base::TimeTicks monotonic_time) {
|
| animations_[i]->IsFinishedAt(monotonic_time)) {
|
| animations_[i]->SetRunState(Animation::FINISHED, monotonic_time);
|
| animation_finished = true;
|
| + SetNeedsPushProperties();
|
| + }
|
| + if (!animations_[i]->affects_active_elements() &&
|
| + !animations_[i]->affects_pending_elements()) {
|
| + switch (animations_[i]->run_state()) {
|
| + case Animation::WAITING_FOR_TARGET_AVAILABILITY:
|
| + case Animation::STARTING:
|
| + case Animation::RUNNING:
|
| + case Animation::PAUSED:
|
| + animations_[i]->SetRunState(Animation::FINISHED, monotonic_time);
|
| + animation_finished = true;
|
| + break;
|
| + default:
|
| + break;
|
| + }
|
| }
|
| }
|
|
|
| @@ -814,11 +833,6 @@ void AnimationPlayer::ActivateAnimations() {
|
| animations_[i]->set_affects_active_elements(
|
| animations_[i]->affects_pending_elements());
|
| }
|
| - auto affects_no_elements = [](const std::unique_ptr<Animation>& animation) {
|
| - return !animation->affects_active_elements() &&
|
| - !animation->affects_pending_elements();
|
| - };
|
| - base::EraseIf(animations_, affects_no_elements);
|
|
|
| if (animation_activated)
|
| element_animations_->UpdateClientAnimationState();
|
| @@ -1151,7 +1165,9 @@ static bool IsCompleted(Animation* animation,
|
| if (animation->is_impl_only()) {
|
| return (animation->run_state() == Animation::WAITING_FOR_DELETION);
|
| } else {
|
| - return !main_thread_player->GetAnimationById(animation->id());
|
| + Animation* main_thread_animation =
|
| + main_thread_player->GetAnimationById(animation->id());
|
| + return !main_thread_animation || main_thread_animation->is_finished();
|
| }
|
| }
|
|
|
|
|