OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 RotationTransformComponent_h | 5 #ifndef RotationTransformComponent_h |
6 #define RotationTransformComponent_h | 6 #define RotationTransformComponent_h |
7 | 7 |
8 #include "core/css/cssom/MatrixTransformComponent.h" | 8 #include "core/css/cssom/MatrixTransformComponent.h" |
9 #include "core/css/cssom/TransformComponent.h" | 9 #include "core/css/cssom/TransformComponent.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 double z() const { return m_z; } | 30 double z() const { return m_z; } |
31 | 31 |
32 TransformComponentType type() const override { return m_is2D ? RotationType
: Rotation3DType; } | 32 TransformComponentType type() const override { return m_is2D ? RotationType
: Rotation3DType; } |
33 | 33 |
34 MatrixTransformComponent* asMatrix() const override | 34 MatrixTransformComponent* asMatrix() const override |
35 { | 35 { |
36 return m_is2D ? MatrixTransformComponent::rotate(m_angle) | 36 return m_is2D ? MatrixTransformComponent::rotate(m_angle) |
37 : MatrixTransformComponent::rotate3d(m_angle, m_x, m_y, m_z); | 37 : MatrixTransformComponent::rotate3d(m_angle, m_x, m_y, m_z); |
38 } | 38 } |
39 | 39 |
40 RawPtr<CSSFunctionValue> toCSSValue() const override; | 40 CSSFunctionValue* toCSSValue() const override; |
41 | 41 |
42 private: | 42 private: |
43 RotationTransformComponent(double angle) | 43 RotationTransformComponent(double angle) |
44 : m_angle(angle) | 44 : m_angle(angle) |
45 , m_x(0) | 45 , m_x(0) |
46 , m_y(0) | 46 , m_y(0) |
47 , m_z(1) | 47 , m_z(1) |
48 , m_is2D(true) | 48 , m_is2D(true) |
49 { } | 49 { } |
50 | 50 |
51 RotationTransformComponent(double angle, double x, double y, double z) | 51 RotationTransformComponent(double angle, double x, double y, double z) |
52 : m_angle(angle) | 52 : m_angle(angle) |
53 , m_x(x) | 53 , m_x(x) |
54 , m_y(y) | 54 , m_y(y) |
55 , m_z(z) | 55 , m_z(z) |
56 , m_is2D(false) | 56 , m_is2D(false) |
57 { } | 57 { } |
58 | 58 |
59 double m_angle; | 59 double m_angle; |
60 double m_x; | 60 double m_x; |
61 double m_y; | 61 double m_y; |
62 double m_z; | 62 double m_z; |
63 bool m_is2D; | 63 bool m_is2D; |
64 }; | 64 }; |
65 | 65 |
66 } // namespace blink | 66 } // namespace blink |
67 | 67 |
68 #endif | 68 #endif |
OLD | NEW |