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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 double start_time() const { return start_time_; } | 73 double start_time() const { return start_time_; } |
74 void set_start_time(double monotonic_time) { start_time_ = monotonic_time; } | 74 void set_start_time(double monotonic_time) { start_time_ = monotonic_time; } |
75 bool has_set_start_time() const { return !!start_time_; } | 75 bool has_set_start_time() const { return !!start_time_; } |
76 | 76 |
77 double time_offset() const { return time_offset_; } | 77 double time_offset() const { return time_offset_; } |
78 void set_time_offset(double monotonic_time) { time_offset_ = monotonic_time; } | 78 void set_time_offset(double monotonic_time) { time_offset_ = monotonic_time; } |
79 | 79 |
80 void Suspend(double monotonic_time); | 80 void Suspend(double monotonic_time); |
81 void Resume(double monotonic_time); | 81 void Resume(double monotonic_time); |
82 | 82 |
83 // If alternatesDirection is true, on odd numbered iterations we reverse the | 83 // If alternates_direction is true, on odd numbered iterations we reverse the |
84 // curve. | 84 // curve. |
85 bool alternates_direction() const { return alternates_direction_; } | 85 bool alternates_direction() const { return alternates_direction_; } |
86 void set_alternates_direction(bool alternates) { | 86 void set_alternates_direction(bool alternates) { |
87 alternates_direction_ = alternates; | 87 alternates_direction_ = alternates; |
88 } | 88 } |
89 | 89 |
90 bool IsFinishedAt(double monotonic_time) const; | 90 bool IsFinishedAt(double monotonic_time) const; |
91 bool is_finished() const { | 91 bool is_finished() const { |
92 return run_state_ == Finished || | 92 return run_state_ == Finished || |
93 run_state_ == Aborted || | 93 run_state_ == Aborted || |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // point in time. | 157 // point in time. |
158 double time_offset_; | 158 double time_offset_; |
159 | 159 |
160 bool needs_synchronized_start_time_; | 160 bool needs_synchronized_start_time_; |
161 | 161 |
162 // When an animation is suspended, it behaves as if it is paused and it also | 162 // 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 | 163 // ignores all run state changes until it is resumed. This is used for testing |
164 // purposes. | 164 // purposes. |
165 bool suspended_; | 165 bool suspended_; |
166 | 166 |
167 // These are used in trimTimeToCurrentIteration to account for time | 167 // These are used in TrimTimeToCurrentIteration to account for time |
168 // spent while paused. This is not included in AnimationState since it | 168 // spent while paused. This is not included in AnimationState since it |
169 // there is absolutely no need for clients of this controller to know | 169 // there is absolutely no need for clients of this controller to know |
170 // about these values. | 170 // about these values. |
171 double pause_time_; | 171 double pause_time_; |
172 double total_paused_time_; | 172 double total_paused_time_; |
173 | 173 |
174 // Animations lead dual lives. An active animation will be conceptually owned | 174 // Animations lead dual lives. An active animation will be conceptually owned |
175 // by two controllers, one on the impl thread and one on the main. In reality, | 175 // by two controllers, one on the impl thread and one on the main. In reality, |
176 // there will be two separate Animation instances for the same animation. They | 176 // there will be two separate Animation instances for the same animation. They |
177 // will have the same group id and the same target property (these two values | 177 // will have the same group id and the same target property (these two values |
178 // uniquely identify an animation). The instance on the impl thread is the | 178 // uniquely identify an animation). The instance on the impl thread is the |
179 // instance that ultimately controls the values of the animating layer and so | 179 // instance that ultimately controls the values of the animating layer and so |
180 // we will refer to it as the 'controlling instance'. | 180 // we will refer to it as the 'controlling instance'. |
181 bool is_controlling_instance_; | 181 bool is_controlling_instance_; |
182 | 182 |
183 bool is_impl_only_; | 183 bool is_impl_only_; |
184 | 184 |
185 DISALLOW_COPY_AND_ASSIGN(Animation); | 185 DISALLOW_COPY_AND_ASSIGN(Animation); |
186 }; | 186 }; |
187 | 187 |
188 } // namespace cc | 188 } // namespace cc |
189 | 189 |
190 #endif // CC_ANIMATION_ANIMATION_H_ | 190 #endif // CC_ANIMATION_ANIMATION_H_ |
OLD | NEW |