| 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_SEQUENCE_H_ | 5 #ifndef UI_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_ |
| 6 #define UI_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_ | 6 #define UI_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/linked_ptr.h" | 14 #include "base/memory/linked_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "ui/compositor/compositor_export.h" | 18 #include "ui/compositor/compositor_export.h" |
| 19 #include "ui/compositor/layer_animation_element.h" | 19 #include "ui/compositor/layer_animation_element.h" |
| 20 | 20 |
| 21 namespace cc { | |
| 22 struct AnimationEvent; | |
| 23 } | |
| 24 | |
| 25 namespace ui { | 21 namespace ui { |
| 26 | 22 |
| 27 class LayerAnimationDelegate; | 23 class LayerAnimationDelegate; |
| 28 class LayerAnimationObserver; | 24 class LayerAnimationObserver; |
| 29 | 25 |
| 30 // Contains a collection of layer animation elements to be played one after | 26 // Contains a collection of layer animation elements to be played one after |
| 31 // another. Although it has a similar interface to LayerAnimationElement, it is | 27 // another. Although it has a similar interface to LayerAnimationElement, it is |
| 32 // not a LayerAnimationElement (i.e., it is not permitted to have a sequence in | 28 // not a LayerAnimationElement (i.e., it is not permitted to have a sequence in |
| 33 // a sequence). Sequences own their elements, and sequences are themselves owned | 29 // a sequence). Sequences own their elements, and sequences are themselves owned |
| 34 // by a LayerAnimator. | 30 // by a LayerAnimator. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // threaded animation. | 109 // threaded animation. |
| 114 int animation_group_id() const { return animation_group_id_; } | 110 int animation_group_id() const { return animation_group_id_; } |
| 115 void set_animation_group_id(int id) { animation_group_id_ = id; } | 111 void set_animation_group_id(int id) { animation_group_id_ = id; } |
| 116 | 112 |
| 117 // These functions are used for adding or removing observers from the observer | 113 // These functions are used for adding or removing observers from the observer |
| 118 // list. The observers are notified when animations end. | 114 // list. The observers are notified when animations end. |
| 119 void AddObserver(LayerAnimationObserver* observer); | 115 void AddObserver(LayerAnimationObserver* observer); |
| 120 void RemoveObserver(LayerAnimationObserver* observer); | 116 void RemoveObserver(LayerAnimationObserver* observer); |
| 121 | 117 |
| 122 // Called when a threaded animation is actually started. | 118 // Called when a threaded animation is actually started. |
| 123 void OnThreadedAnimationStarted(const cc::AnimationEvent& event); | 119 void OnThreadedAnimationStarted(base::TimeTicks monotonic_time, |
| 120 cc::TargetProperty::Type target_property, |
| 121 int group_id); |
| 124 | 122 |
| 125 // Called when the animator schedules this sequence. | 123 // Called when the animator schedules this sequence. |
| 126 void OnScheduled(); | 124 void OnScheduled(); |
| 127 | 125 |
| 128 // Called when the animator is destroyed. | 126 // Called when the animator is destroyed. |
| 129 void OnAnimatorDestroyed(); | 127 void OnAnimatorDestroyed(); |
| 130 | 128 |
| 131 // The last_progressed_fraction of the element most recently progressed by | 129 // The last_progressed_fraction of the element most recently progressed by |
| 132 // by this sequence. Returns 0.0 if no elements have been progressed. | 130 // by this sequence. Returns 0.0 if no elements have been progressed. |
| 133 double last_progressed_fraction() const { return last_progressed_fraction_; } | 131 double last_progressed_fraction() const { return last_progressed_fraction_; } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 double last_progressed_fraction_; | 191 double last_progressed_fraction_; |
| 194 | 192 |
| 195 base::WeakPtrFactory<LayerAnimationSequence> weak_ptr_factory_; | 193 base::WeakPtrFactory<LayerAnimationSequence> weak_ptr_factory_; |
| 196 | 194 |
| 197 DISALLOW_COPY_AND_ASSIGN(LayerAnimationSequence); | 195 DISALLOW_COPY_AND_ASSIGN(LayerAnimationSequence); |
| 198 }; | 196 }; |
| 199 | 197 |
| 200 } // namespace ui | 198 } // namespace ui |
| 201 | 199 |
| 202 #endif // UI_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_ | 200 #endif // UI_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_ |
| OLD | NEW |