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_ANIMATION_H_ | 5 #ifndef CC_ANIMATION_ANIMATION_H_ |
6 #define CC_ANIMATION_ANIMATION_H_ | 6 #define CC_ANIMATION_ANIMATION_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 int id() const { return id_; } | 61 int id() const { return id_; } |
62 int group() const { return group_; } | 62 int group() const { return group_; } |
63 TargetProperty target_property() const { return target_property_; } | 63 TargetProperty target_property() const { return target_property_; } |
64 | 64 |
65 RunState run_state() const { return run_state_; } | 65 RunState run_state() const { return run_state_; } |
66 void SetRunState(RunState run_state, base::TimeTicks monotonic_time); | 66 void SetRunState(RunState run_state, base::TimeTicks monotonic_time); |
67 | 67 |
68 // This is the number of times that the animation will play. If this | 68 // This is the number of times that the animation will play. If this |
69 // value is zero the animation will not play. If it is negative, then | 69 // value is zero the animation will not play. If it is negative, then |
70 // the animation will loop indefinitely. | 70 // the animation will loop indefinitely. |
71 int iterations() const { return iterations_; } | 71 double iterations() const { return iterations_; } |
72 void set_iterations(int n) { iterations_ = n; } | 72 void set_iterations(double n) { iterations_ = n; } |
73 | 73 |
74 base::TimeTicks start_time() const { return start_time_; } | 74 base::TimeTicks start_time() const { return start_time_; } |
75 | 75 |
76 void set_start_time(base::TimeTicks monotonic_time) { | 76 void set_start_time(base::TimeTicks monotonic_time) { |
77 start_time_ = monotonic_time; | 77 start_time_ = monotonic_time; |
78 } | 78 } |
79 bool has_set_start_time() const { return !start_time_.is_null(); } | 79 bool has_set_start_time() const { return !start_time_.is_null(); } |
80 | 80 |
81 base::TimeDelta time_offset() const { return time_offset_; } | 81 base::TimeDelta time_offset() const { return time_offset_; } |
82 void set_time_offset(base::TimeDelta monotonic_time) { | 82 void set_time_offset(base::TimeDelta monotonic_time) { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 // Animations that must be run together are called 'grouped' and have the same | 155 // Animations that must be run together are called 'grouped' and have the same |
156 // group id. Grouped animations are guaranteed to start at the same time and | 156 // group id. Grouped animations are guaranteed to start at the same time and |
157 // no other animations may animate any of the group's target properties until | 157 // no other animations may animate any of the group's target properties until |
158 // all animations in the group have finished animating. Note: an active | 158 // all animations in the group have finished animating. Note: an active |
159 // animation's group id and target property uniquely identify that animation. | 159 // animation's group id and target property uniquely identify that animation. |
160 int group_; | 160 int group_; |
161 | 161 |
162 TargetProperty target_property_; | 162 TargetProperty target_property_; |
163 RunState run_state_; | 163 RunState run_state_; |
164 int iterations_; | 164 double iterations_; |
165 base::TimeTicks start_time_; | 165 base::TimeTicks start_time_; |
166 Direction direction_; | 166 Direction direction_; |
167 | 167 |
168 // The time offset effectively pushes the start of the animation back in time. | 168 // The time offset effectively pushes the start of the animation back in time. |
169 // This is used for resuming paused animations -- an animation is added with a | 169 // This is used for resuming paused animations -- an animation is added with a |
170 // non-zero time offset, causing the animation to skip ahead to the desired | 170 // non-zero time offset, causing the animation to skip ahead to the desired |
171 // point in time. | 171 // point in time. |
172 base::TimeDelta time_offset_; | 172 base::TimeDelta time_offset_; |
173 | 173 |
174 bool needs_synchronized_start_time_; | 174 bool needs_synchronized_start_time_; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // longer affect any observers, and are deleted. | 210 // longer affect any observers, and are deleted. |
211 bool affects_active_observers_; | 211 bool affects_active_observers_; |
212 bool affects_pending_observers_; | 212 bool affects_pending_observers_; |
213 | 213 |
214 DISALLOW_COPY_AND_ASSIGN(Animation); | 214 DISALLOW_COPY_AND_ASSIGN(Animation); |
215 }; | 215 }; |
216 | 216 |
217 } // namespace cc | 217 } // namespace cc |
218 | 218 |
219 #endif // CC_ANIMATION_ANIMATION_H_ | 219 #endif // CC_ANIMATION_ANIMATION_H_ |
OLD | NEW |