| 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 "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 LayerAnimator::LayerAnimator(base::TimeDelta transition_duration) | 48 LayerAnimator::LayerAnimator(base::TimeDelta transition_duration) |
| 49 : delegate_(NULL), | 49 : delegate_(NULL), |
| 50 preemption_strategy_(IMMEDIATELY_SET_NEW_TARGET), | 50 preemption_strategy_(IMMEDIATELY_SET_NEW_TARGET), |
| 51 is_transition_duration_locked_(false), | 51 is_transition_duration_locked_(false), |
| 52 transition_duration_(transition_duration), | 52 transition_duration_(transition_duration), |
| 53 tween_type_(gfx::Tween::LINEAR), | 53 tween_type_(gfx::Tween::LINEAR), |
| 54 is_started_(false), | 54 is_started_(false), |
| 55 disable_timer_for_test_(false), | 55 disable_timer_for_test_(false), |
| 56 adding_animations_(false) { | 56 adding_animations_(false) { |
| 57 if (Layer::UILayerSettings().use_compositor_animation_timelines) { | 57 animation_player_ = |
| 58 animation_player_ = | 58 cc::AnimationPlayer::Create(cc::AnimationIdProvider::NextPlayerId()); |
| 59 cc::AnimationPlayer::Create(cc::AnimationIdProvider::NextPlayerId()); | |
| 60 } | |
| 61 } | 59 } |
| 62 | 60 |
| 63 LayerAnimator::~LayerAnimator() { | 61 LayerAnimator::~LayerAnimator() { |
| 64 for (size_t i = 0; i < running_animations_.size(); ++i) { | 62 for (size_t i = 0; i < running_animations_.size(); ++i) { |
| 65 if (running_animations_[i].is_sequence_alive()) | 63 if (running_animations_[i].is_sequence_alive()) |
| 66 running_animations_[i].sequence()->OnAnimatorDestroyed(); | 64 running_animations_[i].sequence()->OnAnimatorDestroyed(); |
| 67 } | 65 } |
| 68 ClearAnimationsInternal(); | 66 ClearAnimationsInternal(); |
| 69 delegate_ = NULL; | 67 delegate_ = NULL; |
| 70 DCHECK(!animation_player_ || !animation_player_->animation_timeline()); | 68 DCHECK(!animation_player_ || !animation_player_->animation_timeline()); |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 const base::WeakPtr<LayerAnimationSequence>& sequence) | 954 const base::WeakPtr<LayerAnimationSequence>& sequence) |
| 957 : sequence_(sequence) { | 955 : sequence_(sequence) { |
| 958 } | 956 } |
| 959 | 957 |
| 960 LayerAnimator::RunningAnimation::RunningAnimation( | 958 LayerAnimator::RunningAnimation::RunningAnimation( |
| 961 const RunningAnimation& other) = default; | 959 const RunningAnimation& other) = default; |
| 962 | 960 |
| 963 LayerAnimator::RunningAnimation::~RunningAnimation() { } | 961 LayerAnimator::RunningAnimation::~RunningAnimation() { } |
| 964 | 962 |
| 965 } // namespace ui | 963 } // namespace ui |
| OLD | NEW |