| 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 <bitset> | 8 #include <bitset> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 void SetAnimationHost(AnimationHost* host); | 95 void SetAnimationHost(AnimationHost* host); |
| 96 AnimationHost* animation_host() { return host_; } | 96 AnimationHost* animation_host() { return host_; } |
| 97 | 97 |
| 98 void NotifyAnimationStarted(const AnimationEvent& event); | 98 void NotifyAnimationStarted(const AnimationEvent& event); |
| 99 void NotifyAnimationFinished(const AnimationEvent& event); | 99 void NotifyAnimationFinished(const AnimationEvent& event); |
| 100 void NotifyAnimationAborted(const AnimationEvent& event); | 100 void NotifyAnimationAborted(const AnimationEvent& event); |
| 101 void NotifyAnimationPropertyUpdate(const AnimationEvent& event); | 101 void NotifyAnimationPropertyUpdate(const AnimationEvent& event); |
| 102 void NotifyAnimationTakeover(const AnimationEvent& event); | 102 void NotifyAnimationTakeover(const AnimationEvent& event); |
| 103 | 103 |
| 104 void AddValueObserver(LayerAnimationValueObserver* observer); | 104 void set_value_observer(LayerAnimationValueObserver* observer) { |
| 105 void RemoveValueObserver(LayerAnimationValueObserver* observer); | 105 value_observer_ = observer; |
| 106 } |
| 107 |
| 108 bool needs_active_value_observations() const { |
| 109 return needs_active_value_observations_; |
| 110 } |
| 111 bool needs_pending_value_observations() const { |
| 112 return needs_pending_value_observations_; |
| 113 } |
| 114 |
| 115 void set_needs_active_value_observations( |
| 116 bool needs_active_value_observations) { |
| 117 needs_active_value_observations_ = needs_active_value_observations; |
| 118 } |
| 119 void set_needs_pending_value_observations( |
| 120 bool needs_pending_value_observations) { |
| 121 needs_pending_value_observations_ = needs_pending_value_observations; |
| 122 } |
| 106 | 123 |
| 107 void AddEventObserver(LayerAnimationEventObserver* observer); | 124 void AddEventObserver(LayerAnimationEventObserver* observer); |
| 108 void RemoveEventObserver(LayerAnimationEventObserver* observer); | 125 void RemoveEventObserver(LayerAnimationEventObserver* observer); |
| 109 | 126 |
| 110 void set_value_provider(LayerAnimationValueProvider* provider) { | 127 void set_value_provider(LayerAnimationValueProvider* provider) { |
| 111 value_provider_ = provider; | 128 value_provider_ = provider; |
| 112 } | 129 } |
| 113 | 130 |
| 114 void remove_value_provider(LayerAnimationValueProvider* provider) { | 131 void remove_value_provider(LayerAnimationValueProvider* provider) { |
| 115 if (value_provider_ == provider) | 132 if (value_provider_ == provider) |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 245 |
| 229 AnimationHost* host_; | 246 AnimationHost* host_; |
| 230 int id_; | 247 int id_; |
| 231 std::vector<std::unique_ptr<Animation>> animations_; | 248 std::vector<std::unique_ptr<Animation>> animations_; |
| 232 | 249 |
| 233 // This is used to ensure that we don't spam the animation host. | 250 // This is used to ensure that we don't spam the animation host. |
| 234 bool is_active_; | 251 bool is_active_; |
| 235 | 252 |
| 236 base::TimeTicks last_tick_time_; | 253 base::TimeTicks last_tick_time_; |
| 237 | 254 |
| 238 base::ObserverList<LayerAnimationValueObserver> value_observers_; | |
| 239 base::ObserverList<LayerAnimationEventObserver> event_observers_; | 255 base::ObserverList<LayerAnimationEventObserver> event_observers_; |
| 256 LayerAnimationValueObserver* value_observer_; |
| 257 LayerAnimationValueProvider* value_provider_; |
| 258 AnimationDelegate* layer_animation_delegate_; |
| 240 | 259 |
| 241 LayerAnimationValueProvider* value_provider_; | 260 bool needs_active_value_observations_; |
| 242 | 261 bool needs_pending_value_observations_; |
| 243 AnimationDelegate* layer_animation_delegate_; | |
| 244 | 262 |
| 245 // Only try to start animations when new animations are added or when the | 263 // Only try to start animations when new animations are added or when the |
| 246 // previous attempt at starting animations failed to start all animations. | 264 // previous attempt at starting animations failed to start all animations. |
| 247 bool needs_to_start_animations_; | 265 bool needs_to_start_animations_; |
| 248 | 266 |
| 249 bool scroll_offset_animation_was_interrupted_; | 267 bool scroll_offset_animation_was_interrupted_; |
| 250 | 268 |
| 251 bool potentially_animating_transform_for_active_observers_; | 269 bool potentially_animating_transform_for_active_observers_; |
| 252 bool potentially_animating_transform_for_pending_observers_; | 270 bool potentially_animating_transform_for_pending_observers_; |
| 253 | 271 |
| 254 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController); | 272 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController); |
| 255 }; | 273 }; |
| 256 | 274 |
| 257 } // namespace cc | 275 } // namespace cc |
| 258 | 276 |
| 259 #endif // CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ | 277 #endif // CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ |
| OLD | NEW |