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 ScaleTransformComponent_h | 5 #ifndef ScaleTransformComponent_h |
6 #define ScaleTransformComponent_h | 6 #define ScaleTransformComponent_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 18 matching lines...) Expand all Loading... |
29 double z() const { return m_z; } | 29 double z() const { return m_z; } |
30 | 30 |
31 TransformComponentType type() const override { return m_is2D ? ScaleType : S
cale3DType; } | 31 TransformComponentType type() const override { return m_is2D ? ScaleType : S
cale3DType; } |
32 | 32 |
33 MatrixTransformComponent* asMatrix() const override | 33 MatrixTransformComponent* asMatrix() const override |
34 { | 34 { |
35 return m_is2D ? MatrixTransformComponent::scale(m_x, m_y) | 35 return m_is2D ? MatrixTransformComponent::scale(m_x, m_y) |
36 : MatrixTransformComponent::scale3d(m_x, m_y, m_z); | 36 : MatrixTransformComponent::scale3d(m_x, m_y, m_z); |
37 } | 37 } |
38 | 38 |
39 RawPtr<CSSFunctionValue> toCSSValue() const override; | 39 CSSFunctionValue* toCSSValue() const override; |
40 | 40 |
41 private: | 41 private: |
42 ScaleTransformComponent(double x, double y) : m_x(x), m_y(y), m_z(1), m_is2D
(true) { } | 42 ScaleTransformComponent(double x, double y) : m_x(x), m_y(y), m_z(1), m_is2D
(true) { } |
43 ScaleTransformComponent(double x, double y, double z) : m_x(x), m_y(y), m_z(
z), m_is2D(false) { } | 43 ScaleTransformComponent(double x, double y, double z) : m_x(x), m_y(y), m_z(
z), m_is2D(false) { } |
44 | 44 |
45 double m_x; | 45 double m_x; |
46 double m_y; | 46 double m_y; |
47 double m_z; | 47 double m_z; |
48 bool m_is2D; | 48 bool m_is2D; |
49 }; | 49 }; |
50 | 50 |
51 } // namespace blink | 51 } // namespace blink |
52 | 52 |
53 #endif | 53 #endif |
OLD | NEW |