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

Side by Side Diff: third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.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 DOMMatrixReadOnly* DOMMatrixReadOnly::create(Vector<double> sequence, ExceptionS tate& exceptionState) 9 DOMMatrixReadOnly* DOMMatrixReadOnly::create(Vector<double> sequence, ExceptionS tate& exceptionState)
10 { 10 {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 DOMMatrix* DOMMatrixReadOnly::flipY() 97 DOMMatrix* DOMMatrixReadOnly::flipY()
98 { 98 {
99 DOMMatrix* flipY = DOMMatrix::create(this); 99 DOMMatrix* flipY = DOMMatrix::create(this);
100 flipY->setM21(-this->m21()); 100 flipY->setM21(-this->m21());
101 flipY->setM22(-this->m22()); 101 flipY->setM22(-this->m22());
102 flipY->setM23(-this->m23()); 102 flipY->setM23(-this->m23());
103 flipY->setM24(-this->m24()); 103 flipY->setM24(-this->m24());
104 return flipY; 104 return flipY;
105 } 105 }
106 106
107 DOMMatrix* DOMMatrixReadOnly::inverse()
108 {
109 return DOMMatrix::create(this)->invertSelf();
110 }
111
107 DOMFloat32Array* DOMMatrixReadOnly::toFloat32Array() const 112 DOMFloat32Array* DOMMatrixReadOnly::toFloat32Array() const
108 { 113 {
109 float array[] = { 114 float array[] = {
110 static_cast<float>(m_matrix->m11()), static_cast<float>(m_matrix->m12()) , static_cast<float>(m_matrix->m13()), static_cast<float>(m_matrix->m14()), 115 static_cast<float>(m_matrix->m11()), static_cast<float>(m_matrix->m12()) , static_cast<float>(m_matrix->m13()), static_cast<float>(m_matrix->m14()),
111 static_cast<float>(m_matrix->m21()), static_cast<float>(m_matrix->m22()) , static_cast<float>(m_matrix->m23()), static_cast<float>(m_matrix->m24()), 116 static_cast<float>(m_matrix->m21()), static_cast<float>(m_matrix->m22()) , static_cast<float>(m_matrix->m23()), static_cast<float>(m_matrix->m24()),
112 static_cast<float>(m_matrix->m31()), static_cast<float>(m_matrix->m32()) , static_cast<float>(m_matrix->m33()), static_cast<float>(m_matrix->m34()), 117 static_cast<float>(m_matrix->m31()), static_cast<float>(m_matrix->m32()) , static_cast<float>(m_matrix->m33()), static_cast<float>(m_matrix->m34()),
113 static_cast<float>(m_matrix->m41()), static_cast<float>(m_matrix->m42()) , static_cast<float>(m_matrix->m43()), static_cast<float>(m_matrix->m44()) 118 static_cast<float>(m_matrix->m41()), static_cast<float>(m_matrix->m42()) , static_cast<float>(m_matrix->m43()), static_cast<float>(m_matrix->m44())
114 }; 119 };
115 120
116 return DOMFloat32Array::create(array, 16); 121 return DOMFloat32Array::create(array, 16);
(...skipping 24 matching lines...) Expand all
141 << m21() << ", " << m22() << ", " << m23() << ", " << m24() << ", " 146 << m21() << ", " << m22() << ", " << m23() << ", " << m24() << ", "
142 << m31() << ", " << m32() << ", " << m33() << ", " << m34() << ", " 147 << m31() << ", " << m32() << ", " << m33() << ", " << m34() << ", "
143 << m41() << ", " << m42() << ", " << m43() << ", " << m44(); 148 << m41() << ", " << m42() << ", " << m43() << ", " << m44();
144 } 149 }
145 stream << ")"; 150 stream << ")";
146 151
147 return String(stream.str().c_str()); 152 return String(stream.str().c_str());
148 } 153 }
149 154
150 } // namespace blink 155 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.h ('k') | third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698