| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |