| 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 #ifndef CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ | 5 #ifndef CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ |
| 6 #define CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ | 6 #define CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <unordered_set> | 8 #include <unordered_set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 enum class ObserverType { ACTIVE, PENDING }; | 40 enum class ObserverType { ACTIVE, PENDING }; |
| 41 | 41 |
| 42 static scoped_refptr<LayerAnimationController> Create(int id); | 42 static scoped_refptr<LayerAnimationController> Create(int id); |
| 43 | 43 |
| 44 int id() const { return id_; } | 44 int id() const { return id_; } |
| 45 | 45 |
| 46 void AddAnimation(scoped_ptr<Animation> animation); | 46 void AddAnimation(scoped_ptr<Animation> animation); |
| 47 void PauseAnimation(int animation_id, base::TimeDelta time_offset); | 47 void PauseAnimation(int animation_id, base::TimeDelta time_offset); |
| 48 void RemoveAnimation(int animation_id); | 48 void RemoveAnimation(int animation_id); |
| 49 void AbortAnimation(int animation_id); | 49 void AbortAnimation(int animation_id); |
| 50 void AbortAnimations(TargetProperty::Type target_property); | 50 void AbortAnimations(TargetProperty::Type target_property, |
| 51 bool needs_completion = false); |
| 51 | 52 |
| 52 // Ensures that the list of active animations on the main thread and the impl | 53 // Ensures that the list of active animations on the main thread and the impl |
| 53 // thread are kept in sync. This function does not take ownership of the impl | 54 // thread are kept in sync. This function does not take ownership of the impl |
| 54 // thread controller. This method is virtual for testing. | 55 // thread controller. This method is virtual for testing. |
| 55 virtual void PushAnimationUpdatesTo( | 56 virtual void PushAnimationUpdatesTo( |
| 56 LayerAnimationController* controller_impl); | 57 LayerAnimationController* controller_impl); |
| 57 | 58 |
| 58 void Animate(base::TimeTicks monotonic_time); | 59 void Animate(base::TimeTicks monotonic_time); |
| 59 void AccumulatePropertyUpdates(base::TimeTicks monotonic_time, | 60 void AccumulatePropertyUpdates(base::TimeTicks monotonic_time, |
| 60 AnimationEvents* events); | 61 AnimationEvents* events); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 91 bool IsCurrentlyAnimatingProperty(TargetProperty::Type target_property, | 92 bool IsCurrentlyAnimatingProperty(TargetProperty::Type target_property, |
| 92 ObserverType observer_type) const; | 93 ObserverType observer_type) const; |
| 93 | 94 |
| 94 void SetAnimationRegistrar(AnimationRegistrar* registrar); | 95 void SetAnimationRegistrar(AnimationRegistrar* registrar); |
| 95 AnimationRegistrar* animation_registrar() { return registrar_; } | 96 AnimationRegistrar* animation_registrar() { return registrar_; } |
| 96 | 97 |
| 97 void NotifyAnimationStarted(const AnimationEvent& event); | 98 void NotifyAnimationStarted(const AnimationEvent& event); |
| 98 void NotifyAnimationFinished(const AnimationEvent& event); | 99 void NotifyAnimationFinished(const AnimationEvent& event); |
| 99 void NotifyAnimationAborted(const AnimationEvent& event); | 100 void NotifyAnimationAborted(const AnimationEvent& event); |
| 100 void NotifyAnimationPropertyUpdate(const AnimationEvent& event); | 101 void NotifyAnimationPropertyUpdate(const AnimationEvent& event); |
| 102 void NotifyAnimationTakeover(const AnimationEvent& event); |
| 101 | 103 |
| 102 void AddValueObserver(LayerAnimationValueObserver* observer); | 104 void AddValueObserver(LayerAnimationValueObserver* observer); |
| 103 void RemoveValueObserver(LayerAnimationValueObserver* observer); | 105 void RemoveValueObserver(LayerAnimationValueObserver* observer); |
| 104 | 106 |
| 105 void AddEventObserver(LayerAnimationEventObserver* observer); | 107 void AddEventObserver(LayerAnimationEventObserver* observer); |
| 106 void RemoveEventObserver(LayerAnimationEventObserver* observer); | 108 void RemoveEventObserver(LayerAnimationEventObserver* observer); |
| 107 | 109 |
| 108 void set_value_provider(LayerAnimationValueProvider* provider) { | 110 void set_value_provider(LayerAnimationValueProvider* provider) { |
| 109 value_provider_ = provider; | 111 value_provider_ = provider; |
| 110 } | 112 } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 249 |
| 248 bool potentially_animating_transform_for_active_observers_; | 250 bool potentially_animating_transform_for_active_observers_; |
| 249 bool potentially_animating_transform_for_pending_observers_; | 251 bool potentially_animating_transform_for_pending_observers_; |
| 250 | 252 |
| 251 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController); | 253 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController); |
| 252 }; | 254 }; |
| 253 | 255 |
| 254 } // namespace cc | 256 } // namespace cc |
| 255 | 257 |
| 256 #endif // CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ | 258 #endif // CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ |
| OLD | NEW |