Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: third_party/WebKit/Source/core/dom/DOMMatrix.cpp

Issue 2283173003: Implement inverse & invertSelf function in DOMMatrix & DOMMatrixReadOnly. (Closed)
Patch Set: fix a global-interface-listing-expected.txt Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMMatrix.h ('k') | third_party/WebKit/Source/core/dom/DOMMatrix.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698