Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Unified Diff: cc/animation/element_animations.cc

Issue 2291463003: Revert "CC Animation: Introduce some dirty flags to optimize PushProperties on commit" (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/animation/element_animations.h ('k') | cc/animation/element_animations_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/element_animations.cc
diff --git a/cc/animation/element_animations.cc b/cc/animation/element_animations.cc
index b9bfa8d287823afb538574b81f08e34ad98c005f..80823d226b1b3a4893705570d3a4ecfaafbdf0d4 100644
--- a/cc/animation/element_animations.cc
+++ b/cc/animation/element_animations.cc
@@ -33,8 +33,7 @@ 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),
- needs_push_properties_(false) {}
+ scroll_offset_animation_was_interrupted_(false) {}
ElementAnimations::~ElementAnimations() {}
@@ -123,18 +122,9 @@ 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());
@@ -167,7 +157,6 @@ void ElementAnimations::AddAnimation(std::unique_ptr<Animation> animation) {
default:
break;
}
- SetNeedsPushProperties();
}
void ElementAnimations::Animate(base::TimeTicks monotonic_time) {
@@ -897,7 +886,7 @@ void ElementAnimations::MarkAnimationsForDeletion(
}
}
if (marked_animations_for_deletions)
- NotifyPlayersAnimationWaitingForDeletion();
+ NotifyClientAnimationWaitingForDeletion();
}
void ElementAnimations::MarkAbortedAnimationsForDeletion(
@@ -1076,6 +1065,10 @@ void ElementAnimations::NotifyClientScrollOffsetAnimated(
OnScrollOffsetAnimated(ElementListType::PENDING, scroll_offset);
}
+void ElementAnimations::NotifyClientAnimationWaitingForDeletion() {
+ OnAnimationWaitingForDeletion();
+}
+
void ElementAnimations::NotifyClientAnimationChanged(
TargetProperty::Type property,
ElementListType list_type,
@@ -1252,7 +1245,6 @@ void ElementAnimations::PauseAnimation(int animation_id,
animations_[i]->time_offset());
}
}
- SetNeedsPushProperties();
}
void ElementAnimations::RemoveAnimation(int animation_id) {
@@ -1290,8 +1282,6 @@ void ElementAnimations::RemoveAnimation(int animation_id) {
UpdateClientAnimationState(TargetProperty::OPACITY);
if (removed_filter_animation)
UpdateClientAnimationState(TargetProperty::FILTER);
-
- SetNeedsPushProperties();
}
void ElementAnimations::AbortAnimation(int animation_id) {
@@ -1309,8 +1299,6 @@ void ElementAnimations::AbortAnimation(int animation_id) {
}
}
}
-
- SetNeedsPushProperties();
}
void ElementAnimations::AbortAnimations(TargetProperty::Type target_property,
@@ -1344,8 +1332,6 @@ void ElementAnimations::AbortAnimations(TargetProperty::Type target_property,
break;
}
}
-
- SetNeedsPushProperties();
}
Animation* ElementAnimations::GetAnimation(
@@ -1402,6 +1388,13 @@ 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,
@@ -1468,13 +1461,6 @@ 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,
« no previous file with comments | « cc/animation/element_animations.h ('k') | cc/animation/element_animations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698