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

Unified Diff: ui/compositor/layer_animator.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 | « 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 edd47487a9b4bf7218f005bfeed390391a3af7ae..5af6fb6ae5c04a825d96fe7044288a0458cfaec7 100644
--- a/ui/compositor/layer_animator.cc
+++ b/ui/compositor/layer_animator.cc
@@ -135,59 +135,30 @@ void LayerAnimator::SetDelegate(LayerAnimationDelegate* delegate) {
}
void LayerAnimator::SwitchToLayer(scoped_refptr<cc::Layer> new_layer) {
- // Release ElementAnimations state for old layer.
- element_animations_state_ = nullptr;
-
if (delegate_)
DetachLayerFromAnimationPlayer();
if (new_layer)
AttachLayerToAnimationPlayer(new_layer->id());
}
-void LayerAnimator::SetCompositor(Compositor* compositor) {
+void LayerAnimator::AttachLayerAndTimeline(Compositor* compositor) {
DCHECK(compositor);
cc::AnimationTimeline* timeline = compositor->GetAnimationTimeline();
DCHECK(timeline);
-
- DCHECK(delegate_->GetCcLayer());
-
- // Register ElementAnimations so it will be picked up by
- // AnimationHost::RegisterPlayerForLayer via
- // AnimationHost::GetElementAnimationsForLayerId.
- if (element_animations_state_) {
- DCHECK_EQ(element_animations_state_->element_id().primaryId,
- delegate_->GetCcLayer()->id());
- timeline->animation_host()->RegisterElementAnimations(
- element_animations_state_.get());
- }
-
timeline->AttachPlayer(animation_player_);
+ DCHECK(delegate_->GetCcLayer());
AttachLayerToAnimationPlayer(delegate_->GetCcLayer()->id());
-
- // Release ElementAnimations state.
- element_animations_state_ = nullptr;
}
-void LayerAnimator::ResetCompositor(Compositor* compositor) {
+void LayerAnimator::DetachLayerAndTimeline(Compositor* compositor) {
DCHECK(compositor);
cc::AnimationTimeline* timeline = compositor->GetAnimationTimeline();
DCHECK(timeline);
- cc::ElementId element_id(animation_player_->element_id());
-
- // Store a reference to ElementAnimations (if any)
- // so it may be picked up in LayerAnimator::SetCompositor.
- if (element_id) {
- element_animations_state_ =
- timeline->animation_host()->GetElementAnimationsForElementId(
- element_id);
- }
-
DetachLayerFromAnimationPlayer();
-
timeline->DetachPlayer(animation_player_);
}
« 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