| 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> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "cc/animation/animation.h" | 15 #include "cc/animation/animation.h" |
| 16 #include "cc/animation/layer_animation_event_observer.h" | 16 #include "cc/animation/animation_events.h" |
| 17 #include "cc/animation/target_property.h" | 17 #include "cc/animation/target_property.h" |
| 18 #include "cc/base/cc_export.h" | 18 #include "cc/base/cc_export.h" |
| 19 #include "ui/gfx/geometry/scroll_offset.h" | 19 #include "ui/gfx/geometry/scroll_offset.h" |
| 20 #include "ui/gfx/transform.h" | 20 #include "ui/gfx/transform.h" |
| 21 | 21 |
| 22 namespace gfx { | 22 namespace gfx { |
| 23 class BoxF; | 23 class BoxF; |
| 24 class Transform; | 24 class Transform; |
| 25 } | 25 } |
| 26 | 26 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 void set_needs_active_value_observations( | 114 void set_needs_active_value_observations( |
| 115 bool needs_active_value_observations) { | 115 bool needs_active_value_observations) { |
| 116 needs_active_value_observations_ = needs_active_value_observations; | 116 needs_active_value_observations_ = needs_active_value_observations; |
| 117 } | 117 } |
| 118 void set_needs_pending_value_observations( | 118 void set_needs_pending_value_observations( |
| 119 bool needs_pending_value_observations) { | 119 bool needs_pending_value_observations) { |
| 120 needs_pending_value_observations_ = needs_pending_value_observations; | 120 needs_pending_value_observations_ = needs_pending_value_observations; |
| 121 } | 121 } |
| 122 | 122 |
| 123 void SetEventObserver(LayerAnimationEventObserver* observer); | |
| 124 | |
| 125 void set_value_provider(LayerAnimationValueProvider* provider) { | 123 void set_value_provider(LayerAnimationValueProvider* provider) { |
| 126 value_provider_ = provider; | 124 value_provider_ = provider; |
| 127 } | 125 } |
| 128 | 126 |
| 129 void remove_value_provider(LayerAnimationValueProvider* provider) { | 127 void remove_value_provider(LayerAnimationValueProvider* provider) { |
| 130 if (value_provider_ == provider) | 128 if (value_provider_ == provider) |
| 131 value_provider_ = nullptr; | 129 value_provider_ = nullptr; |
| 132 } | 130 } |
| 133 | 131 |
| 134 void set_layer_animation_delegate(AnimationDelegate* delegate) { | 132 void set_layer_animation_delegate(AnimationDelegate* delegate) { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 240 |
| 243 AnimationHost* host_; | 241 AnimationHost* host_; |
| 244 int id_; | 242 int id_; |
| 245 std::vector<std::unique_ptr<Animation>> animations_; | 243 std::vector<std::unique_ptr<Animation>> animations_; |
| 246 | 244 |
| 247 // This is used to ensure that we don't spam the animation host. | 245 // This is used to ensure that we don't spam the animation host. |
| 248 bool is_active_; | 246 bool is_active_; |
| 249 | 247 |
| 250 base::TimeTicks last_tick_time_; | 248 base::TimeTicks last_tick_time_; |
| 251 | 249 |
| 252 LayerAnimationEventObserver* event_observer_; | |
| 253 LayerAnimationValueObserver* value_observer_; | 250 LayerAnimationValueObserver* value_observer_; |
| 254 LayerAnimationValueProvider* value_provider_; | 251 LayerAnimationValueProvider* value_provider_; |
| 255 AnimationDelegate* layer_animation_delegate_; | 252 AnimationDelegate* layer_animation_delegate_; |
| 256 | 253 |
| 257 bool needs_active_value_observations_; | 254 bool needs_active_value_observations_; |
| 258 bool needs_pending_value_observations_; | 255 bool needs_pending_value_observations_; |
| 259 | 256 |
| 260 // Only try to start animations when new animations are added or when the | 257 // Only try to start animations when new animations are added or when the |
| 261 // previous attempt at starting animations failed to start all animations. | 258 // previous attempt at starting animations failed to start all animations. |
| 262 bool needs_to_start_animations_; | 259 bool needs_to_start_animations_; |
| 263 | 260 |
| 264 bool scroll_offset_animation_was_interrupted_; | 261 bool scroll_offset_animation_was_interrupted_; |
| 265 | 262 |
| 266 bool potentially_animating_transform_for_active_observers_; | 263 bool potentially_animating_transform_for_active_observers_; |
| 267 bool potentially_animating_transform_for_pending_observers_; | 264 bool potentially_animating_transform_for_pending_observers_; |
| 268 | 265 |
| 269 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController); | 266 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController); |
| 270 }; | 267 }; |
| 271 | 268 |
| 272 } // namespace cc | 269 } // namespace cc |
| 273 | 270 |
| 274 #endif // CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ | 271 #endif // CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ |
| OLD | NEW |