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

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

Issue 2907973002: [css-typed-om] add toMatrix() method in CSSTransformValue.idl (Closed)
Patch Set: make Create() function in DOMMatrix Created 3 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/core/geometry/DOMMatrix.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/geometry/DOMMatrix.h" 5 #include "core/geometry/DOMMatrix.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 DOMMatrix* DOMMatrix::Create() {
10 return new DOMMatrix(TransformationMatrix());
11 }
12
9 DOMMatrix* DOMMatrix::Create(ExecutionContext* execution_context, 13 DOMMatrix* DOMMatrix::Create(ExecutionContext* execution_context,
10 ExceptionState& exception_state) { 14 ExceptionState& exception_state) {
11 return new DOMMatrix(TransformationMatrix()); 15 return new DOMMatrix(TransformationMatrix());
12 } 16 }
13 17
14 DOMMatrix* DOMMatrix::Create(ExecutionContext* execution_context, 18 DOMMatrix* DOMMatrix::Create(ExecutionContext* execution_context,
15 StringOrUnrestrictedDoubleSequence& init, 19 StringOrUnrestrictedDoubleSequence& init,
16 ExceptionState& exception_state) { 20 ExceptionState& exception_state) {
17 if (init.isString()) { 21 if (init.isString()) {
18 if (!execution_context->IsDocument()) { 22 if (!execution_context->IsDocument()) {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 matrix_->SetM44(NAN); 136 matrix_->SetM44(NAN);
133 } 137 }
134 138
135 DOMMatrix* DOMMatrix::multiplySelf(DOMMatrixInit& other, 139 DOMMatrix* DOMMatrix::multiplySelf(DOMMatrixInit& other,
136 ExceptionState& exception_state) { 140 ExceptionState& exception_state) {
137 DOMMatrix* other_matrix = DOMMatrix::fromMatrix(other, exception_state); 141 DOMMatrix* other_matrix = DOMMatrix::fromMatrix(other, exception_state);
138 if (!other_matrix) { 142 if (!other_matrix) {
139 DCHECK(exception_state.HadException()); 143 DCHECK(exception_state.HadException());
140 return nullptr; 144 return nullptr;
141 } 145 }
146 return multiplySelf(other_matrix);
147 }
148
149 DOMMatrix* DOMMatrix::multiplySelf(DOMMatrix* other_matrix) {
142 if (!other_matrix->is2D()) 150 if (!other_matrix->is2D())
143 is2d_ = false; 151 is2d_ = false;
144 152
145 *matrix_ *= other_matrix->Matrix(); 153 *matrix_ *= other_matrix->Matrix();
146 154
147 return this; 155 return this;
148 } 156 }
149 157
150 DOMMatrix* DOMMatrix::preMultiplySelf(DOMMatrixInit& other, 158 DOMMatrix* DOMMatrix::preMultiplySelf(DOMMatrixInit& other,
151 ExceptionState& exception_state) { 159 ExceptionState& exception_state) {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 return this; 287 return this;
280 } 288 }
281 289
282 DOMMatrix* DOMMatrix::setMatrixValue(const String& input_string, 290 DOMMatrix* DOMMatrix::setMatrixValue(const String& input_string,
283 ExceptionState& exception_state) { 291 ExceptionState& exception_state) {
284 SetMatrixValueFromString(input_string, exception_state); 292 SetMatrixValueFromString(input_string, exception_state);
285 return this; 293 return this;
286 } 294 }
287 295
288 } // namespace blink 296 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/geometry/DOMMatrix.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698