OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/compositor/layer_animator.h" | 5 #include "ui/compositor/layer_animator.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 cc::AnimationTimeline* timeline = compositor->GetAnimationTimeline(); | 160 cc::AnimationTimeline* timeline = compositor->GetAnimationTimeline(); |
161 DCHECK(timeline); | 161 DCHECK(timeline); |
162 | 162 |
163 DetachLayerFromAnimationPlayer(); | 163 DetachLayerFromAnimationPlayer(); |
164 timeline->DetachPlayer(animation_player_); | 164 timeline->DetachPlayer(animation_player_); |
165 } | 165 } |
166 | 166 |
167 void LayerAnimator::AttachLayerToAnimationPlayer(int layer_id) { | 167 void LayerAnimator::AttachLayerToAnimationPlayer(int layer_id) { |
168 // For ui, layer and element ids are equivalent. | 168 // For ui, layer and element ids are equivalent. |
169 cc::ElementId element_id(layer_id, 0); | 169 cc::ElementId element_id(layer_id); |
170 if (!animation_player_->element_id()) | 170 if (!animation_player_->element_id()) |
171 animation_player_->AttachElement(element_id); | 171 animation_player_->AttachElement(element_id); |
172 else | 172 else |
173 DCHECK_EQ(animation_player_->element_id(), element_id); | 173 DCHECK_EQ(animation_player_->element_id(), element_id); |
174 | 174 |
175 animation_player_->set_animation_delegate(this); | 175 animation_player_->set_animation_delegate(this); |
176 } | 176 } |
177 | 177 |
178 void LayerAnimator::DetachLayerFromAnimationPlayer() { | 178 void LayerAnimator::DetachLayerFromAnimationPlayer() { |
179 animation_player_->set_animation_delegate(nullptr); | 179 animation_player_->set_animation_delegate(nullptr); |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 const base::WeakPtr<LayerAnimationSequence>& sequence) | 935 const base::WeakPtr<LayerAnimationSequence>& sequence) |
936 : sequence_(sequence) { | 936 : sequence_(sequence) { |
937 } | 937 } |
938 | 938 |
939 LayerAnimator::RunningAnimation::RunningAnimation( | 939 LayerAnimator::RunningAnimation::RunningAnimation( |
940 const RunningAnimation& other) = default; | 940 const RunningAnimation& other) = default; |
941 | 941 |
942 LayerAnimator::RunningAnimation::~RunningAnimation() { } | 942 LayerAnimator::RunningAnimation::~RunningAnimation() { } |
943 | 943 |
944 } // namespace ui | 944 } // namespace ui |
OLD | NEW |