| 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 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/trace_event/trace_event.h" | 12 #include "base/trace_event/trace_event.h" |
| 13 #include "cc/animation/animation_events.h" | 13 #include "cc/animation/animation_events.h" |
| 14 #include "cc/animation/animation_host.h" | 14 #include "cc/animation/animation_host.h" |
| 15 #include "cc/animation/animation_id_provider.h" | 15 #include "cc/animation/animation_id_provider.h" |
| 16 #include "cc/animation/animation_player.h" | 16 #include "cc/animation/animation_player.h" |
| 17 #include "cc/animation/animation_registrar.h" | |
| 18 #include "cc/animation/animation_timeline.h" | 17 #include "cc/animation/animation_timeline.h" |
| 19 #include "cc/animation/element_animations.h" | 18 #include "cc/animation/element_animations.h" |
| 20 #include "cc/animation/layer_animation_controller.h" | 19 #include "cc/animation/layer_animation_controller.h" |
| 21 #include "cc/output/begin_frame_args.h" | 20 #include "cc/output/begin_frame_args.h" |
| 22 #include "ui/compositor/compositor.h" | 21 #include "ui/compositor/compositor.h" |
| 23 #include "ui/compositor/layer.h" | 22 #include "ui/compositor/layer.h" |
| 24 #include "ui/compositor/layer_animation_delegate.h" | 23 #include "ui/compositor/layer_animation_delegate.h" |
| 25 #include "ui/compositor/layer_animation_observer.h" | 24 #include "ui/compositor/layer_animation_observer.h" |
| 26 #include "ui/compositor/layer_animation_sequence.h" | 25 #include "ui/compositor/layer_animation_sequence.h" |
| 27 #include "ui/compositor/layer_animator_collection.h" | 26 #include "ui/compositor/layer_animator_collection.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 DCHECK(timeline); | 153 DCHECK(timeline); |
| 155 | 154 |
| 156 DCHECK(delegate_->GetCcLayer()); | 155 DCHECK(delegate_->GetCcLayer()); |
| 157 | 156 |
| 158 // Register LAC so ElementAnimations picks it up via | 157 // Register LAC so ElementAnimations picks it up via |
| 159 // AnimationRegistrar::GetAnimationControllerForId. | 158 // AnimationRegistrar::GetAnimationControllerForId. |
| 160 if (animation_controller_state_) { | 159 if (animation_controller_state_) { |
| 161 DCHECK_EQ(animation_controller_state_->id(), | 160 DCHECK_EQ(animation_controller_state_->id(), |
| 162 delegate_->GetCcLayer()->id()); | 161 delegate_->GetCcLayer()->id()); |
| 163 timeline->animation_host() | 162 timeline->animation_host() |
| 164 ->animation_registrar() | |
| 165 ->RegisterAnimationController(animation_controller_state_.get()); | 163 ->RegisterAnimationController(animation_controller_state_.get()); |
| 166 } | 164 } |
| 167 | 165 |
| 168 timeline->AttachPlayer(animation_player_); | 166 timeline->AttachPlayer(animation_player_); |
| 169 | 167 |
| 170 AttachLayerToAnimationPlayer(delegate_->GetCcLayer()->id()); | 168 AttachLayerToAnimationPlayer(delegate_->GetCcLayer()->id()); |
| 171 | 169 |
| 172 // Release LAC (it is referenced in ElementAnimations). | 170 // Release LAC (it is referenced in ElementAnimations). |
| 173 animation_controller_state_ = nullptr; | 171 animation_controller_state_ = nullptr; |
| 174 } | 172 } |
| (...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 const base::WeakPtr<LayerAnimationSequence>& sequence) | 963 const base::WeakPtr<LayerAnimationSequence>& sequence) |
| 966 : sequence_(sequence) { | 964 : sequence_(sequence) { |
| 967 } | 965 } |
| 968 | 966 |
| 969 LayerAnimator::RunningAnimation::RunningAnimation( | 967 LayerAnimator::RunningAnimation::RunningAnimation( |
| 970 const RunningAnimation& other) = default; | 968 const RunningAnimation& other) = default; |
| 971 | 969 |
| 972 LayerAnimator::RunningAnimation::~RunningAnimation() { } | 970 LayerAnimator::RunningAnimation::~RunningAnimation() { } |
| 973 | 971 |
| 974 } // namespace ui | 972 } // namespace ui |
| OLD | NEW |