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_ELEMENT_H_ | 5 #ifndef UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ |
6 #define UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ | 6 #define UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 LayerAnimationElement(const AnimatableProperties& properties, | 58 LayerAnimationElement(const AnimatableProperties& properties, |
59 base::TimeDelta duration); | 59 base::TimeDelta duration); |
60 virtual ~LayerAnimationElement(); | 60 virtual ~LayerAnimationElement(); |
61 | 61 |
62 // Creates an element that transitions to the given transform. The caller owns | 62 // Creates an element that transitions to the given transform. The caller owns |
63 // the return value. | 63 // the return value. |
64 static LayerAnimationElement* CreateTransformElement( | 64 static LayerAnimationElement* CreateTransformElement( |
65 const gfx::Transform& transform, | 65 const gfx::Transform& transform, |
66 base::TimeDelta duration); | 66 base::TimeDelta duration); |
67 | 67 |
| 68 // Creates an element that counters a transition to the given transform. This |
| 69 // should be used in tandem with an element created with |
| 70 // CreateTransformElement with the same parameters. The caller owns the return |
| 71 // value. |
| 72 static LayerAnimationElement* CreateInverseTransformElement( |
| 73 const gfx::Transform& parent_start, |
| 74 const gfx::Transform& parent_end, |
| 75 base::TimeDelta duration); |
| 76 |
68 // Creates an element that transitions to another in a way determined by an | 77 // Creates an element that transitions to another in a way determined by an |
69 // interpolated transform. The element accepts ownership of the interpolated | 78 // interpolated transform. The element accepts ownership of the interpolated |
70 // transform. NB: at every step, the interpolated transform clobbers the | 79 // transform. NB: at every step, the interpolated transform clobbers the |
71 // existing transform. That is, it does not interpolate between the existing | 80 // existing transform. That is, it does not interpolate between the existing |
72 // transform and the last value the interpolated transform will assume. It is | 81 // transform and the last value the interpolated transform will assume. It is |
73 // therefore important that the value of the interpolated at time 0 matches | 82 // therefore important that the value of the interpolated at time 0 matches |
74 // the current transform. | 83 // the current transform. |
75 static LayerAnimationElement* CreateInterpolatedTransformElement( | 84 static LayerAnimationElement* CreateInterpolatedTransformElement( |
76 InterpolatedTransform* interpolated_transform, | 85 InterpolatedTransform* interpolated_transform, |
77 base::TimeDelta duration); | 86 base::TimeDelta duration); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 int animation_group_id_; | 223 int animation_group_id_; |
215 | 224 |
216 double last_progressed_fraction_; | 225 double last_progressed_fraction_; |
217 | 226 |
218 DISALLOW_COPY_AND_ASSIGN(LayerAnimationElement); | 227 DISALLOW_COPY_AND_ASSIGN(LayerAnimationElement); |
219 }; | 228 }; |
220 | 229 |
221 } // namespace ui | 230 } // namespace ui |
222 | 231 |
223 #endif // UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ | 232 #endif // UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ |
OLD | NEW |