Chromium Code Reviews| Index: cc/animation/layer_animation_controller.cc |
| diff --git a/cc/animation/layer_animation_controller.cc b/cc/animation/layer_animation_controller.cc |
| index e6e720f2f230e373505274baf918cff3690fb4c7..d85f1f3ca5db70af5d616585eda1962989ed7081 100644 |
| --- a/cc/animation/layer_animation_controller.cc |
| +++ b/cc/animation/layer_animation_controller.cc |
| @@ -810,7 +810,9 @@ void LayerAnimationController::MarkAnimationsForDeletion( |
| // on the impl thread, we only mark a FINISHED main thread animation for |
| // deletion once it has received a FINISHED event from the impl thread. |
| bool animation_i_will_send_or_has_received_finish_event = |
| - events || animations_[i]->received_finished_event(); |
| + animations_[i]->is_controlling_instance() || |
| + animations_[i]->is_impl_only() || |
| + animations_[i]->received_finished_event(); |
| // If an animation is finished, and not already marked for deletion, |
| // find out if all other animations in the same group are also finished. |
| if (animations_[i]->run_state() == Animation::FINISHED && |
| @@ -822,7 +824,9 @@ void LayerAnimationController::MarkAnimationsForDeletion( |
| all_anims_with_same_id_are_finished = true; |
| for (size_t j = 0; j < animations_.size(); ++j) { |
| bool animation_j_will_send_or_has_received_finish_event = |
| - events || animations_[j]->received_finished_event(); |
| + animations_[j]->is_controlling_instance() || |
| + animations_[j]->is_impl_only() || |
| + animations_[j]->received_finished_event(); |
| if (group_id == animations_[j]->group()) { |
| if (!animations_[j]->is_finished() || |
| (animations_[j]->run_state() == Animation::FINISHED && |
| @@ -847,21 +851,23 @@ void LayerAnimationController::MarkAnimationsForDeletion( |
| // necessary). |
| for (size_t j = 0; j < animations_with_same_group_id.size(); j++) { |
| size_t animation_index = animations_with_same_group_id[j]; |
| - if (events) { |
| - AnimationEvent finished_event( |
| - AnimationEvent::FINISHED, id_, |
| - animations_[animation_index]->group(), |
| - animations_[animation_index]->target_property(), |
| - monotonic_time); |
| - finished_event.is_impl_only = |
| - animations_[animation_index]->is_impl_only(); |
| - if (finished_event.is_impl_only) |
| - NotifyAnimationFinished(finished_event); |
| - else |
| - events->push_back(finished_event); |
| - } |
| - animations_[animation_index]->SetRunState( |
| - Animation::WAITING_FOR_DELETION, monotonic_time); |
| + bool impl_animation = |
| + animations_[animation_index]->is_controlling_instance() || |
| + animations_[animation_index]->is_impl_only(); |
| + if (events && impl_animation) { |
|
ajuma
2015/06/16 13:51:53
This will prevent Finished events from being produ
|
| + AnimationEvent finished_event( |
| + AnimationEvent::FINISHED, id_, |
| + animations_[animation_index]->group(), |
| + animations_[animation_index]->target_property(), monotonic_time); |
| + finished_event.is_impl_only = |
| + animations_[animation_index]->is_impl_only(); |
| + if (finished_event.is_impl_only) |
| + NotifyAnimationFinished(finished_event); |
| + else |
| + events->push_back(finished_event); |
| + } |
| + animations_[animation_index]->SetRunState( |
| + Animation::WAITING_FOR_DELETION, monotonic_time); |
| } |
| marked_animations_for_deletions = true; |
| } |