OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CC_TEST_ANIMATION_TEST_COMMON_H_ | 5 #ifndef CC_TEST_ANIMATION_TEST_COMMON_H_ |
6 #define CC_TEST_ANIMATION_TEST_COMMON_H_ | 6 #define CC_TEST_ANIMATION_TEST_COMMON_H_ |
7 | 7 |
8 #include "cc/animation/animation.h" | 8 #include "cc/animation/animation.h" |
9 #include "cc/animation/animation_curve.h" | 9 #include "cc/animation/animation_curve.h" |
10 #include "cc/animation/animation_timeline.h" | 10 #include "cc/animation/animation_timeline.h" |
11 #include "cc/animation/element_id.h" | 11 #include "cc/animation/element_id.h" |
12 #include "cc/animation/transform_operations.h" | 12 #include "cc/animation/transform_operations.h" |
13 #include "cc/output/filter_operations.h" | 13 #include "cc/output/filter_operations.h" |
14 #include "cc/test/geometry_test_utils.h" | 14 #include "cc/test/geometry_test_utils.h" |
15 | 15 |
16 namespace cc { | 16 namespace cc { |
17 class AnimationPlayer; | 17 class AnimationPlayer; |
18 class ElementAnimations; | |
19 class LayerImpl; | 18 class LayerImpl; |
20 class Layer; | 19 class Layer; |
21 } | 20 } |
22 | 21 |
23 namespace gfx { | 22 namespace gfx { |
24 class ScrollOffset; | 23 class ScrollOffset; |
25 } | 24 } |
26 | 25 |
27 namespace cc { | 26 namespace cc { |
28 | 27 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 float GetValue(base::TimeDelta time) const override; | 70 float GetValue(base::TimeDelta time) const override; |
72 | 71 |
73 std::unique_ptr<AnimationCurve> Clone() const override; | 72 std::unique_ptr<AnimationCurve> Clone() const override; |
74 | 73 |
75 private: | 74 private: |
76 base::TimeDelta duration_; | 75 base::TimeDelta duration_; |
77 float from_; | 76 float from_; |
78 float to_; | 77 float to_; |
79 }; | 78 }; |
80 | 79 |
81 int AddScrollOffsetAnimationToElementAnimations(ElementAnimations* target, | 80 int AddScrollOffsetAnimationToPlayer(AnimationPlayer* player, |
82 gfx::ScrollOffset initial_value, | 81 gfx::ScrollOffset initial_value, |
83 gfx::ScrollOffset target_value, | 82 gfx::ScrollOffset target_value, |
84 bool impl_only); | 83 bool impl_only); |
85 | |
86 int AddOpacityTransitionToElementAnimations(ElementAnimations* target, | |
87 double duration, | |
88 float start_opacity, | |
89 float end_opacity, | |
90 bool use_timing_function); | |
91 | |
92 int AddAnimatedTransformToElementAnimations(ElementAnimations* target, | |
93 double duration, | |
94 int delta_x, | |
95 int delta_y); | |
96 | |
97 int AddAnimatedFilterToElementAnimations(ElementAnimations* target, | |
98 double duration, | |
99 float start_brightness, | |
100 float end_brightness); | |
101 | 84 |
102 int AddAnimatedTransformToPlayer(AnimationPlayer* player, | 85 int AddAnimatedTransformToPlayer(AnimationPlayer* player, |
103 double duration, | 86 double duration, |
104 int delta_x, | 87 int delta_x, |
105 int delta_y); | 88 int delta_y); |
106 | 89 |
107 int AddAnimatedTransformToPlayer(AnimationPlayer* player, | 90 int AddAnimatedTransformToPlayer(AnimationPlayer* player, |
108 double duration, | 91 double duration, |
109 TransformOperations start_operations, | 92 TransformOperations start_operations, |
110 TransformOperations operations); | 93 TransformOperations operations); |
111 | 94 |
112 int AddOpacityTransitionToPlayer(AnimationPlayer* player, | 95 int AddOpacityTransitionToPlayer(AnimationPlayer* player, |
113 double duration, | 96 double duration, |
114 float start_opacity, | 97 float start_opacity, |
115 float end_opacity, | 98 float end_opacity, |
116 bool use_timing_function); | 99 bool use_timing_function); |
117 | 100 |
118 int AddAnimatedFilterToPlayer(AnimationPlayer* player, | 101 int AddAnimatedFilterToPlayer(AnimationPlayer* player, |
119 double duration, | 102 double duration, |
120 float start_brightness, | 103 float start_brightness, |
121 float end_brightness); | 104 float end_brightness); |
122 | 105 |
123 int AddOpacityStepsToElementAnimations(ElementAnimations* target, | 106 int AddOpacityStepsToPlayer(AnimationPlayer* player, |
124 double duration, | 107 double duration, |
125 float start_opacity, | 108 float start_opacity, |
126 float end_opacity, | 109 float end_opacity, |
127 int num_steps); | 110 int num_steps); |
128 | 111 |
129 void AddAnimationToElementWithPlayer(ElementId element_id, | 112 void AddAnimationToElementWithPlayer(ElementId element_id, |
130 scoped_refptr<AnimationTimeline> timeline, | 113 scoped_refptr<AnimationTimeline> timeline, |
131 std::unique_ptr<Animation> animation); | 114 std::unique_ptr<Animation> animation); |
132 void AddAnimationToElementWithExistingPlayer( | 115 void AddAnimationToElementWithExistingPlayer( |
133 ElementId element_id, | 116 ElementId element_id, |
134 scoped_refptr<AnimationTimeline> timeline, | 117 scoped_refptr<AnimationTimeline> timeline, |
135 std::unique_ptr<Animation> animation); | 118 std::unique_ptr<Animation> animation); |
136 | 119 |
137 void RemoveAnimationFromElementWithExistingPlayer( | 120 void RemoveAnimationFromElementWithExistingPlayer( |
(...skipping 28 matching lines...) Expand all Loading... |
166 TransformOperations operations); | 149 TransformOperations operations); |
167 | 150 |
168 int AddOpacityTransitionToElementWithPlayer( | 151 int AddOpacityTransitionToElementWithPlayer( |
169 ElementId element_id, | 152 ElementId element_id, |
170 scoped_refptr<AnimationTimeline> timeline, | 153 scoped_refptr<AnimationTimeline> timeline, |
171 double duration, | 154 double duration, |
172 float start_opacity, | 155 float start_opacity, |
173 float end_opacity, | 156 float end_opacity, |
174 bool use_timing_function); | 157 bool use_timing_function); |
175 | 158 |
176 void AbortAnimationsOnElementWithPlayer( | |
177 ElementId element_id, | |
178 scoped_refptr<AnimationTimeline> timeline, | |
179 TargetProperty::Type target_property); | |
180 | |
181 } // namespace cc | 159 } // namespace cc |
182 | 160 |
183 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ | 161 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ |
OLD | NEW |