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

Unified Diff: third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.cpp

Issue 2423753002: [GeometryInterface] add transformPoint(point) function. (Closed)
Patch Set: [GeometryInterface] add transformPoint(point) method. Created 4 years, 2 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/dom/DOMMatrixReadOnly.cpp
diff --git a/third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.cpp b/third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.cpp
index 7cf081eecea7c77028b720eef25e99c27d7ed05e..300bec43cfeb740d23140f6d2904bbd00ad2369b 100644
--- a/third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.cpp
+++ b/third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.cpp
@@ -4,6 +4,8 @@
#include "core/dom/DOMMatrix.h"
#include "core/dom/DOMMatrixInit.h"
+#include "core/dom/DOMPoint.h"
+#include "core/dom/DOMPointInit.h"
namespace blink {
namespace {
@@ -210,6 +212,18 @@ DOMMatrix* DOMMatrixReadOnly::inverse() {
return DOMMatrix::create(this)->invertSelf();
}
+DOMPoint* DOMMatrixReadOnly::transformPoint(DOMPointInit& point) {
zino 2016/10/17 15:44:44 The spec says that "Even if is2D of the current ma
Hwanseung Lee 2016/10/17 23:47:30 Done.
+ double x = point.x() * m11() + point.y() * m21() + point.z() * m31() +
+ point.w() * m41();
+ double y = point.x() * m12() + point.y() * m22() + point.z() * m32() +
+ point.w() * m42();
+ double z = point.x() * m13() + point.y() * m23() + point.z() * m33() +
+ point.w() * m43();
+ double w = point.x() * m14() + point.y() * m24() + point.z() * m34() +
+ point.w() * m44();
+ return DOMPoint::create(x, y, z, w);
+}
+
DOMFloat32Array* DOMMatrixReadOnly::toFloat32Array() const {
float array[] = {
static_cast<float>(m_matrix->m11()), static_cast<float>(m_matrix->m12()),

Powered by Google App Engine
This is Rietveld 408576698