| 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 CSSRotation_h | 5 #ifndef CSSRotation_h |
| 6 #define CSSRotation_h | 6 #define CSSRotation_h |
| 7 | 7 |
| 8 #include "core/css/cssom/CSSMatrixComponent.h" | |
| 9 #include "core/css/cssom/CSSNumericValue.h" | 8 #include "core/css/cssom/CSSNumericValue.h" |
| 10 #include "core/css/cssom/CSSTransformComponent.h" | 9 #include "core/css/cssom/CSSTransformComponent.h" |
| 11 | 10 |
| 12 namespace blink { | 11 namespace blink { |
| 13 | 12 |
| 13 class DOMMatrix; |
| 14 |
| 14 class CORE_EXPORT CSSRotation final : public CSSTransformComponent { | 15 class CORE_EXPORT CSSRotation final : public CSSTransformComponent { |
| 15 WTF_MAKE_NONCOPYABLE(CSSRotation); | 16 WTF_MAKE_NONCOPYABLE(CSSRotation); |
| 16 DEFINE_WRAPPERTYPEINFO(); | 17 DEFINE_WRAPPERTYPEINFO(); |
| 17 | 18 |
| 18 public: | 19 public: |
| 19 static CSSRotation* Create(const CSSNumericValue* angle_value) { | 20 static CSSRotation* Create(const CSSNumericValue* angle_value) { |
| 20 return new CSSRotation(angle_value); | 21 return new CSSRotation(angle_value); |
| 21 } | 22 } |
| 22 | 23 |
| 23 static CSSRotation* Create(double x, | 24 static CSSRotation* Create(double x, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 35 return const_cast<CSSNumericValue*>(angle_.Get()); | 36 return const_cast<CSSNumericValue*>(angle_.Get()); |
| 36 } | 37 } |
| 37 double x() const { return x_; } | 38 double x() const { return x_; } |
| 38 double y() const { return y_; } | 39 double y() const { return y_; } |
| 39 double z() const { return z_; } | 40 double z() const { return z_; } |
| 40 | 41 |
| 41 TransformComponentType GetType() const override { | 42 TransformComponentType GetType() const override { |
| 42 return is2d_ ? kRotationType : kRotation3DType; | 43 return is2d_ ? kRotationType : kRotation3DType; |
| 43 } | 44 } |
| 44 | 45 |
| 45 CSSMatrixComponent* asMatrix() const override { | 46 DOMMatrix* AsMatrix() const override { |
| 46 return nullptr; | 47 return nullptr; |
| 47 // TODO(meade): Implement. | 48 // TODO(meade): Implement. |
| 48 // return is2d_ | 49 // return is2d_ |
| 49 // ? CSSMatrixComponent::Rotate( | 50 // ? CSSMatrixComponent::Rotate( |
| 50 // angle_->to(CSSPrimitiveValue::UnitType::kDegrees)->value()) | 51 // angle_->to(CSSPrimitiveValue::UnitType::kDegrees)->value()) |
| 51 // : CSSMatrixComponent::Rotate3d( | 52 // : CSSMatrixComponent::Rotate3d( |
| 52 // angle_->to(CSSPrimitiveValue::UnitType::kDegrees)->value(), | 53 // angle_->to(CSSPrimitiveValue::UnitType::kDegrees)->value(), |
| 53 // x_, y_, z_); | 54 // x_, y_, z_); |
| 54 } | 55 } |
| 55 | 56 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 70 Member<const CSSNumericValue> angle_; | 71 Member<const CSSNumericValue> angle_; |
| 71 double x_; | 72 double x_; |
| 72 double y_; | 73 double y_; |
| 73 double z_; | 74 double z_; |
| 74 bool is2d_; | 75 bool is2d_; |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 } // namespace blink | 78 } // namespace blink |
| 78 | 79 |
| 79 #endif | 80 #endif |
| OLD | NEW |