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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "cc/animation/animation_events.h" | 16 #include "cc/animation/animation.h" |
17 #include "cc/animation/layer_animation_event_observer.h" | 17 #include "cc/animation/layer_animation_event_observer.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 |
27 namespace cc { | 27 namespace cc { |
28 | 28 |
29 class Animation; | |
30 class AnimationDelegate; | 29 class AnimationDelegate; |
| 30 class AnimationEvents; |
31 class AnimationRegistrar; | 31 class AnimationRegistrar; |
32 class FilterOperations; | 32 class FilterOperations; |
33 class KeyframeValueList; | 33 class KeyframeValueList; |
34 class LayerAnimationValueObserver; | 34 class LayerAnimationValueObserver; |
35 class LayerAnimationValueProvider; | 35 class LayerAnimationValueProvider; |
36 | 36 |
37 class CC_EXPORT LayerAnimationController | 37 class CC_EXPORT LayerAnimationController |
38 : public base::RefCounted<LayerAnimationController> { | 38 : public base::RefCounted<LayerAnimationController> { |
39 public: | 39 public: |
40 enum class ObserverType { ACTIVE, PENDING }; | 40 enum class ObserverType { ACTIVE, PENDING }; |
(...skipping 11 matching lines...) Expand all Loading... |
52 void AbortAnimations(Animation::TargetProperty target_property); | 52 void AbortAnimations(Animation::TargetProperty target_property); |
53 | 53 |
54 // Ensures that the list of active animations on the main thread and the impl | 54 // Ensures that the list of active animations on the main thread and the impl |
55 // thread are kept in sync. This function does not take ownership of the impl | 55 // thread are kept in sync. This function does not take ownership of the impl |
56 // thread controller. This method is virtual for testing. | 56 // thread controller. This method is virtual for testing. |
57 virtual void PushAnimationUpdatesTo( | 57 virtual void PushAnimationUpdatesTo( |
58 LayerAnimationController* controller_impl); | 58 LayerAnimationController* controller_impl); |
59 | 59 |
60 void Animate(base::TimeTicks monotonic_time); | 60 void Animate(base::TimeTicks monotonic_time); |
61 void AccumulatePropertyUpdates(base::TimeTicks monotonic_time, | 61 void AccumulatePropertyUpdates(base::TimeTicks monotonic_time, |
62 AnimationEventsVector* events); | 62 AnimationEvents* events); |
63 | 63 |
64 void UpdateState(bool start_ready_animations, | 64 void UpdateState(bool start_ready_animations, AnimationEvents* events); |
65 AnimationEventsVector* events); | |
66 | 65 |
67 // Make animations affect active observers if and only if they affect | 66 // Make animations affect active observers if and only if they affect |
68 // pending observers. Any animations that no longer affect any observers | 67 // pending observers. Any animations that no longer affect any observers |
69 // are deleted. | 68 // are deleted. |
70 void ActivateAnimations(); | 69 void ActivateAnimations(); |
71 | 70 |
72 // Returns the active animation animating the given property that is either | 71 // Returns the active animation animating the given property that is either |
73 // running, or is next to run, if such an animation exists. | 72 // running, or is next to run, if such an animation exists. |
74 Animation* GetAnimation(Animation::TargetProperty target_property) const; | 73 Animation* GetAnimation(Animation::TargetProperty target_property) const; |
75 | 74 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 void PushNewAnimationsToImplThread( | 182 void PushNewAnimationsToImplThread( |
184 LayerAnimationController* controller_impl) const; | 183 LayerAnimationController* controller_impl) const; |
185 void MarkAbortedAnimationsForDeletion( | 184 void MarkAbortedAnimationsForDeletion( |
186 LayerAnimationController* controller_impl) const; | 185 LayerAnimationController* controller_impl) const; |
187 void RemoveAnimationsCompletedOnMainThread( | 186 void RemoveAnimationsCompletedOnMainThread( |
188 LayerAnimationController* controller_impl) const; | 187 LayerAnimationController* controller_impl) const; |
189 void PushPropertiesToImplThread(LayerAnimationController* controller_impl); | 188 void PushPropertiesToImplThread(LayerAnimationController* controller_impl); |
190 | 189 |
191 void StartAnimations(base::TimeTicks monotonic_time); | 190 void StartAnimations(base::TimeTicks monotonic_time); |
192 void PromoteStartedAnimations(base::TimeTicks monotonic_time, | 191 void PromoteStartedAnimations(base::TimeTicks monotonic_time, |
193 AnimationEventsVector* events); | 192 AnimationEvents* events); |
194 void MarkFinishedAnimations(base::TimeTicks monotonic_time); | 193 void MarkFinishedAnimations(base::TimeTicks monotonic_time); |
195 void MarkAnimationsForDeletion(base::TimeTicks monotonic_time, | 194 void MarkAnimationsForDeletion(base::TimeTicks monotonic_time, |
196 AnimationEventsVector* events); | 195 AnimationEvents* events); |
197 void PurgeAnimationsMarkedForDeletion(); | 196 void PurgeAnimationsMarkedForDeletion(); |
198 | 197 |
199 void TickAnimations(base::TimeTicks monotonic_time); | 198 void TickAnimations(base::TimeTicks monotonic_time); |
200 | 199 |
201 enum UpdateActivationType { NORMAL_ACTIVATION, FORCE_ACTIVATION }; | 200 enum UpdateActivationType { NORMAL_ACTIVATION, FORCE_ACTIVATION }; |
202 void UpdateActivation(UpdateActivationType type); | 201 void UpdateActivation(UpdateActivationType type); |
203 | 202 |
204 void NotifyObserversOpacityAnimated(float opacity, | 203 void NotifyObserversOpacityAnimated(float opacity, |
205 bool notify_active_observers, | 204 bool notify_active_observers, |
206 bool notify_pending_observers); | 205 bool notify_pending_observers); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 249 |
251 bool potentially_animating_transform_for_active_observers_; | 250 bool potentially_animating_transform_for_active_observers_; |
252 bool potentially_animating_transform_for_pending_observers_; | 251 bool potentially_animating_transform_for_pending_observers_; |
253 | 252 |
254 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController); | 253 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController); |
255 }; | 254 }; |
256 | 255 |
257 } // namespace cc | 256 } // namespace cc |
258 | 257 |
259 #endif // CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ | 258 #endif // CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ |
OLD | NEW |