| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/css/cssom/CSSMatrixComponent.h" | 5 #include "core/css/cssom/CSSMatrixComponent.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include "core/css/CSSPrimitiveValue.h" | 9 #include "core/css/CSSPrimitiveValue.h" |
| 10 #include "wtf/MathExtras.h" | 10 #include "platform/wtf/MathExtras.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 CSSFunctionValue* CSSMatrixComponent::ToCSSValue() const { | 14 CSSFunctionValue* CSSMatrixComponent::ToCSSValue() const { |
| 15 CSSFunctionValue* result = | 15 CSSFunctionValue* result = |
| 16 CSSFunctionValue::Create(is2d_ ? CSSValueMatrix : CSSValueMatrix3d); | 16 CSSFunctionValue::Create(is2d_ ? CSSValueMatrix : CSSValueMatrix3d); |
| 17 | 17 |
| 18 if (is2d_) { | 18 if (is2d_) { |
| 19 double values[6] = {a(), b(), c(), d(), e(), f()}; | 19 double values[6] = {a(), b(), c(), d(), e(), f()}; |
| 20 for (double value : values) { | 20 for (double value : values) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 double y, | 92 double y, |
| 93 double z) { | 93 double z) { |
| 94 std::unique_ptr<TransformationMatrix> matrix = TransformationMatrix::Create(); | 94 std::unique_ptr<TransformationMatrix> matrix = TransformationMatrix::Create(); |
| 95 matrix->SetM41(x); | 95 matrix->SetM41(x); |
| 96 matrix->SetM42(y); | 96 matrix->SetM42(y); |
| 97 matrix->SetM43(z); | 97 matrix->SetM43(z); |
| 98 return new CSSMatrixComponent(std::move(matrix), kTranslation3DType); | 98 return new CSSMatrixComponent(std::move(matrix), kTranslation3DType); |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace blink | 101 } // namespace blink |
| OLD | NEW |