OLD | NEW |
| (Empty) |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CC_ANIMATION_TRANSFORM_OPERATION_H_ | |
6 #define CC_ANIMATION_TRANSFORM_OPERATION_H_ | |
7 | |
8 #include "ui/gfx/transform.h" | |
9 | |
10 namespace gfx { | |
11 class BoxF; | |
12 } | |
13 | |
14 namespace cc { | |
15 | |
16 struct TransformOperation { | |
17 enum Type { | |
18 TRANSFORM_OPERATION_TRANSLATE, | |
19 TRANSFORM_OPERATION_ROTATE, | |
20 TRANSFORM_OPERATION_SCALE, | |
21 TRANSFORM_OPERATION_SKEW, | |
22 TRANSFORM_OPERATION_PERSPECTIVE, | |
23 TRANSFORM_OPERATION_MATRIX, | |
24 TRANSFORM_OPERATION_IDENTITY | |
25 }; | |
26 | |
27 TransformOperation() : type(TRANSFORM_OPERATION_IDENTITY) {} | |
28 | |
29 Type type; | |
30 gfx::Transform matrix; | |
31 | |
32 union { | |
33 SkMScalar perspective_depth; | |
34 | |
35 struct { | |
36 SkMScalar x, y; | |
37 } skew; | |
38 | |
39 struct { | |
40 SkMScalar x, y, z; | |
41 } scale; | |
42 | |
43 struct { | |
44 SkMScalar x, y, z; | |
45 } translate; | |
46 | |
47 struct { | |
48 struct { | |
49 SkMScalar x, y, z; | |
50 } axis; | |
51 | |
52 SkMScalar angle; | |
53 } rotate; | |
54 }; | |
55 | |
56 bool IsIdentity() const; | |
57 static bool BlendTransformOperations(const TransformOperation* from, | |
58 const TransformOperation* to, | |
59 SkMScalar progress, | |
60 gfx::Transform* result); | |
61 | |
62 static bool BlendedBoundsForBox(const gfx::BoxF& box, | |
63 const TransformOperation* from, | |
64 const TransformOperation* to, | |
65 SkMScalar min_progress, | |
66 SkMScalar max_progress, | |
67 gfx::BoxF* bounds); | |
68 }; | |
69 | |
70 } // namespace cc | |
71 | |
72 #endif // CC_ANIMATION_TRANSFORM_OPERATION_H_ | |
OLD | NEW |