| 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/layer_animation_controller.h" | 5 #include "cc/layer_animation_controller.h" |
| 6 | 6 |
| 7 #include "cc/active_animation.h" | 7 #include "cc/active_animation.h" |
| 8 #include "cc/animation_registrar.h" | 8 #include "cc/animation_registrar.h" |
| 9 #include "cc/keyframed_animation_curve.h" | 9 #include "cc/keyframed_animation_curve.h" |
| 10 #include "cc/layer_animation_value_observer.h" | 10 #include "cc/layer_animation_value_observer.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 removeAnimationsCompletedOnMainThread(controllerImpl); | 96 removeAnimationsCompletedOnMainThread(controllerImpl); |
| 97 | 97 |
| 98 pushPropertiesToImplThread(controllerImpl); | 98 pushPropertiesToImplThread(controllerImpl); |
| 99 } | 99 } |
| 100 controllerImpl->updateActivation(); | 100 controllerImpl->updateActivation(); |
| 101 updateActivation(); | 101 updateActivation(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void LayerAnimationController::animate(double monotonicTime, AnimationEventsVect
or* events) | 104 void LayerAnimationController::animate(double monotonicTime, AnimationEventsVect
or* events) |
| 105 { | 105 { |
| 106 if (!hasActiveObserver()) |
| 107 return; |
| 108 |
| 106 startAnimationsWaitingForNextTick(monotonicTime, events); | 109 startAnimationsWaitingForNextTick(monotonicTime, events); |
| 107 startAnimationsWaitingForStartTime(monotonicTime, events); | 110 startAnimationsWaitingForStartTime(monotonicTime, events); |
| 108 startAnimationsWaitingForTargetAvailability(monotonicTime, events); | 111 startAnimationsWaitingForTargetAvailability(monotonicTime, events); |
| 109 resolveConflicts(monotonicTime); | 112 resolveConflicts(monotonicTime); |
| 110 tickAnimations(monotonicTime); | 113 tickAnimations(monotonicTime); |
| 111 markAnimationsForDeletion(monotonicTime, events); | 114 markAnimationsForDeletion(monotonicTime, events); |
| 112 startAnimationsWaitingForTargetAvailability(monotonicTime, events); | 115 startAnimationsWaitingForTargetAvailability(monotonicTime, events); |
| 113 | 116 |
| 114 updateActivation(); | 117 updateActivation(); |
| 115 } | 118 } |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 OnOpacityAnimated(opacity)); | 453 OnOpacityAnimated(opacity)); |
| 451 } | 454 } |
| 452 | 455 |
| 453 void LayerAnimationController::notifyObserversTransformAnimated(const gfx::Trans
form& transform) | 456 void LayerAnimationController::notifyObserversTransformAnimated(const gfx::Trans
form& transform) |
| 454 { | 457 { |
| 455 FOR_EACH_OBSERVER(LayerAnimationValueObserver, | 458 FOR_EACH_OBSERVER(LayerAnimationValueObserver, |
| 456 m_observers, | 459 m_observers, |
| 457 OnTransformAnimated(transform)); | 460 OnTransformAnimated(transform)); |
| 458 } | 461 } |
| 459 | 462 |
| 463 bool LayerAnimationController::hasActiveObserver() |
| 464 { |
| 465 if (m_observers.might_have_observers()) { |
| 466 ObserverListBase<LayerAnimationValueObserver>::Iterator it(m_observers); |
| 467 LayerAnimationValueObserver* obs; |
| 468 while ((obs = it.GetNext()) != NULL) |
| 469 if (obs->IsActive()) |
| 470 return true; |
| 471 } |
| 472 return false; |
| 473 } |
| 474 |
| 460 } // namespace cc | 475 } // namespace cc |
| OLD | NEW |