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

Unified Diff: ui/compositor/layer_animator.cc

Issue 1904653002: CC Animation: Merge LayerAnimationController into ElementAnimations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor optimization: Don't init value observations if same host. 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 | « ui/compositor/layer_animator.h ('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 d7c36da5195748b802eda823ed7a17e310f09674..5a63ce35d697786078b3512f19835f413c57389a 100644
--- a/ui/compositor/layer_animator.cc
+++ b/ui/compositor/layer_animator.cc
@@ -15,7 +15,6 @@
#include "cc/animation/animation_player.h"
#include "cc/animation/animation_timeline.h"
#include "cc/animation/element_animations.h"
-#include "cc/animation/layer_animation_controller.h"
#include "cc/output/begin_frame_args.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/layer.h"
@@ -136,8 +135,8 @@ void LayerAnimator::SetDelegate(LayerAnimationDelegate* delegate) {
}
void LayerAnimator::SwitchToLayer(scoped_refptr<cc::Layer> new_layer) {
- // Release LAC state for old layer.
- animation_controller_state_ = nullptr;
+ // Release ElementAnimations state for old layer.
+ element_animations_state_ = nullptr;
if (delegate_)
DetachLayerFromAnimationPlayer();
@@ -153,21 +152,22 @@ void LayerAnimator::SetCompositor(Compositor* compositor) {
DCHECK(delegate_->GetCcLayer());
- // Register LAC so ElementAnimations picks it up via
- // AnimationRegistrar::GetAnimationControllerForId.
- if (animation_controller_state_) {
- DCHECK_EQ(animation_controller_state_->id(),
+ // Register ElementAnimations so it will be picked up by
+ // AnimationHost::RegisterPlayerForLayer via
+ // AnimationHost::GetElementAnimationsForLayerId.
+ if (element_animations_state_) {
+ DCHECK_EQ(element_animations_state_->layer_id(),
delegate_->GetCcLayer()->id());
- timeline->animation_host()
- ->RegisterAnimationController(animation_controller_state_.get());
+ timeline->animation_host()->RegisterElementAnimations(
+ element_animations_state_.get());
}
timeline->AttachPlayer(animation_player_);
AttachLayerToAnimationPlayer(delegate_->GetCcLayer()->id());
- // Release LAC (it is referenced in ElementAnimations).
- animation_controller_state_ = nullptr;
+ // Release ElementAnimations state.
+ element_animations_state_ = nullptr;
}
void LayerAnimator::ResetCompositor(Compositor* compositor) {
@@ -178,10 +178,11 @@ void LayerAnimator::ResetCompositor(Compositor* compositor) {
const int layer_id = animation_player_->layer_id();
- // Store a reference to LAC if any so it may be picked up in SetCompositor.
+ // Store a reference to ElementAnimations (if any)
+ // so it may be picked up in LayerAnimator::SetCompositor.
if (layer_id) {
- animation_controller_state_ =
- timeline->animation_host()->GetControllerForLayerId(layer_id);
+ element_animations_state_ =
+ timeline->animation_host()->GetElementAnimationsForLayerId(layer_id);
}
DetachLayerFromAnimationPlayer();
« no previous file with comments | « ui/compositor/layer_animator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698