| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // event sent by the corresponding impl animation has been received. | 135 // event sent by the corresponding impl animation has been received. |
| 136 bool received_finished_event() const { | 136 bool received_finished_event() const { |
| 137 return received_finished_event_; | 137 return received_finished_event_; |
| 138 } | 138 } |
| 139 void set_received_finished_event(bool received_finished_event) { | 139 void set_received_finished_event(bool received_finished_event) { |
| 140 received_finished_event_ = received_finished_event; | 140 received_finished_event_ = received_finished_event; |
| 141 } | 141 } |
| 142 | 142 |
| 143 // Takes the given absolute time, and using the start time and the number | 143 // Takes the given absolute time, and using the start time and the number |
| 144 // of iterations, returns the relative time in the current iteration. | 144 // of iterations, returns the relative time in the current iteration. |
| 145 double TrimTimeToCurrentIteration(base::TimeTicks monotonic_time) const; | 145 base::TimeDelta TrimTimeToCurrentIteration( |
| 146 base::TimeTicks monotonic_time) const; |
| 146 | 147 |
| 147 scoped_ptr<Animation> CloneAndInitialize(RunState initial_run_state) const; | 148 scoped_ptr<Animation> CloneAndInitialize(RunState initial_run_state) const; |
| 148 | 149 |
| 149 bool is_controlling_instance() const { return is_controlling_instance_; } | 150 bool is_controlling_instance() const { return is_controlling_instance_; } |
| 150 | 151 |
| 151 void PushPropertiesTo(Animation* other) const; | 152 void PushPropertiesTo(Animation* other) const; |
| 152 | 153 |
| 153 void set_is_impl_only(bool is_impl_only) { is_impl_only_ = is_impl_only; } | 154 void set_is_impl_only(bool is_impl_only) { is_impl_only_ = is_impl_only; } |
| 154 bool is_impl_only() const { return is_impl_only_; } | 155 bool is_impl_only() const { return is_impl_only_; } |
| 155 | 156 |
| 156 void set_affects_active_observers(bool affects_active_observers) { | 157 void set_affects_active_observers(bool affects_active_observers) { |
| 157 affects_active_observers_ = affects_active_observers; | 158 affects_active_observers_ = affects_active_observers; |
| 158 } | 159 } |
| 159 bool affects_active_observers() const { return affects_active_observers_; } | 160 bool affects_active_observers() const { return affects_active_observers_; } |
| 160 | 161 |
| 161 void set_affects_pending_observers(bool affects_pending_observers) { | 162 void set_affects_pending_observers(bool affects_pending_observers) { |
| 162 affects_pending_observers_ = affects_pending_observers; | 163 affects_pending_observers_ = affects_pending_observers; |
| 163 } | 164 } |
| 164 bool affects_pending_observers() const { return affects_pending_observers_; } | 165 bool affects_pending_observers() const { return affects_pending_observers_; } |
| 165 | 166 |
| 166 private: | 167 private: |
| 167 Animation(scoped_ptr<AnimationCurve> curve, | 168 Animation(scoped_ptr<AnimationCurve> curve, |
| 168 int animation_id, | 169 int animation_id, |
| 169 int group_id, | 170 int group_id, |
| 170 TargetProperty target_property); | 171 TargetProperty target_property); |
| 171 | 172 |
| 172 double ConvertToActiveTime(base::TimeTicks monotonic_time) const; | 173 base::TimeDelta ConvertToActiveTime(base::TimeTicks monotonic_time) const; |
| 173 | 174 |
| 174 scoped_ptr<AnimationCurve> curve_; | 175 scoped_ptr<AnimationCurve> curve_; |
| 175 | 176 |
| 176 // IDs are not necessarily unique. | 177 // IDs are not necessarily unique. |
| 177 int id_; | 178 int id_; |
| 178 | 179 |
| 179 // Animations that must be run together are called 'grouped' and have the same | 180 // Animations that must be run together are called 'grouped' and have the same |
| 180 // group id. Grouped animations are guaranteed to start at the same time and | 181 // group id. Grouped animations are guaranteed to start at the same time and |
| 181 // no other animations may animate any of the group's target properties until | 182 // no other animations may animate any of the group's target properties until |
| 182 // all animations in the group have finished animating. Note: an active | 183 // all animations in the group have finished animating. Note: an active |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 // longer affect any observers, and are deleted. | 238 // longer affect any observers, and are deleted. |
| 238 bool affects_active_observers_; | 239 bool affects_active_observers_; |
| 239 bool affects_pending_observers_; | 240 bool affects_pending_observers_; |
| 240 | 241 |
| 241 DISALLOW_COPY_AND_ASSIGN(Animation); | 242 DISALLOW_COPY_AND_ASSIGN(Animation); |
| 242 }; | 243 }; |
| 243 | 244 |
| 244 } // namespace cc | 245 } // namespace cc |
| 245 | 246 |
| 246 #endif // CC_ANIMATION_ANIMATION_H_ | 247 #endif // CC_ANIMATION_ANIMATION_H_ |
| OLD | NEW |