| 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(ExceptionState& exceptionState) { | 9 DOMMatrix* DOMMatrix::create(ExceptionState& exceptionState) { |
| 10 return new DOMMatrix(TransformationMatrix()); | 10 return new DOMMatrix(TransformationMatrix()); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 return nullptr; | 119 return nullptr; |
| 120 } | 120 } |
| 121 if (!otherMatrix->is2D()) | 121 if (!otherMatrix->is2D()) |
| 122 m_is2D = false; | 122 m_is2D = false; |
| 123 | 123 |
| 124 *m_matrix *= otherMatrix->matrix(); | 124 *m_matrix *= otherMatrix->matrix(); |
| 125 | 125 |
| 126 return this; | 126 return this; |
| 127 } | 127 } |
| 128 | 128 |
| 129 DOMMatrix* DOMMatrix::multiplySelf(DOMMatrixReadOnly* other, |
| 130 ExceptionState& exceptionState) { |
| 131 if (!other->is2D()) |
| 132 m_is2D = false; |
| 133 |
| 134 *m_matrix *= other->matrix(); |
| 135 |
| 136 return this; |
| 137 } |
| 138 |
| 129 DOMMatrix* DOMMatrix::preMultiplySelf(DOMMatrixInit& other, | 139 DOMMatrix* DOMMatrix::preMultiplySelf(DOMMatrixInit& other, |
| 130 ExceptionState& exceptionState) { | 140 ExceptionState& exceptionState) { |
| 131 DOMMatrix* otherMatrix = DOMMatrix::fromMatrix(other, exceptionState); | 141 DOMMatrix* otherMatrix = DOMMatrix::fromMatrix(other, exceptionState); |
| 132 if (!otherMatrix) { | 142 if (!otherMatrix) { |
| 133 DCHECK(exceptionState.hadException()); | 143 DCHECK(exceptionState.hadException()); |
| 134 return nullptr; | 144 return nullptr; |
| 135 } | 145 } |
| 136 if (!otherMatrix->is2D()) | 146 if (!otherMatrix->is2D()) |
| 137 m_is2D = false; | 147 m_is2D = false; |
| 138 | 148 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 return this; | 268 return this; |
| 259 } | 269 } |
| 260 | 270 |
| 261 DOMMatrix* DOMMatrix::setMatrixValue(const String& inputString, | 271 DOMMatrix* DOMMatrix::setMatrixValue(const String& inputString, |
| 262 ExceptionState& exceptionState) { | 272 ExceptionState& exceptionState) { |
| 263 setMatrixValueFromString(inputString, exceptionState); | 273 setMatrixValueFromString(inputString, exceptionState); |
| 264 return this; | 274 return this; |
| 265 } | 275 } |
| 266 | 276 |
| 267 } // namespace blink | 277 } // namespace blink |
| OLD | NEW |