| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/animation/layer_animation_controller.h" | 5 #include "cc/animation/layer_animation_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "cc/animation/animation.h" | 9 #include "cc/animation/animation.h" |
| 10 #include "cc/animation/animation_registrar.h" | 10 #include "cc/animation/animation_registrar.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 Animation::Transform, | 167 Animation::Transform, |
| 168 monotonic_time); | 168 monotonic_time); |
| 169 event.transform = | 169 event.transform = |
| 170 animation->curve()->ToTransformAnimationCurve()->GetValue( | 170 animation->curve()->ToTransformAnimationCurve()->GetValue( |
| 171 monotonic_time); | 171 monotonic_time); |
| 172 events->push_back(event); | 172 events->push_back(event); |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 | 176 |
| 177 void LayerAnimationController::UpdateState(AnimationEventsVector* events) { | 177 void LayerAnimationController::UpdateState(bool start_ready_animations, |
| 178 AnimationEventsVector* events) { |
| 178 if (!HasActiveObserver()) | 179 if (!HasActiveObserver()) |
| 179 return; | 180 return; |
| 180 | 181 |
| 181 PromoteStartedAnimations(last_tick_time_, events); | 182 if (start_ready_animations) |
| 183 PromoteStartedAnimations(last_tick_time_, events); |
| 184 |
| 182 MarkFinishedAnimations(last_tick_time_); | 185 MarkFinishedAnimations(last_tick_time_); |
| 183 MarkAnimationsForDeletion(last_tick_time_, events); | 186 MarkAnimationsForDeletion(last_tick_time_, events); |
| 184 StartAnimationsWaitingForTargetAvailability(last_tick_time_); | 187 |
| 185 PromoteStartedAnimations(last_tick_time_, events); | 188 if (start_ready_animations) { |
| 189 StartAnimationsWaitingForTargetAvailability(last_tick_time_); |
| 190 PromoteStartedAnimations(last_tick_time_, events); |
| 191 } |
| 186 | 192 |
| 187 AccumulatePropertyUpdates(last_tick_time_, events); | 193 AccumulatePropertyUpdates(last_tick_time_, events); |
| 188 | 194 |
| 189 UpdateActivation(NormalActivation); | 195 UpdateActivation(NormalActivation); |
| 190 } | 196 } |
| 191 | 197 |
| 192 void LayerAnimationController::AddAnimation(scoped_ptr<Animation> animation) { | 198 void LayerAnimationController::AddAnimation(scoped_ptr<Animation> animation) { |
| 193 active_animations_.push_back(animation.Pass()); | 199 active_animations_.push_back(animation.Pass()); |
| 194 UpdateActivation(NormalActivation); | 200 UpdateActivation(NormalActivation); |
| 195 } | 201 } |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 ObserverListBase<LayerAnimationValueObserver>::Iterator it(observers_); | 623 ObserverListBase<LayerAnimationValueObserver>::Iterator it(observers_); |
| 618 LayerAnimationValueObserver* obs; | 624 LayerAnimationValueObserver* obs; |
| 619 while ((obs = it.GetNext()) != NULL) | 625 while ((obs = it.GetNext()) != NULL) |
| 620 if (obs->IsActive()) | 626 if (obs->IsActive()) |
| 621 return true; | 627 return true; |
| 622 } | 628 } |
| 623 return false; | 629 return false; |
| 624 } | 630 } |
| 625 | 631 |
| 626 } // namespace cc | 632 } // namespace cc |
| OLD | NEW |