Index: third_party/WebKit/Source/core/dom/DOMMatrix.cpp |
diff --git a/third_party/WebKit/Source/core/dom/DOMMatrix.cpp b/third_party/WebKit/Source/core/dom/DOMMatrix.cpp |
index a76c25e6d41b6c2feb80e4c458a53bc8b4dcc44a..50b34e0c0aa68efe8027336c7487a0cf8e2eaf49 100644 |
--- a/third_party/WebKit/Source/core/dom/DOMMatrix.cpp |
+++ b/third_party/WebKit/Source/core/dom/DOMMatrix.cpp |
@@ -22,6 +22,32 @@ DOMMatrix* DOMMatrix::create(const SkMatrix44& matrix) |
return new DOMMatrix(transformationMatrix, transformationMatrix.isAffine()); |
} |
+DOMMatrix* DOMMatrix::fromFloat32Array(DOMFloat32Array* float32Array, ExceptionState& exceptionState) |
+{ |
+ if (float32Array->length() != 6 && float32Array->length() != 16) { |
+ exceptionState.throwTypeError("An invalid number sequence is specified. The sequence must contain 6 elements for 2D matrix and 16 elements for 3D matrix."); |
+ return nullptr; |
+ } |
+ return new DOMMatrix(float32Array); |
+} |
+ |
+DOMMatrix* DOMMatrix::fromFloat64Array(DOMFloat64Array* float64Array, ExceptionState& exceptionState) |
+{ |
+ if (float64Array->length() != 6 && float64Array->length() != 16) { |
+ exceptionState.throwTypeError("An invalid number sequence is specified. The sequence must contain 6 elements for 2D matrix and 16 elements for 3D matrix."); |
+ return nullptr; |
+ } |
+ return new DOMMatrix(float64Array); |
+} |
+ |
+DOMMatrix::DOMMatrix(DOMFloat32Array* float32Array) : DOMMatrixReadOnly(float32Array) |
+{ |
+} |
+ |
+DOMMatrix::DOMMatrix(DOMFloat64Array* float64Array) : DOMMatrixReadOnly(float64Array) |
+{ |
+} |
+ |
DOMMatrix::DOMMatrix(const TransformationMatrix& matrix, bool is2D) |
{ |
m_matrix = TransformationMatrix::create(matrix); |