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

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

Issue 2273663002: Implement toString() funtion in DOMMatrixReadOnly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement toString() funtion in DOMMatrixReadOnly. Created 4 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
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 71d42584226141209d15dabcfcef3a2af1693179..c9421aec5d833d824fd4a440b2d19c59c07c6874 100644
--- a/third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.cpp
+++ b/third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.cpp
@@ -118,4 +118,23 @@ DOMFloat64Array* DOMMatrixReadOnly::toFloat64Array() const
return DOMFloat64Array::create(array, 16);
}
+const String DOMMatrixReadOnly::toString() const
+{
+ std::stringstream stream;
+ if (is2D()) {
+ stream << "matrix("
+ << a() << ", " << b() << ", " << c() << ", "
+ << d() << ", " << e() << ", " << f();
+ } else {
+ stream << "matrix3d("
+ << m11() << ", " << m12() << ", " << m13() << ", " << m14() << ", "
+ << m21() << ", " << m22() << ", " << m23() << ", " << m24() << ", "
+ << m31() << ", " << m32() << ", " << m33() << ", " << m34() << ", "
+ << m41() << ", " << m42() << ", " << m43() << ", " << m44();
+ }
+ stream << ")";
+
+ return String(stream.str().c_str());
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.h ('k') | third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698