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_LAYER_ANIMATION_CONTROLLER_H_ | 5 #ifndef CC_LAYER_ANIMATION_CONTROLLER_H_ |
6 #define CC_LAYER_ANIMATION_CONTROLLER_H_ | 6 #define CC_LAYER_ANIMATION_CONTROLLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 // This is called in response to an animation being started on the impl thre
ad. This | 71 // This is called in response to an animation being started on the impl thre
ad. This |
72 // function updates the corresponding main thread animation's start time. | 72 // function updates the corresponding main thread animation's start time. |
73 virtual void OnAnimationStarted(const AnimationEvent&) OVERRIDE; | 73 virtual void OnAnimationStarted(const AnimationEvent&) OVERRIDE; |
74 | 74 |
75 // If a sync is forced, then the next time animation updates are pushed to t
he impl | 75 // If a sync is forced, then the next time animation updates are pushed to t
he impl |
76 // thread, all animations will be transferred. | 76 // thread, all animations will be transferred. |
77 void setForceSync() { m_forceSync = true; } | 77 void setForceSync() { m_forceSync = true; } |
78 | 78 |
79 void setAnimationRegistrar(AnimationRegistrar*); | 79 void setAnimationRegistrar(AnimationRegistrar*); |
| 80 AnimationRegistrar* animationRegistrar() { return m_registrar; } |
80 | 81 |
81 void addObserver(LayerAnimationValueObserver*); | 82 void addObserver(LayerAnimationValueObserver*); |
82 void removeObserver(LayerAnimationValueObserver*); | 83 void removeObserver(LayerAnimationValueObserver*); |
83 | 84 |
| 85 bool hasNonOrphanedObserver(); |
| 86 |
84 protected: | 87 protected: |
85 friend class base::RefCounted<LayerAnimationController>; | 88 friend class base::RefCounted<LayerAnimationController>; |
86 | 89 |
87 LayerAnimationController(int id); | 90 LayerAnimationController(int id); |
88 virtual ~LayerAnimationController(); | 91 virtual ~LayerAnimationController(); |
89 | 92 |
90 private: | 93 private: |
91 typedef base::hash_set<int> TargetProperties; | 94 typedef base::hash_set<int> TargetProperties; |
92 | 95 |
93 void pushNewAnimationsToImplThread(LayerAnimationController*) const; | 96 void pushNewAnimationsToImplThread(LayerAnimationController*) const; |
(...skipping 28 matching lines...) Expand all Loading... |
122 bool m_isActive; | 125 bool m_isActive; |
123 | 126 |
124 ObserverList<LayerAnimationValueObserver> m_observers; | 127 ObserverList<LayerAnimationValueObserver> m_observers; |
125 | 128 |
126 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController); | 129 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController); |
127 }; | 130 }; |
128 | 131 |
129 } // namespace cc | 132 } // namespace cc |
130 | 133 |
131 #endif // CC_LAYER_ANIMATION_CONTROLLER_H_ | 134 #endif // CC_LAYER_ANIMATION_CONTROLLER_H_ |
OLD | NEW |