| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 void set_is_controlling_instance_for_test(bool is_controlling_instance) { | 152 void set_is_controlling_instance_for_test(bool is_controlling_instance) { |
| 153 is_controlling_instance_ = is_controlling_instance; | 153 is_controlling_instance_ = is_controlling_instance; |
| 154 } | 154 } |
| 155 bool is_controlling_instance() const { return is_controlling_instance_; } | 155 bool is_controlling_instance() const { return is_controlling_instance_; } |
| 156 | 156 |
| 157 void PushPropertiesTo(Animation* other) const; | 157 void PushPropertiesTo(Animation* other) const; |
| 158 | 158 |
| 159 void set_is_impl_only(bool is_impl_only) { is_impl_only_ = is_impl_only; } | 159 void set_is_impl_only(bool is_impl_only) { is_impl_only_ = is_impl_only; } |
| 160 bool is_impl_only() const { return is_impl_only_; } | 160 bool is_impl_only() const { return is_impl_only_; } |
| 161 | 161 |
| 162 void set_affects_active_observers(bool affects_active_observers) { | 162 void set_affects_active_elements(bool affects_active_elements) { |
| 163 affects_active_observers_ = affects_active_observers; | 163 affects_active_elements_ = affects_active_elements; |
| 164 } | 164 } |
| 165 bool affects_active_observers() const { return affects_active_observers_; } | 165 bool affects_active_elements() const { return affects_active_elements_; } |
| 166 | 166 |
| 167 void set_affects_pending_observers(bool affects_pending_observers) { | 167 void set_affects_pending_elements(bool affects_pending_elements) { |
| 168 affects_pending_observers_ = affects_pending_observers; | 168 affects_pending_elements_ = affects_pending_elements; |
| 169 } | 169 } |
| 170 bool affects_pending_observers() const { return affects_pending_observers_; } | 170 bool affects_pending_elements() const { return affects_pending_elements_; } |
| 171 | 171 |
| 172 private: | 172 private: |
| 173 Animation(std::unique_ptr<AnimationCurve> curve, | 173 Animation(std::unique_ptr<AnimationCurve> curve, |
| 174 int animation_id, | 174 int animation_id, |
| 175 int group_id, | 175 int group_id, |
| 176 TargetProperty::Type target_property); | 176 TargetProperty::Type target_property); |
| 177 | 177 |
| 178 base::TimeDelta ConvertToActiveTime(base::TimeTicks monotonic_time) const; | 178 base::TimeDelta ConvertToActiveTime(base::TimeTicks monotonic_time) const; |
| 179 | 179 |
| 180 std::unique_ptr<AnimationCurve> curve_; | 180 std::unique_ptr<AnimationCurve> curve_; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // there will be two separate Animation instances for the same animation. They | 223 // there will be two separate Animation instances for the same animation. They |
| 224 // will have the same group id and the same target property (these two values | 224 // will have the same group id and the same target property (these two values |
| 225 // uniquely identify an animation). The instance on the impl thread is the | 225 // uniquely identify an animation). The instance on the impl thread is the |
| 226 // instance that ultimately controls the values of the animating layer and so | 226 // instance that ultimately controls the values of the animating layer and so |
| 227 // we will refer to it as the 'controlling instance'. | 227 // we will refer to it as the 'controlling instance'. |
| 228 bool is_controlling_instance_; | 228 bool is_controlling_instance_; |
| 229 | 229 |
| 230 bool is_impl_only_; | 230 bool is_impl_only_; |
| 231 | 231 |
| 232 // When pushed from a main-thread controller to a compositor-thread | 232 // When pushed from a main-thread controller to a compositor-thread |
| 233 // controller, an animation will initially only affect pending observers | 233 // controller, an animation will initially only affect pending elements |
| 234 // (corresponding to layers in the pending tree). Animations that only | 234 // (corresponding to layers in the pending tree). Animations that only |
| 235 // affect pending observers are able to reach the STARTING state and tick | 235 // affect pending elements are able to reach the STARTING state and tick |
| 236 // pending observers, but cannot proceed any further and do not tick active | 236 // pending elements, but cannot proceed any further and do not tick active |
| 237 // observers. After activation, such animations affect both kinds of observers | 237 // elements. After activation, such animations affect both kinds of elements |
| 238 // and are able to proceed past the STARTING state. When the removal of | 238 // and are able to proceed past the STARTING state. When the removal of |
| 239 // an animation is pushed from a main-thread controller to a | 239 // an animation is pushed from a main-thread controller to a |
| 240 // compositor-thread controller, this initially only makes the animation | 240 // compositor-thread controller, this initially only makes the animation |
| 241 // stop affecting pending observers. After activation, such animations no | 241 // stop affecting pending elements. After activation, such animations no |
| 242 // longer affect any observers, and are deleted. | 242 // longer affect any elements, and are deleted. |
| 243 bool affects_active_observers_; | 243 bool affects_active_elements_; |
| 244 bool affects_pending_observers_; | 244 bool affects_pending_elements_; |
| 245 | 245 |
| 246 DISALLOW_COPY_AND_ASSIGN(Animation); | 246 DISALLOW_COPY_AND_ASSIGN(Animation); |
| 247 }; | 247 }; |
| 248 | 248 |
| 249 } // namespace cc | 249 } // namespace cc |
| 250 | 250 |
| 251 #endif // CC_ANIMATION_ANIMATION_H_ | 251 #endif // CC_ANIMATION_ANIMATION_H_ |
| OLD | NEW |