OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_ELEMENT_ANIMATIONS_H_ | 5 #ifndef CC_ANIMATION_ELEMENT_ANIMATIONS_H_ |
6 #define CC_ANIMATION_ELEMENT_ANIMATIONS_H_ | 6 #define CC_ANIMATION_ELEMENT_ANIMATIONS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 void RemovePlayer(AnimationPlayer* player); | 58 void RemovePlayer(AnimationPlayer* player); |
59 bool IsEmpty() const; | 59 bool IsEmpty() const; |
60 | 60 |
61 typedef base::ObserverList<AnimationPlayer> PlayersList; | 61 typedef base::ObserverList<AnimationPlayer> PlayersList; |
62 const PlayersList& players_list() const { return players_list_; } | 62 const PlayersList& players_list() const { return players_list_; } |
63 | 63 |
64 // Ensures that the list of active animations on the main thread and the impl | 64 // Ensures that the list of active animations on the main thread and the impl |
65 // thread are kept in sync. This function does not take ownership of the impl | 65 // thread are kept in sync. This function does not take ownership of the impl |
66 // thread ElementAnimations. | 66 // thread ElementAnimations. |
67 void PushPropertiesTo( | 67 void PushPropertiesTo( |
68 scoped_refptr<ElementAnimations> element_animations_impl); | 68 scoped_refptr<ElementAnimations> element_animations_impl) const; |
69 | 69 |
70 void Animate(base::TimeTicks monotonic_time); | 70 void Animate(base::TimeTicks monotonic_time); |
71 | 71 |
72 void UpdateState(bool start_ready_animations, AnimationEvents* events); | 72 void UpdateState(bool start_ready_animations, AnimationEvents* events); |
73 | 73 |
74 // Make animations affect active elements if and only if they affect | 74 // Make animations affect active elements if and only if they affect |
75 // pending elements. Any animations that no longer affect any elements | 75 // pending elements. Any animations that no longer affect any elements |
76 // are deleted. | 76 // are deleted. |
77 void ActivateAnimations(); | 77 void ActivateAnimations(); |
78 | 78 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 ElementId element_id_; | 203 ElementId element_id_; |
204 | 204 |
205 // This is used to ensure that we don't spam the animation host. | 205 // This is used to ensure that we don't spam the animation host. |
206 bool is_active_; | 206 bool is_active_; |
207 | 207 |
208 base::TimeTicks last_tick_time_; | 208 base::TimeTicks last_tick_time_; |
209 | 209 |
210 bool has_element_in_active_list_; | 210 bool has_element_in_active_list_; |
211 bool has_element_in_pending_list_; | 211 bool has_element_in_pending_list_; |
212 | 212 |
213 bool scroll_offset_animation_was_interrupted_; | 213 mutable bool scroll_offset_animation_was_interrupted_; |
214 | 214 |
215 bool needs_push_properties_; | 215 mutable bool needs_push_properties_; |
216 | 216 |
217 PropertyAnimationState active_state_; | 217 PropertyAnimationState active_state_; |
218 PropertyAnimationState pending_state_; | 218 PropertyAnimationState pending_state_; |
219 | 219 |
220 bool needs_update_impl_client_state_; | 220 mutable bool needs_update_impl_client_state_; |
221 | 221 |
222 DISALLOW_COPY_AND_ASSIGN(ElementAnimations); | 222 DISALLOW_COPY_AND_ASSIGN(ElementAnimations); |
223 }; | 223 }; |
224 | 224 |
225 } // namespace cc | 225 } // namespace cc |
226 | 226 |
227 #endif // CC_ANIMATION_ELEMENT_ANIMATIONS_H_ | 227 #endif // CC_ANIMATION_ELEMENT_ANIMATIONS_H_ |
OLD | NEW |