| Index: cc/animation/element_animations.cc
|
| diff --git a/cc/animation/element_animations.cc b/cc/animation/element_animations.cc
|
| index 80823d226b1b3a4893705570d3a4ecfaafbdf0d4..0c6aa877f6016dfefa16b6d615a9860ccead20a6 100644
|
| --- a/cc/animation/element_animations.cc
|
| +++ b/cc/animation/element_animations.cc
|
| @@ -33,7 +33,8 @@ ElementAnimations::ElementAnimations()
|
| has_element_in_active_list_(false),
|
| has_element_in_pending_list_(false),
|
| needs_to_start_animations_(false),
|
| - scroll_offset_animation_was_interrupted_(false) {}
|
| + scroll_offset_animation_was_interrupted_(false),
|
| + needs_push_properties_(false) {}
|
|
|
| ElementAnimations::~ElementAnimations() {}
|
|
|
| @@ -122,9 +123,18 @@ bool ElementAnimations::IsEmpty() const {
|
| return !players_list_->might_have_observers();
|
| }
|
|
|
| +void ElementAnimations::SetNeedsPushProperties() {
|
| + needs_push_properties_ = true;
|
| +}
|
| +
|
| void ElementAnimations::PushPropertiesTo(
|
| scoped_refptr<ElementAnimations> element_animations_impl) {
|
| DCHECK_NE(this, element_animations_impl);
|
| +
|
| + if (!needs_push_properties_)
|
| + return;
|
| + needs_push_properties_ = false;
|
| +
|
| if (!has_any_animation() && !element_animations_impl->has_any_animation())
|
| return;
|
| MarkAbortedAnimationsForDeletion(element_animations_impl.get());
|
| @@ -886,7 +896,7 @@ void ElementAnimations::MarkAnimationsForDeletion(
|
| }
|
| }
|
| if (marked_animations_for_deletions)
|
| - NotifyClientAnimationWaitingForDeletion();
|
| + NotifyPlayersAnimationWaitingForDeletion();
|
| }
|
|
|
| void ElementAnimations::MarkAbortedAnimationsForDeletion(
|
| @@ -1065,10 +1075,6 @@ void ElementAnimations::NotifyClientScrollOffsetAnimated(
|
| OnScrollOffsetAnimated(ElementListType::PENDING, scroll_offset);
|
| }
|
|
|
| -void ElementAnimations::NotifyClientAnimationWaitingForDeletion() {
|
| - OnAnimationWaitingForDeletion();
|
| -}
|
| -
|
| void ElementAnimations::NotifyClientAnimationChanged(
|
| TargetProperty::Type property,
|
| ElementListType list_type,
|
| @@ -1388,13 +1394,6 @@ void ElementAnimations::OnScrollOffsetAnimated(
|
| element_id(), list_type, scroll_offset);
|
| }
|
|
|
| -void ElementAnimations::OnAnimationWaitingForDeletion() {
|
| - // TODO(loyso): Invalidate AnimationHost::SetNeedsPushProperties here.
|
| - // But we always do PushProperties in AnimationHost for now. crbug.com/604280
|
| - DCHECK(animation_host());
|
| - animation_host()->OnAnimationWaitingForDeletion();
|
| -}
|
| -
|
| void ElementAnimations::IsAnimatingChanged(ElementListType list_type,
|
| TargetProperty::Type property,
|
| AnimationChangeType change_type,
|
| @@ -1461,6 +1460,13 @@ void ElementAnimations::NotifyPlayersAnimationAborted(
|
| player->NotifyAnimationAborted(monotonic_time, target_property, group);
|
| }
|
|
|
| +void ElementAnimations::NotifyPlayersAnimationWaitingForDeletion() {
|
| + ElementAnimations::PlayersList::Iterator it(players_list_.get());
|
| + AnimationPlayer* player;
|
| + while ((player = it.GetNext()) != nullptr)
|
| + player->NotifyAnimationWaitingForDeletion();
|
| +}
|
| +
|
| void ElementAnimations::NotifyPlayersAnimationTakeover(
|
| base::TimeTicks monotonic_time,
|
| TargetProperty::Type target_property,
|
|
|