| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ | 5 #ifndef UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ |
| 6 #define UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ | 6 #define UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 // Called once each time the animation element is run before any call to | 197 // Called once each time the animation element is run before any call to |
| 198 // OnProgress. | 198 // OnProgress. |
| 199 virtual void OnStart(LayerAnimationDelegate* delegate) = 0; | 199 virtual void OnStart(LayerAnimationDelegate* delegate) = 0; |
| 200 virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) = 0; | 200 virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) = 0; |
| 201 virtual void OnGetTarget(TargetValue* target) const = 0; | 201 virtual void OnGetTarget(TargetValue* target) const = 0; |
| 202 virtual void OnAbort(LayerAnimationDelegate* delegate) = 0; | 202 virtual void OnAbort(LayerAnimationDelegate* delegate) = 0; |
| 203 | 203 |
| 204 // Actually start the animation, dispatching to another thread if needed. | 204 // Actually start the animation, dispatching to another thread if needed. |
| 205 virtual void RequestEffectiveStart(LayerAnimationDelegate* delegate); | 205 virtual void RequestEffectiveStart(LayerAnimationDelegate* delegate); |
| 206 | 206 |
| 207 virtual bool AreStartAndTargetSame() = 0; |
| 208 |
| 207 LayerAnimationElement(const LayerAnimationElement& element); | 209 LayerAnimationElement(const LayerAnimationElement& element); |
| 208 | 210 |
| 209 private: | 211 private: |
| 210 // For debugging purposes, we sometimes alter the duration we actually use. | 212 // For debugging purposes, we sometimes alter the duration we actually use. |
| 211 // For example, during tests we often set duration = 0, and it is sometimes | 213 // For example, during tests we often set duration = 0, and it is sometimes |
| 212 // useful to slow animations down to see them more clearly. | 214 // useful to slow animations down to see them more clearly. |
| 213 base::TimeDelta GetEffectiveDuration(const base::TimeDelta& delta); | 215 base::TimeDelta GetEffectiveDuration(const base::TimeDelta& delta); |
| 214 | 216 |
| 215 bool first_frame_; | 217 bool first_frame_; |
| 216 const AnimatableProperties properties_; | 218 const AnimatableProperties properties_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 227 double last_progressed_fraction_; | 229 double last_progressed_fraction_; |
| 228 | 230 |
| 229 base::WeakPtrFactory<LayerAnimationElement> weak_ptr_factory_; | 231 base::WeakPtrFactory<LayerAnimationElement> weak_ptr_factory_; |
| 230 | 232 |
| 231 DISALLOW_ASSIGN(LayerAnimationElement); | 233 DISALLOW_ASSIGN(LayerAnimationElement); |
| 232 }; | 234 }; |
| 233 | 235 |
| 234 } // namespace ui | 236 } // namespace ui |
| 235 | 237 |
| 236 #endif // UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ | 238 #endif // UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ |
| OLD | NEW |