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 "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // If this is true, even if the animation is running, it will not be tickable | 100 // If this is true, even if the animation is running, it will not be tickable |
101 // until it is given a start time. This is true for animations running on the | 101 // until it is given a start time. This is true for animations running on the |
102 // main thread. | 102 // main thread. |
103 bool needs_synchronized_start_time() const { | 103 bool needs_synchronized_start_time() const { |
104 return needs_synchronized_start_time_; | 104 return needs_synchronized_start_time_; |
105 } | 105 } |
106 void set_needs_synchronized_start_time(bool needs_synchronized_start_time) { | 106 void set_needs_synchronized_start_time(bool needs_synchronized_start_time) { |
107 needs_synchronized_start_time_ = needs_synchronized_start_time; | 107 needs_synchronized_start_time_ = needs_synchronized_start_time; |
108 } | 108 } |
109 | 109 |
| 110 // This is true for animations running on the main thread when the Finished |
| 111 // event sent by the corresponding impl animation has been received. |
| 112 bool received_finished_event() const { |
| 113 return received_finished_event_; |
| 114 } |
| 115 void set_received_finished_event(bool received_finished_event) { |
| 116 received_finished_event_ = received_finished_event; |
| 117 } |
| 118 |
110 // Takes the given absolute time, and using the start time and the number | 119 // Takes the given absolute time, and using the start time and the number |
111 // of iterations, returns the relative time in the current iteration. | 120 // of iterations, returns the relative time in the current iteration. |
112 double TrimTimeToCurrentIteration(double monotonic_time) const; | 121 double TrimTimeToCurrentIteration(double monotonic_time) const; |
113 | 122 |
114 enum InstanceType { | 123 enum InstanceType { |
115 ControllingInstance = 0, | 124 ControllingInstance = 0, |
116 NonControllingInstance | 125 NonControllingInstance |
117 }; | 126 }; |
118 | 127 |
119 scoped_ptr<Animation> Clone(InstanceType instance_type) const; | 128 scoped_ptr<Animation> Clone(InstanceType instance_type) const; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 double start_time_; | 160 double start_time_; |
152 bool alternates_direction_; | 161 bool alternates_direction_; |
153 | 162 |
154 // The time offset effectively pushes the start of the animation back in time. | 163 // The time offset effectively pushes the start of the animation back in time. |
155 // This is used for resuming paused animations -- an animation is added with a | 164 // This is used for resuming paused animations -- an animation is added with a |
156 // non-zero time offset, causing the animation to skip ahead to the desired | 165 // non-zero time offset, causing the animation to skip ahead to the desired |
157 // point in time. | 166 // point in time. |
158 double time_offset_; | 167 double time_offset_; |
159 | 168 |
160 bool needs_synchronized_start_time_; | 169 bool needs_synchronized_start_time_; |
| 170 bool received_finished_event_; |
161 | 171 |
162 // When an animation is suspended, it behaves as if it is paused and it also | 172 // When an animation is suspended, it behaves as if it is paused and it also |
163 // ignores all run state changes until it is resumed. This is used for testing | 173 // ignores all run state changes until it is resumed. This is used for testing |
164 // purposes. | 174 // purposes. |
165 bool suspended_; | 175 bool suspended_; |
166 | 176 |
167 // These are used in TrimTimeToCurrentIteration to account for time | 177 // These are used in TrimTimeToCurrentIteration to account for time |
168 // spent while paused. This is not included in AnimationState since it | 178 // spent while paused. This is not included in AnimationState since it |
169 // there is absolutely no need for clients of this controller to know | 179 // there is absolutely no need for clients of this controller to know |
170 // about these values. | 180 // about these values. |
(...skipping 10 matching lines...) Expand all Loading... |
181 bool is_controlling_instance_; | 191 bool is_controlling_instance_; |
182 | 192 |
183 bool is_impl_only_; | 193 bool is_impl_only_; |
184 | 194 |
185 DISALLOW_COPY_AND_ASSIGN(Animation); | 195 DISALLOW_COPY_AND_ASSIGN(Animation); |
186 }; | 196 }; |
187 | 197 |
188 } // namespace cc | 198 } // namespace cc |
189 | 199 |
190 #endif // CC_ANIMATION_ANIMATION_H_ | 200 #endif // CC_ANIMATION_ANIMATION_H_ |
OLD | NEW |