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 #include "cc/test/animation_test_common.h" | 5 #include "cc/test/animation_test_common.h" |
6 | 6 |
7 #include "cc/animation/animation_id_provider.h" | 7 #include "cc/animation/animation_id_provider.h" |
| 8 #include "cc/animation/animation_player.h" |
8 #include "cc/animation/keyframed_animation_curve.h" | 9 #include "cc/animation/keyframed_animation_curve.h" |
9 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
10 #include "cc/animation/transform_operations.h" | 11 #include "cc/animation/transform_operations.h" |
11 #include "cc/base/time_util.h" | 12 #include "cc/base/time_util.h" |
12 #include "cc/layers/layer.h" | 13 #include "cc/layers/layer.h" |
13 #include "cc/layers/layer_impl.h" | 14 #include "cc/layers/layer_impl.h" |
14 | 15 |
15 using cc::Animation; | 16 using cc::Animation; |
16 using cc::AnimationCurve; | 17 using cc::AnimationCurve; |
17 using cc::EaseTimingFunction; | 18 using cc::EaseTimingFunction; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 return id; | 80 return id; |
80 } | 81 } |
81 | 82 |
82 template <class Target> | 83 template <class Target> |
83 int AddAnimatedTransform(Target* target, | 84 int AddAnimatedTransform(Target* target, |
84 double duration, | 85 double duration, |
85 int delta_x, | 86 int delta_x, |
86 int delta_y) { | 87 int delta_y) { |
87 TransformOperations start_operations; | 88 TransformOperations start_operations; |
88 if (duration > 0.0) { | 89 if (duration > 0.0) { |
89 start_operations.AppendTranslate(delta_x, delta_y, 0.0); | 90 start_operations.AppendTranslate(0, 0, 0.0); |
90 } | 91 } |
91 | 92 |
92 TransformOperations operations; | 93 TransformOperations operations; |
93 operations.AppendTranslate(delta_x, delta_y, 0.0); | 94 operations.AppendTranslate(delta_x, delta_y, 0.0); |
94 return AddAnimatedTransform(target, duration, start_operations, operations); | 95 return AddAnimatedTransform(target, duration, start_operations, operations); |
95 } | 96 } |
96 | 97 |
97 template <class Target> | 98 template <class Target> |
98 int AddAnimatedFilter(Target* target, | 99 int AddAnimatedFilter(Target* target, |
99 double duration, | 100 double duration, |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 int AddAnimatedFilterToLayer(LayerImpl* layer, | 352 int AddAnimatedFilterToLayer(LayerImpl* layer, |
352 double duration, | 353 double duration, |
353 float start_brightness, | 354 float start_brightness, |
354 float end_brightness) { | 355 float end_brightness) { |
355 return AddAnimatedFilter(layer->layer_animation_controller(), | 356 return AddAnimatedFilter(layer->layer_animation_controller(), |
356 duration, | 357 duration, |
357 start_brightness, | 358 start_brightness, |
358 end_brightness); | 359 end_brightness); |
359 } | 360 } |
360 | 361 |
| 362 int AddAnimatedTransformToPlayer(AnimationPlayer* player, |
| 363 double duration, |
| 364 int delta_x, |
| 365 int delta_y) { |
| 366 return AddAnimatedTransform(player, duration, delta_x, delta_y); |
| 367 } |
| 368 |
| 369 int AddOpacityTransitionToPlayer(AnimationPlayer* player, |
| 370 double duration, |
| 371 float start_opacity, |
| 372 float end_opacity, |
| 373 bool use_timing_function) { |
| 374 return AddOpacityTransition(player, duration, start_opacity, end_opacity, |
| 375 use_timing_function); |
| 376 } |
| 377 |
| 378 int AddAnimatedFilterToPlayer(AnimationPlayer* player, |
| 379 double duration, |
| 380 float start_brightness, |
| 381 float end_brightness) { |
| 382 return AddAnimatedFilter(player, duration, start_brightness, end_brightness); |
| 383 } |
| 384 |
361 } // namespace cc | 385 } // namespace cc |
OLD | NEW |