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 46922eb1802a1e2124ae8cd5c68c416a4e8de863..ebb39392b44bc19755629c6fb220e6f68fc75027 100644 |
--- a/third_party/WebKit/Source/core/dom/DOMMatrix.cpp |
+++ b/third_party/WebKit/Source/core/dom/DOMMatrix.cpp |
@@ -106,4 +106,47 @@ DOMMatrix* DOMMatrix::scaleNonUniformSelf(double sx, double sy, double sz, |
return this; |
} |
+DOMMatrix* DOMMatrix::rotateSelf(double rotX) |
+{ |
+ return rotateSelf(0, 0, rotX); |
+} |
+ |
+DOMMatrix* DOMMatrix::rotateSelf(double rotX, double rotY) |
+{ |
+ return rotateSelf(rotX, rotY, 0); |
+} |
+ |
+DOMMatrix* DOMMatrix::rotateSelf(double rotX, double rotY, double rotZ) |
+{ |
+ if (rotZ) |
+ m_matrix->rotate3d(0, 0, 1, rotZ); |
+ |
+ if (rotY) { |
+ m_matrix->rotate3d(0, 1, 0, rotY); |
+ m_is2D = false; |
+ } |
+ |
+ if (rotX) { |
+ m_matrix->rotate3d(1, 0, 0, rotX); |
+ m_is2D = false; |
+ } |
+ |
+ return this; |
+} |
+ |
+DOMMatrix* DOMMatrix::rotateFromVectorSelf(double x, double y) |
+{ |
+ m_matrix->rotate(rad2deg(atan2(y, x))); |
+ return this; |
+} |
+ |
+DOMMatrix* DOMMatrix::rotateAxisAngleSelf(double x, double y, double z, double angle) |
+{ |
+ if (x || y) |
+ m_is2D = false; |
+ |
+ m_matrix->rotate3d(x, y, z, angle); |
+ return this; |
+} |
+ |
} // namespace blink |