Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: third_party/WebKit/Source/core/css/cssom/MatrixTransformComponent.h

Issue 1648853002: Typed CSS OM: implement TransformComponent::asMatrix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@asMatrixTransformMethod
Patch Set: Use TransformationMatrix::create Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/cssom/MatrixTransformComponent.h
diff --git a/third_party/WebKit/Source/core/css/cssom/MatrixTransformComponent.h b/third_party/WebKit/Source/core/css/cssom/MatrixTransformComponent.h
index 50c2ce618ad341066df4cd2b677b4c2e78d437a0..680c1a30234b02bca184e1d8c0d2becbd5906890 100644
--- a/third_party/WebKit/Source/core/css/cssom/MatrixTransformComponent.h
+++ b/third_party/WebKit/Source/core/css/cssom/MatrixTransformComponent.h
@@ -55,8 +55,24 @@ public:
TransformComponentType type() const override { return m_is2D ? MatrixType : Matrix3DType; }
+ // Bindings require a non const return value.
+ MatrixTransformComponent* asMatrix() const override { return const_cast<MatrixTransformComponent*>(this); }
+
PassRefPtrWillBeRawPtr<CSSFunctionValue> toCSSValue() const override;
+ static MatrixTransformComponent* perspective(double length);
+
+ static MatrixTransformComponent* rotate(double angle);
+ static MatrixTransformComponent* rotate3d(double angle, double x, double y, double z);
+
+ static MatrixTransformComponent* scale(double x, double y);
+ static MatrixTransformComponent* scale3d(double x, double y, double z);
+
+ static MatrixTransformComponent* skew(double x, double y);
+
+ static MatrixTransformComponent* translate(double x, double y);
+ static MatrixTransformComponent* translate3d(double x, double y, double z);
+
private:
MatrixTransformComponent(double a, double b, double c, double d, double e, double f)
: TransformComponent()
@@ -73,6 +89,12 @@ private:
, m_is2D(false)
{ }
+ MatrixTransformComponent(PassOwnPtr<const TransformationMatrix> matrix, TransformComponentType fromType)
+ : TransformComponent()
+ , m_matrix(matrix)
+ , m_is2D(is2DComponentType(fromType))
+ { }
+
// TransformationMatrix needs to be 16-byte aligned. PartitionAlloc
// supports 16-byte alignment but Oilpan doesn't. So we use an OwnPtr
// to allocate TransformationMatrix on PartitionAlloc.

Powered by Google App Engine
This is Rietveld 408576698