OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_GFX_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ | 5 #ifndef UI_GFX_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ |
6 #define UI_GFX_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ | 6 #define UI_GFX_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 // Updates the delegate to the appropriate value for |t|, which is in the | 64 // Updates the delegate to the appropriate value for |t|, which is in the |
65 // range [0, 1] (0 for initial, and 1 for final). If the animation is not | 65 // range [0, 1] (0 for initial, and 1 for final). If the animation is not |
66 // aborted, it is guaranteed that Progress will eventually be called with | 66 // aborted, it is guaranteed that Progress will eventually be called with |
67 // t = 1.0. | 67 // t = 1.0. |
68 void Progress(double t, LayerAnimationDelegate* delegate); | 68 void Progress(double t, LayerAnimationDelegate* delegate); |
69 | 69 |
70 // Called if the animation is not allowed to complete. This may be called | 70 // Called if the animation is not allowed to complete. This may be called |
71 // before OnStarted or Progress. | 71 // before OnStarted or Progress. |
72 void Abort(); | 72 void Abort(); |
73 | 73 |
74 // Sets the delegate to the target value. | |
75 void SetTarget(LayerAnimationDelegate* delegate) const; | |
sky
2011/10/20 20:30:30
This is an odd way to extract the target value. Ho
| |
76 | |
74 // The properties that the element modifies. | 77 // The properties that the element modifies. |
75 const AnimatableProperties& properties() const { return properties_; } | 78 const AnimatableProperties& properties() const { return properties_; } |
76 | 79 |
77 // The duration of the animation | 80 // The duration of the animation |
78 base::TimeDelta duration() const { return duration_; } | 81 base::TimeDelta duration() const { return duration_; } |
79 | 82 |
80 protected: | 83 protected: |
81 // Called once each time the animation element is run before any call to | 84 // Called once each time the animation element is run before any call to |
82 // OnProgress. | 85 // OnProgress. |
83 virtual void OnStart(LayerAnimationDelegate* delegate) = 0; | 86 virtual void OnStart(LayerAnimationDelegate* delegate) = 0; |
84 virtual void OnProgress(double t, LayerAnimationDelegate* delegate) = 0; | 87 virtual void OnProgress(double t, LayerAnimationDelegate* delegate) = 0; |
88 virtual void OnSetTarget(LayerAnimationDelegate* delegate) const = 0; | |
85 virtual void OnAbort() = 0; | 89 virtual void OnAbort() = 0; |
86 | 90 |
87 private: | 91 private: |
88 bool first_frame_; | 92 bool first_frame_; |
89 const AnimatableProperties properties_; | 93 const AnimatableProperties properties_; |
90 const base::TimeDelta duration_; | 94 const base::TimeDelta duration_; |
91 | 95 |
92 DISALLOW_COPY_AND_ASSIGN(LayerAnimationElement); | 96 DISALLOW_COPY_AND_ASSIGN(LayerAnimationElement); |
93 }; | 97 }; |
94 | 98 |
95 } // namespace ui | 99 } // namespace ui |
96 | 100 |
97 #endif // UI_GFX_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ | 101 #endif // UI_GFX_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ |
OLD | NEW |