OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_TRANSFORM_OPERATION_H_ | 5 #ifndef CC_TRANSFORM_OPERATION_H_ |
6 #define CC_TRANSFORM_OPERATION_H | 6 #define CC_TRANSFORM_OPERATION_H |
7 | 7 |
8 #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformationMa
trix.h" | 8 #include "ui/gfx/transform.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
11 | 11 |
12 struct TransformOperation { | 12 struct TransformOperation { |
13 enum Type { | 13 enum Type { |
14 TransformOperationTranslate, | 14 TransformOperationTranslate, |
15 TransformOperationRotate, | 15 TransformOperationRotate, |
16 TransformOperationScale, | 16 TransformOperationScale, |
17 TransformOperationSkew, | 17 TransformOperationSkew, |
18 TransformOperationPerspective, | 18 TransformOperationPerspective, |
19 TransformOperationMatrix, | 19 TransformOperationMatrix, |
20 TransformOperationIdentity | 20 TransformOperationIdentity |
21 }; | 21 }; |
22 | 22 |
23 TransformOperation() | 23 TransformOperation() |
24 : type(TransformOperationIdentity) { | 24 : type(TransformOperationIdentity) { |
25 } | 25 } |
26 | 26 |
27 Type type; | 27 Type type; |
28 WebKit::WebTransformationMatrix matrix; | 28 gfx::Transform matrix; |
29 | 29 |
30 union { | 30 union { |
31 double perspective_depth; | 31 double perspective_depth; |
32 | 32 |
33 struct { | 33 struct { |
34 double x, y; | 34 double x, y; |
35 } skew; | 35 } skew; |
36 | 36 |
37 struct { | 37 struct { |
38 double x, y, z; | 38 double x, y, z; |
39 } scale; | 39 } scale; |
40 | 40 |
41 struct { | 41 struct { |
42 double x, y, z; | 42 double x, y, z; |
43 } translate; | 43 } translate; |
44 | 44 |
45 struct { | 45 struct { |
46 struct { | 46 struct { |
47 double x, y, z; | 47 double x, y, z; |
48 } axis; | 48 } axis; |
49 | 49 |
50 double angle; | 50 double angle; |
51 } rotate; | 51 } rotate; |
52 }; | 52 }; |
53 | 53 |
54 bool IsIdentity() const; | 54 bool IsIdentity() const; |
55 static bool BlendTransformOperations(const TransformOperation* from, | 55 static bool BlendTransformOperations(const TransformOperation* from, |
56 const TransformOperation* to, | 56 const TransformOperation* to, |
57 double progress, | 57 double progress, |
58 WebKit::WebTransformationMatrix& result); | 58 gfx::Transform& result); |
59 }; | 59 }; |
60 | 60 |
61 } // namespace cc | 61 } // namespace cc |
62 | 62 |
63 #endif // CC_TRANSFORM_OPERATION_H_ | 63 #endif // CC_TRANSFORM_OPERATION_H_ |
OLD | NEW |