OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/dom/DOMMatrix.h" | 5 #include "core/dom/DOMMatrix.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 DOMMatrixReadOnly* DOMMatrixReadOnly::create(Vector<double> sequence, ExceptionS
tate& exceptionState) | 9 DOMMatrixReadOnly* DOMMatrixReadOnly::create(Vector<double> sequence, ExceptionS
tate& exceptionState) |
10 { | 10 { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 double array[] = { | 111 double array[] = { |
112 m_matrix->m11(), m_matrix->m12(), m_matrix->m13(), m_matrix->m14(), | 112 m_matrix->m11(), m_matrix->m12(), m_matrix->m13(), m_matrix->m14(), |
113 m_matrix->m21(), m_matrix->m22(), m_matrix->m23(), m_matrix->m24(), | 113 m_matrix->m21(), m_matrix->m22(), m_matrix->m23(), m_matrix->m24(), |
114 m_matrix->m31(), m_matrix->m32(), m_matrix->m33(), m_matrix->m34(), | 114 m_matrix->m31(), m_matrix->m32(), m_matrix->m33(), m_matrix->m34(), |
115 m_matrix->m41(), m_matrix->m42(), m_matrix->m43(), m_matrix->m44() | 115 m_matrix->m41(), m_matrix->m42(), m_matrix->m43(), m_matrix->m44() |
116 }; | 116 }; |
117 | 117 |
118 return DOMFloat64Array::create(array, 16); | 118 return DOMFloat64Array::create(array, 16); |
119 } | 119 } |
120 | 120 |
| 121 const String DOMMatrixReadOnly::toString() const |
| 122 { |
| 123 std::stringstream stream; |
| 124 if (is2D()) { |
| 125 stream << "matrix(" |
| 126 << a() << ", " << b() << ", " << c() << ", " |
| 127 << d() << ", " << e() << ", " << f(); |
| 128 } else { |
| 129 stream << "matrix3d(" |
| 130 << m11() << ", " << m12() << ", " << m13() << ", " << m14() << ", " |
| 131 << m21() << ", " << m22() << ", " << m23() << ", " << m24() << ", " |
| 132 << m31() << ", " << m32() << ", " << m33() << ", " << m34() << ", " |
| 133 << m41() << ", " << m42() << ", " << m43() << ", " << m44(); |
| 134 } |
| 135 stream << ")"; |
| 136 |
| 137 return String(stream.str().c_str()); |
| 138 } |
| 139 |
121 } // namespace blink | 140 } // namespace blink |
OLD | NEW |