OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "config.h" |
| 6 #include "core/dom/DOMMatrix.h" |
| 7 |
| 8 namespace blink { |
| 9 |
| 10 DOMMatrix* DOMMatrix::create() |
| 11 { |
| 12 return new DOMMatrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); |
| 13 } |
| 14 |
| 15 DOMMatrix* DOMMatrix::create(DOMMatrixReadOnly* other) |
| 16 { |
| 17 return new DOMMatrix(other->m11(), other->m12(), other->m13(), other->m14(), |
| 18 other->m21(), other->m22(), other->m23(), other->m24(), |
| 19 other->m31(), other->m32(), other->m33(), other->m34(), |
| 20 other->m41(), other->m42(), other->m43(), other->m44(), |
| 21 other->is2D()); |
| 22 } |
| 23 |
| 24 DOMMatrix::DOMMatrix(double m11, double m12, double m13, double m14, |
| 25 double m21, double m22, double m23, double m24, |
| 26 double m31, double m32, double m33, double m34, |
| 27 double m41, double m42, double m43, double m44, |
| 28 bool is2D) |
| 29 { |
| 30 m_matrix[0][0] = m11; |
| 31 m_matrix[0][1] = m12; |
| 32 m_matrix[0][2] = m13; |
| 33 m_matrix[0][3] = m14; |
| 34 m_matrix[1][0] = m21; |
| 35 m_matrix[1][1] = m22; |
| 36 m_matrix[1][2] = m23; |
| 37 m_matrix[1][3] = m24; |
| 38 m_matrix[2][0] = m31; |
| 39 m_matrix[2][1] = m32; |
| 40 m_matrix[2][2] = m33; |
| 41 m_matrix[2][3] = m34; |
| 42 m_matrix[3][0] = m41; |
| 43 m_matrix[3][1] = m42; |
| 44 m_matrix[3][2] = m43; |
| 45 m_matrix[3][3] = m44; |
| 46 m_is2D = is2D; |
| 47 } |
| 48 |
| 49 void DOMMatrix::setIs2D(bool value) |
| 50 { |
| 51 if (m_is2D) |
| 52 m_is2D = value; |
| 53 } |
| 54 |
| 55 } // namespace blink |
OLD | NEW |