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

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

Issue 483633002: Add toFloat*Array() methods and use them in layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: TestExepectations Created 6 years, 4 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
« no previous file with comments | « Source/core/dom/DOMMatrixReadOnly.h ('k') | Source/core/dom/DOMMatrixReadOnly.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMMatrixReadOnly.cpp
diff --git a/Source/core/dom/DOMMatrixReadOnly.cpp b/Source/core/dom/DOMMatrixReadOnly.cpp
index 40de8340d88080c989cec20dd278657950403d6c..13dee54fa792a0130f283825c578da7ec934670c 100644
--- a/Source/core/dom/DOMMatrixReadOnly.cpp
+++ b/Source/core/dom/DOMMatrixReadOnly.cpp
@@ -38,4 +38,28 @@ DOMMatrix* DOMMatrixReadOnly::scaleNonUniform(double sx, double sy, double sz,
return DOMMatrix::create(this)->scaleNonUniformSelf(sx, sy, sz, ox, oy, oz);
}
+PassRefPtr<Float32Array> DOMMatrixReadOnly::toFloat32Array() const
+{
+ float array[] = {
+ m_matrix.m11(), m_matrix.m12(), m_matrix.m13(), m_matrix.m14(),
+ m_matrix.m21(), m_matrix.m22(), m_matrix.m23(), m_matrix.m24(),
+ m_matrix.m31(), m_matrix.m32(), m_matrix.m33(), m_matrix.m34(),
+ m_matrix.m41(), m_matrix.m42(), m_matrix.m43(), m_matrix.m44()
+ };
+
+ return Float32Array::create(array, 16);
+}
+
+PassRefPtr<Float64Array> DOMMatrixReadOnly::toFloat64Array() const
+{
+ double array[] = {
+ m_matrix.m11(), m_matrix.m12(), m_matrix.m13(), m_matrix.m14(),
+ m_matrix.m21(), m_matrix.m22(), m_matrix.m23(), m_matrix.m24(),
+ m_matrix.m31(), m_matrix.m32(), m_matrix.m33(), m_matrix.m34(),
+ m_matrix.m41(), m_matrix.m42(), m_matrix.m43(), m_matrix.m44()
+ };
+
+ return Float64Array::create(array, 16);
+}
+
} // namespace blink
« no previous file with comments | « Source/core/dom/DOMMatrixReadOnly.h ('k') | Source/core/dom/DOMMatrixReadOnly.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698