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

Unified Diff: cc/animation/animation_host.cc

Issue 2363733004: UI Compositor Animation: Remove cc::ElementAnimations state storage. (Closed)
Patch Set: Reparent. Created 4 years, 2 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/animation_host.h ('k') | ui/compositor/layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/animation_host.cc
diff --git a/cc/animation/animation_host.cc b/cc/animation/animation_host.cc
index 53f21c72c6709d9116ac681abec612ab9de8340c..eb76c596e181713191b3ff19a52b88a4216ef5f9 100644
--- a/cc/animation/animation_host.cc
+++ b/cc/animation/animation_host.cc
@@ -128,7 +128,8 @@ void AnimationHost::RegisterPlayerForElement(ElementId element_id,
if (!element_animations) {
element_animations = ElementAnimations::Create();
element_animations->SetElementId(element_id);
- RegisterElementAnimations(element_animations.get());
+ element_to_animations_map_[element_animations->element_id()] =
+ element_animations;
}
if (element_animations->animation_host() != this) {
@@ -151,7 +152,8 @@ void AnimationHost::UnregisterPlayerForElement(ElementId element_id,
if (element_animations->IsEmpty()) {
element_animations->ClearAffectedElementTypes();
- UnregisterElementAnimations(element_animations.get());
+ element_to_animations_map_.erase(element_animations->element_id());
+ DidDeactivateElementAnimations(element_animations.get());
element_animations->SetAnimationHost(nullptr);
}
}
@@ -562,20 +564,6 @@ void AnimationHost::DidDeactivateElementAnimations(
active_element_to_animations_map_.erase(element_animations->element_id());
}
-void AnimationHost::RegisterElementAnimations(
- ElementAnimations* element_animations) {
- DCHECK(element_animations->element_id());
- element_to_animations_map_[element_animations->element_id()] =
- element_animations;
-}
-
-void AnimationHost::UnregisterElementAnimations(
- ElementAnimations* element_animations) {
- DCHECK(element_animations->element_id());
- element_to_animations_map_.erase(element_animations->element_id());
- DidDeactivateElementAnimations(element_animations);
-}
-
const AnimationHost::ElementToAnimationsMap&
AnimationHost::active_element_animations_for_testing() const {
return active_element_to_animations_map_;
« no previous file with comments | « cc/animation/animation_host.h ('k') | ui/compositor/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698