| 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/CSSNumericValue.h" | 8 #include "core/css/cssom/CSSNumericValue.h" |
| 9 #include "core/css/cssom/CSSTransformComponent.h" | 9 #include "core/css/cssom/CSSTransformComponent.h" |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 double x() const { return x_; } | 42 double x() const { return x_; } |
| 43 double y() const { return y_; } | 43 double y() const { return y_; } |
| 44 double z() const { return z_; } | 44 double z() const { return z_; } |
| 45 void setAngle(CSSNumericValue* angle, ExceptionState&); | 45 void setAngle(CSSNumericValue* angle, ExceptionState&); |
| 46 void setX(double x) { x_ = x; } | 46 void setX(double x) { x_ = x; } |
| 47 void setY(double y) { y_ = y; } | 47 void setY(double y) { y_ = y; } |
| 48 void setZ(double z) { z_ = z; } | 48 void setZ(double z) { z_ = z; } |
| 49 | 49 |
| 50 // Internal methods - from CSSTransformComponent. | 50 // Internal methods - from CSSTransformComponent. |
| 51 TransformComponentType GetType() const final { return kRotationType; } | 51 TransformComponentType GetType() const final { return kRotationType; } |
| 52 DOMMatrix* AsMatrix() const final { | 52 DOMMatrix* AsMatrix() const final; |
| 53 return nullptr; | |
| 54 // TODO(meade): Implement. | |
| 55 // return z_ == 1 ? | |
| 56 // ? CSSMatrixComponent::Rotate( | |
| 57 // angle_->to(CSSPrimitiveValue::UnitType::kDegrees)->value()) | |
| 58 // : CSSMatrixComponent::Rotate3d( | |
| 59 // angle_->to(CSSPrimitiveValue::UnitType::kDegrees)->value(), | |
| 60 // x_, y_, z_); | |
| 61 } | |
| 62 CSSFunctionValue* ToCSSValue() const final; | 53 CSSFunctionValue* ToCSSValue() const final; |
| 63 | 54 |
| 64 DEFINE_INLINE_VIRTUAL_TRACE() { | 55 DEFINE_INLINE_VIRTUAL_TRACE() { |
| 65 visitor->Trace(angle_); | 56 visitor->Trace(angle_); |
| 66 CSSTransformComponent::Trace(visitor); | 57 CSSTransformComponent::Trace(visitor); |
| 67 } | 58 } |
| 68 | 59 |
| 69 private: | 60 private: |
| 70 CSSRotation(double x, double y, double z, CSSNumericValue* angle, bool is2D) | 61 CSSRotation(double x, double y, double z, CSSNumericValue* angle, bool is2D) |
| 71 : CSSTransformComponent(is2D), angle_(angle), x_(x), y_(y), z_(z) {} | 62 : CSSTransformComponent(is2D), angle_(angle), x_(x), y_(y), z_(z) {} |
| 72 | 63 |
| 73 Member<CSSNumericValue> angle_; | 64 Member<CSSNumericValue> angle_; |
| 74 double x_; | 65 double x_; |
| 75 double y_; | 66 double y_; |
| 76 double z_; | 67 double z_; |
| 77 }; | 68 }; |
| 78 | 69 |
| 79 } // namespace blink | 70 } // namespace blink |
| 80 | 71 |
| 81 #endif | 72 #endif |
| OLD | NEW |