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

Side by Side Diff: ui/compositor/layer_animator.cc

Issue 2335043002: CC Animation: Move animations_ from ElementAnimations to AnimationPlayer. (Closed)
Patch Set: Clean it up harder. Rework UpdateClientAnimationState. Created 4 years, 3 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 unified diff | Download patch
OLDNEW
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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 void LayerAnimator::AddThreadedAnimation( 212 void LayerAnimator::AddThreadedAnimation(
213 std::unique_ptr<cc::Animation> animation) { 213 std::unique_ptr<cc::Animation> animation) {
214 animation_player_->AddAnimation(std::move(animation)); 214 animation_player_->AddAnimation(std::move(animation));
215 } 215 }
216 216
217 void LayerAnimator::RemoveThreadedAnimation(int animation_id) { 217 void LayerAnimator::RemoveThreadedAnimation(int animation_id) {
218 animation_player_->RemoveAnimation(animation_id); 218 animation_player_->RemoveAnimation(animation_id);
219 } 219 }
220 220
221 bool LayerAnimator::HasPendingThreadedAnimationsForTesting() const {
222 return animation_player_->has_any_animation();
223 }
224
225 cc::AnimationPlayer* LayerAnimator::GetAnimationPlayerForTesting() const { 221 cc::AnimationPlayer* LayerAnimator::GetAnimationPlayerForTesting() const {
226 return animation_player_.get(); 222 return animation_player_.get();
227 } 223 }
228 224
229 void LayerAnimator::StartAnimation(LayerAnimationSequence* animation) { 225 void LayerAnimator::StartAnimation(LayerAnimationSequence* animation) {
230 scoped_refptr<LayerAnimator> retain(this); 226 scoped_refptr<LayerAnimator> retain(this);
231 OnScheduled(animation); 227 OnScheduled(animation);
232 if (!StartSequenceImmediately(animation)) { 228 if (!StartSequenceImmediately(animation)) {
233 // Attempt to preempt a running animation. 229 // Attempt to preempt a running animation.
234 switch (preemption_strategy_) { 230 switch (preemption_strategy_) {
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 const base::WeakPtr<LayerAnimationSequence>& sequence) 963 const base::WeakPtr<LayerAnimationSequence>& sequence)
968 : sequence_(sequence) { 964 : sequence_(sequence) {
969 } 965 }
970 966
971 LayerAnimator::RunningAnimation::RunningAnimation( 967 LayerAnimator::RunningAnimation::RunningAnimation(
972 const RunningAnimation& other) = default; 968 const RunningAnimation& other) = default;
973 969
974 LayerAnimator::RunningAnimation::~RunningAnimation() { } 970 LayerAnimator::RunningAnimation::~RunningAnimation() { }
975 971
976 } // namespace ui 972 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698