Chromium Code Reviews| 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/DOMMatrixReadOnly.h" | 5 #include "core/dom/DOMMatrixReadOnly.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/V8ObjectBuilder.h" | 7 #include "bindings/core/v8/V8ObjectBuilder.h" |
| 8 #include "core/css/CSSIdentifierValue.h" | 8 #include "core/css/CSSIdentifierValue.h" |
| 9 #include "core/css/CSSToLengthConversionData.h" | 9 #include "core/css/CSSToLengthConversionData.h" |
| 10 #include "core/css/CSSValueList.h" | 10 #include "core/css/CSSValueList.h" |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 293 double array[] = { | 293 double array[] = { |
| 294 m_matrix->m11(), m_matrix->m12(), m_matrix->m13(), m_matrix->m14(), | 294 m_matrix->m11(), m_matrix->m12(), m_matrix->m13(), m_matrix->m14(), |
| 295 m_matrix->m21(), m_matrix->m22(), m_matrix->m23(), m_matrix->m24(), | 295 m_matrix->m21(), m_matrix->m22(), m_matrix->m23(), m_matrix->m24(), |
| 296 m_matrix->m31(), m_matrix->m32(), m_matrix->m33(), m_matrix->m34(), | 296 m_matrix->m31(), m_matrix->m32(), m_matrix->m33(), m_matrix->m34(), |
| 297 m_matrix->m41(), m_matrix->m42(), m_matrix->m43(), m_matrix->m44()}; | 297 m_matrix->m41(), m_matrix->m42(), m_matrix->m43(), m_matrix->m44()}; |
| 298 | 298 |
| 299 return DOMFloat64Array::create(array, 16); | 299 return DOMFloat64Array::create(array, 16); |
| 300 } | 300 } |
| 301 | 301 |
| 302 const String DOMMatrixReadOnly::toString() const { | 302 const String DOMMatrixReadOnly::toString() const { |
| 303 std::stringstream stream; | |
| 304 if (is2D()) { | 303 if (is2D()) { |
| 305 stream << "matrix(" << a() << ", " << b() << ", " << c() << ", " << d() | 304 return String::format("matrix(%f, %f, %f, %f, %f, %f)", a(), b(), c(), d(), |
|
foolip
2017/03/21 08:47:30
Is this a drive-by change, or does it affect the o
Byoungkwon Ko
2017/04/26 01:31:35
yes, when we were using steam, we should fix decim
foolip
2017/04/26 07:29:19
Hmm, this is actually related to https://github.co
| |
| 306 << ", " << e() << ", " << f(); | 305 e(), f()); |
| 307 } else { | 306 } else { |
| 308 stream << "matrix3d(" << m11() << ", " << m12() << ", " << m13() << ", " | 307 return String::format( |
| 309 << m14() << ", " << m21() << ", " << m22() << ", " << m23() << ", " | 308 "matrix3d(%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, " |
| 310 << m24() << ", " << m31() << ", " << m32() << ", " << m33() << ", " | 309 "%f)", |
| 311 << m34() << ", " << m41() << ", " << m42() << ", " << m43() << ", " | 310 m11(), m12(), m13(), m14(), m21(), m22(), m23(), m24(), m31(), m32(), |
| 312 << m44(); | 311 m33(), m34(), m41(), m42(), m43(), m44()); |
| 313 } | 312 } |
| 314 stream << ")"; | |
| 315 | |
| 316 return String(stream.str().c_str()); | |
| 317 } | 313 } |
| 318 | 314 |
| 319 ScriptValue DOMMatrixReadOnly::toJSONForBinding( | 315 ScriptValue DOMMatrixReadOnly::toJSONForBinding( |
| 320 ScriptState* scriptState) const { | 316 ScriptState* scriptState) const { |
| 321 V8ObjectBuilder result(scriptState); | 317 V8ObjectBuilder result(scriptState); |
| 322 result.addNumber("a", a()); | 318 result.addNumber("a", a()); |
| 323 result.addNumber("b", b()); | 319 result.addNumber("b", b()); |
| 324 result.addNumber("c", c()); | 320 result.addNumber("c", c()); |
| 325 result.addNumber("d", d()); | 321 result.addNumber("d", d()); |
| 326 result.addNumber("e", e()); | 322 result.addNumber("e", e()); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 389 | 385 |
| 390 m_matrix->makeIdentity(); | 386 m_matrix->makeIdentity(); |
| 391 operations.apply(FloatSize(0, 0), *m_matrix); | 387 operations.apply(FloatSize(0, 0), *m_matrix); |
| 392 | 388 |
| 393 m_is2D = !operations.has3DOperation(); | 389 m_is2D = !operations.has3DOperation(); |
| 394 | 390 |
| 395 return; | 391 return; |
| 396 } | 392 } |
| 397 | 393 |
| 398 } // namespace blink | 394 } // namespace blink |
| OLD | NEW |