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

Unified Diff: cc/animation/element_animations.cc

Issue 2042713002: CC Animation: Activate/deactivate ElementAnimations on Layer addition/removal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the nit. Created 4 years, 6 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/trees/layer_tree_host_impl_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 404e9a0aebb44a8530eed346e8f2393334996d20..d6822aedf236311aa1b86ef8bb96d8266ecb31b4 100644
--- a/cc/animation/element_animations.cc
+++ b/cc/animation/element_animations.cc
@@ -89,6 +89,9 @@ void ElementAnimations::ElementRegistered(ElementId element_id,
ElementListType list_type) {
DCHECK_EQ(element_id_, element_id);
+ if (!has_element_in_any_list())
+ UpdateActivation(FORCE_ACTIVATION);
+
if (list_type == ElementListType::ACTIVE)
set_has_element_in_active_list(true);
else
@@ -102,6 +105,9 @@ void ElementAnimations::ElementUnregistered(ElementId element_id,
set_has_element_in_active_list(false);
else
set_has_element_in_pending_list(false);
+
+ if (!has_element_in_any_list())
+ animation_host_->DidDeactivateElementAnimations(this);
}
void ElementAnimations::AddPlayer(AnimationPlayer* player) {
« no previous file with comments | « cc/animation/element_animations.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698