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/geometry/DOMMatrixReadOnly.h" | 5 #include "core/geometry/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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 flip_y->setM24(-this->m24()); | 269 flip_y->setM24(-this->m24()); |
270 return flip_y; | 270 return flip_y; |
271 } | 271 } |
272 | 272 |
273 DOMMatrix* DOMMatrixReadOnly::inverse() { | 273 DOMMatrix* DOMMatrixReadOnly::inverse() { |
274 return DOMMatrix::Create(this)->invertSelf(); | 274 return DOMMatrix::Create(this)->invertSelf(); |
275 } | 275 } |
276 | 276 |
277 DOMPoint* DOMMatrixReadOnly::transformPoint(const DOMPointInit& point) { | 277 DOMPoint* DOMMatrixReadOnly::transformPoint(const DOMPointInit& point) { |
278 if (is2D() && point.z() == 0 && point.w() == 1) { | 278 if (is2D() && point.z() == 0 && point.w() == 1) { |
279 double x = point.x() * m11() + point.y() * m12() + m41(); | 279 double x = point.x() * m11() + point.y() * m21() + m41(); |
280 double y = point.x() * m12() + point.y() * m22() + m42(); | 280 double y = point.x() * m12() + point.y() * m22() + m42(); |
281 return DOMPoint::Create(x, y, 0, 1); | 281 return DOMPoint::Create(x, y, 0, 1); |
282 } | 282 } |
283 | 283 |
284 double x = point.x() * m11() + point.y() * m21() + point.z() * m31() + | 284 double x = point.x() * m11() + point.y() * m21() + point.z() * m31() + |
285 point.w() * m41(); | 285 point.w() * m41(); |
286 double y = point.x() * m12() + point.y() * m22() + point.z() * m32() + | 286 double y = point.x() * m12() + point.y() * m22() + point.z() * m32() + |
287 point.w() * m42(); | 287 point.w() * m42(); |
288 double z = point.x() * m13() + point.y() * m23() + point.z() * m33() + | 288 double z = point.x() * m13() + point.y() * m23() + point.z() * m33() + |
289 point.w() * m43(); | 289 point.w() * m43(); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 | 412 |
413 matrix_->MakeIdentity(); | 413 matrix_->MakeIdentity(); |
414 operations.Apply(FloatSize(0, 0), *matrix_); | 414 operations.Apply(FloatSize(0, 0), *matrix_); |
415 | 415 |
416 is2d_ = !operations.Has3DOperation(); | 416 is2d_ = !operations.Has3DOperation(); |
417 | 417 |
418 return; | 418 return; |
419 } | 419 } |
420 | 420 |
421 } // namespace blink | 421 } // namespace blink |
OLD | NEW |