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 DOMMatrix* DOMMatrix::create() | 9 DOMMatrix* DOMMatrix::create() |
10 { | 10 { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 m_matrix->skewX(sx); | 111 m_matrix->skewX(sx); |
112 return this; | 112 return this; |
113 } | 113 } |
114 | 114 |
115 DOMMatrix* DOMMatrix::skewYSelf(double sy) | 115 DOMMatrix* DOMMatrix::skewYSelf(double sy) |
116 { | 116 { |
117 m_matrix->skewY(sy); | 117 m_matrix->skewY(sy); |
118 return this; | 118 return this; |
119 } | 119 } |
120 | 120 |
| 121 DOMMatrix* DOMMatrix::invertSelf() |
| 122 { |
| 123 if (m_matrix->isInvertible()) { |
| 124 m_matrix = TransformationMatrix::create(m_matrix->inverse()); |
| 125 } else { |
| 126 setM11(NAN); |
| 127 setM12(NAN); |
| 128 setM13(NAN); |
| 129 setM14(NAN); |
| 130 setM21(NAN); |
| 131 setM22(NAN); |
| 132 setM23(NAN); |
| 133 setM24(NAN); |
| 134 setM31(NAN); |
| 135 setM32(NAN); |
| 136 setM33(NAN); |
| 137 setM34(NAN); |
| 138 setM41(NAN); |
| 139 setM42(NAN); |
| 140 setM43(NAN); |
| 141 setM44(NAN); |
| 142 setIs2D(false); |
| 143 } |
| 144 return this; |
| 145 } |
| 146 |
121 } // namespace blink | 147 } // namespace blink |
OLD | NEW |