Add ICU message format support
[chromium-blink-merge.git] / cc / animation / transform_operation.h
blob3ea5fc20210a230a1014915a16fdaaf2bf07a8d9
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.
5 #ifndef CC_ANIMATION_TRANSFORM_OPERATION_H_
6 #define CC_ANIMATION_TRANSFORM_OPERATION_H_
8 #include "ui/gfx/transform.h"
10 namespace gfx {
11 class BoxF;
14 namespace cc {
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
27 TransformOperation() : type(TRANSFORM_OPERATION_IDENTITY) {}
29 Type type;
30 gfx::Transform matrix;
32 union {
33 SkMScalar perspective_depth;
35 struct {
36 SkMScalar x, y;
37 } skew;
39 struct {
40 SkMScalar x, y, z;
41 } scale;
43 struct {
44 SkMScalar x, y, z;
45 } translate;
47 struct {
48 struct {
49 SkMScalar x, y, z;
50 } axis;
52 SkMScalar angle;
53 } rotate;
56 bool IsIdentity() const;
57 static bool BlendTransformOperations(const TransformOperation* from,
58 const TransformOperation* to,
59 SkMScalar progress,
60 gfx::Transform* result);
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);
70 } // namespace cc
72 #endif // CC_ANIMATION_TRANSFORM_OPERATION_H_