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

Unified Diff: ui/compositor/layer_animator.cc

Issue 1887593003: CC Animation: Make layer_animation_controller a private member of ElementAnimations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/trees/layer_tree_host_unittest_animation.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_animator.cc
diff --git a/ui/compositor/layer_animator.cc b/ui/compositor/layer_animator.cc
index 74e9e32d1b95a3fad9f071e8b8bd5084f8f9bfbc..787b12157ef002f4df3ab7345f2a7f177b6c117a 100644
--- a/ui/compositor/layer_animator.cc
+++ b/ui/compositor/layer_animator.cc
@@ -174,16 +174,19 @@ void LayerAnimator::SetCompositor(Compositor* compositor) {
void LayerAnimator::ResetCompositor(Compositor* compositor) {
DCHECK(compositor);
+ cc::AnimationTimeline* timeline = compositor->GetAnimationTimeline();
+ DCHECK(timeline);
+
+ const int layer_id = animation_player_->layer_id();
+
// Store a reference to LAC if any so it may be picked up in SetCompositor.
- if (animation_player_->element_animations()) {
+ if (layer_id) {
animation_controller_state_ =
- animation_player_->element_animations()->layer_animation_controller();
+ timeline->animation_host()->GetControllerForLayerId(layer_id);
}
DetachLayerFromAnimationPlayer();
- cc::AnimationTimeline* timeline = compositor->GetAnimationTimeline();
- DCHECK(timeline);
timeline->DetachPlayer(animation_player_);
}
@@ -195,7 +198,6 @@ void LayerAnimator::AttachLayerToAnimationPlayer(int layer_id) {
if (animation_player_->element_animations()) {
animation_player_->element_animations()
- ->layer_animation_controller()
->AddEventObserver(this);
}
}
@@ -203,7 +205,6 @@ void LayerAnimator::AttachLayerToAnimationPlayer(int layer_id) {
void LayerAnimator::DetachLayerFromAnimationPlayer() {
if (animation_player_->element_animations()) {
animation_player_->element_animations()
- ->layer_animation_controller()
->RemoveEventObserver(this);
}
« no previous file with comments | « cc/trees/layer_tree_host_unittest_animation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698