OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_ELEMENT_ANIMATIONS_H_ | 5 #ifndef CC_ANIMATION_ELEMENT_ANIMATIONS_H_ |
6 #define CC_ANIMATION_ELEMENT_ANIMATIONS_H_ | 6 #define CC_ANIMATION_ELEMENT_ANIMATIONS_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/containers/linked_list.h" | 10 #include "base/containers/linked_list.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "cc/animation/animation_curve.h" | 13 #include "cc/animation/animation_curve.h" |
13 #include "cc/animation/animation_delegate.h" | 14 #include "cc/animation/animation_delegate.h" |
14 #include "cc/animation/layer_animation_controller.h" | 15 #include "cc/animation/layer_animation_controller.h" |
15 #include "cc/animation/layer_animation_value_provider.h" | 16 #include "cc/animation/layer_animation_value_provider.h" |
16 #include "cc/base/cc_export.h" | 17 #include "cc/base/cc_export.h" |
17 | 18 |
18 namespace gfx { | 19 namespace gfx { |
19 class ScrollOffset; | 20 class ScrollOffset; |
20 class Transform; | 21 class Transform; |
21 } | 22 } |
22 | 23 |
23 namespace cc { | 24 namespace cc { |
24 | 25 |
25 class AnimationHost; | 26 class AnimationHost; |
26 class AnimationPlayer; | 27 class AnimationPlayer; |
27 class FilterOperations; | 28 class FilterOperations; |
28 class LayerAnimationController; | 29 class LayerAnimationController; |
29 enum class LayerTreeType; | 30 enum class LayerTreeType; |
30 | 31 |
31 // An ElementAnimations owns a list of all AnimationPlayers, attached to | 32 // An ElementAnimations owns a list of all AnimationPlayers, attached to |
32 // the layer. Also, it owns LayerAnimationController instance (1:1 | 33 // the layer. Also, it owns LayerAnimationController instance (1:1 |
33 // relationship) | 34 // relationship) |
34 // ElementAnimations object redirects all events from LAC to the list | 35 // ElementAnimations object redirects all events from LAC to the list |
35 // of animation layers. | 36 // of animation layers. |
36 // This is a CC counterpart for blink::ElementAnimations (in 1:1 relationship). | 37 // This is a CC counterpart for blink::ElementAnimations (in 1:1 relationship). |
37 // No pointer to/from respective blink::ElementAnimations object for now. | 38 // No pointer to/from respective blink::ElementAnimations object for now. |
38 class CC_EXPORT ElementAnimations : public AnimationDelegate, | 39 class CC_EXPORT ElementAnimations : public AnimationDelegate, |
39 public LayerAnimationValueProvider { | 40 public LayerAnimationValueProvider { |
40 public: | 41 public: |
41 static scoped_ptr<ElementAnimations> Create(AnimationHost* host); | 42 static std::unique_ptr<ElementAnimations> Create(AnimationHost* host); |
42 ~ElementAnimations() override; | 43 ~ElementAnimations() override; |
43 | 44 |
44 int layer_id() const { | 45 int layer_id() const { |
45 return layer_animation_controller_ ? layer_animation_controller_->id() : 0; | 46 return layer_animation_controller_ ? layer_animation_controller_->id() : 0; |
46 } | 47 } |
47 | 48 |
48 // Parent AnimationHost. | 49 // Parent AnimationHost. |
49 AnimationHost* animation_host() { return animation_host_; } | 50 AnimationHost* animation_host() { return animation_host_; } |
50 const AnimationHost* animation_host() const { return animation_host_; } | 51 const AnimationHost* animation_host() const { return animation_host_; } |
51 | 52 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 int group) override; | 102 int group) override; |
102 void NotifyAnimationFinished(base::TimeTicks monotonic_time, | 103 void NotifyAnimationFinished(base::TimeTicks monotonic_time, |
103 TargetProperty::Type target_property, | 104 TargetProperty::Type target_property, |
104 int group) override; | 105 int group) override; |
105 void NotifyAnimationAborted(base::TimeTicks monotonic_time, | 106 void NotifyAnimationAborted(base::TimeTicks monotonic_time, |
106 TargetProperty::Type target_property, | 107 TargetProperty::Type target_property, |
107 int group) override; | 108 int group) override; |
108 void NotifyAnimationTakeover(base::TimeTicks monotonic_time, | 109 void NotifyAnimationTakeover(base::TimeTicks monotonic_time, |
109 TargetProperty::Type target_property, | 110 TargetProperty::Type target_property, |
110 double animation_start_time, | 111 double animation_start_time, |
111 scoped_ptr<AnimationCurve> curve) override; | 112 std::unique_ptr<AnimationCurve> curve) override; |
112 | 113 |
113 // LayerAnimationValueProvider implementation. | 114 // LayerAnimationValueProvider implementation. |
114 gfx::ScrollOffset ScrollOffsetForAnimation() const override; | 115 gfx::ScrollOffset ScrollOffsetForAnimation() const override; |
115 | 116 |
116 scoped_ptr<PlayersList> players_list_; | 117 std::unique_ptr<PlayersList> players_list_; |
117 | 118 |
118 class ValueObserver; | 119 class ValueObserver; |
119 scoped_ptr<ValueObserver> active_value_observer_; | 120 std::unique_ptr<ValueObserver> active_value_observer_; |
120 scoped_ptr<ValueObserver> pending_value_observer_; | 121 std::unique_ptr<ValueObserver> pending_value_observer_; |
121 | 122 |
122 // LAC is owned by ElementAnimations (1:1 relationship). | 123 // LAC is owned by ElementAnimations (1:1 relationship). |
123 scoped_refptr<LayerAnimationController> layer_animation_controller_; | 124 scoped_refptr<LayerAnimationController> layer_animation_controller_; |
124 AnimationHost* animation_host_; | 125 AnimationHost* animation_host_; |
125 | 126 |
126 DISALLOW_COPY_AND_ASSIGN(ElementAnimations); | 127 DISALLOW_COPY_AND_ASSIGN(ElementAnimations); |
127 }; | 128 }; |
128 | 129 |
129 } // namespace cc | 130 } // namespace cc |
130 | 131 |
131 #endif // CC_ANIMATION_ELEMENT_ANIMATIONS_H_ | 132 #endif // CC_ANIMATION_ELEMENT_ANIMATIONS_H_ |
OLD | NEW |