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_GFX_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_ | 5 #ifndef UI_GFX_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_ |
6 #define UI_GFX_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_ | 6 #define UI_GFX_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 | 59 |
60 // Adds an element to the sequence. The sequences takes ownership of this | 60 // Adds an element to the sequence. The sequences takes ownership of this |
61 // element. | 61 // element. |
62 void AddElement(LayerAnimationElement* element); | 62 void AddElement(LayerAnimationElement* element); |
63 | 63 |
64 // Sequences can be looped indefinitely. | 64 // Sequences can be looped indefinitely. |
65 void set_is_cyclic(bool is_cyclic) { is_cyclic_ = is_cyclic; } | 65 void set_is_cyclic(bool is_cyclic) { is_cyclic_ = is_cyclic; } |
66 bool is_cyclic() const { return is_cyclic_; } | 66 bool is_cyclic() const { return is_cyclic_; } |
67 | 67 |
| 68 // Returns true if the sequence is currently animating. |
| 69 bool is_animating() const { return is_animating_; } |
| 70 |
68 // Returns true if this sequence has at least one element affecting a | 71 // Returns true if this sequence has at least one element affecting a |
69 // property in |other|. | 72 // property in |other|. |
70 bool HasCommonProperty( | 73 bool HasCommonProperty( |
71 const LayerAnimationElement::AnimatableProperties& other) const; | 74 const LayerAnimationElement::AnimatableProperties& other) const; |
72 | 75 |
73 // These functions are used for adding or removing observers from the observer | 76 // These functions are used for adding or removing observers from the observer |
74 // list. The observers are notified when animations end. | 77 // list. The observers are notified when animations end. |
75 void AddObserver(LayerAnimationObserver* observer); | 78 void AddObserver(LayerAnimationObserver* observer); |
76 void RemoveObserver(LayerAnimationObserver* observer); | 79 void RemoveObserver(LayerAnimationObserver* observer); |
77 | 80 |
(...skipping 23 matching lines...) Expand all Loading... |
101 | 104 |
102 // The union of all the properties modified by all elements in the sequence. | 105 // The union of all the properties modified by all elements in the sequence. |
103 LayerAnimationElement::AnimatableProperties properties_; | 106 LayerAnimationElement::AnimatableProperties properties_; |
104 | 107 |
105 // The elements in the sequence. | 108 // The elements in the sequence. |
106 Elements elements_; | 109 Elements elements_; |
107 | 110 |
108 // True if the sequence should be looped forever. | 111 // True if the sequence should be looped forever. |
109 bool is_cyclic_; | 112 bool is_cyclic_; |
110 | 113 |
| 114 // True if the sequence is currently animating. |
| 115 bool is_animating_; |
| 116 |
111 // These are used when animating to efficiently find the next element. | 117 // These are used when animating to efficiently find the next element. |
112 size_t last_element_; | 118 size_t last_element_; |
113 base::TimeDelta last_start_; | 119 base::TimeDelta last_start_; |
114 | 120 |
115 // These parties are notified when layer animations end. | 121 // These parties are notified when layer animations end. |
116 ObserverList<LayerAnimationObserver> observers_; | 122 ObserverList<LayerAnimationObserver> observers_; |
117 | 123 |
118 DISALLOW_COPY_AND_ASSIGN(LayerAnimationSequence); | 124 DISALLOW_COPY_AND_ASSIGN(LayerAnimationSequence); |
119 }; | 125 }; |
120 | 126 |
121 } // namespace ui | 127 } // namespace ui |
122 | 128 |
123 #endif // UI_GFX_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_ | 129 #endif // UI_GFX_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_ |
OLD | NEW |