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

Side by Side Diff: third_party/WebKit/Source/core/css/cssom/CSSMatrixTransformComponent.cpp

Issue 2367663002: [WIP] Attempt to move everything cssom into a cssom namespace (Closed)
Patch Set: 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 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/CSSMatrixTransformComponent.h" 5 #include "core/css/cssom/CSSMatrixTransformComponent.h"
6 6
7 #include "core/css/CSSPrimitiveValue.h" 7 #include "core/css/CSSPrimitiveValue.h"
8 #include "wtf/MathExtras.h" 8 #include "wtf/MathExtras.h"
9 #include <cmath> 9 #include <cmath>
10 #include <memory> 10 #include <memory>
11 11
12 namespace blink { 12 namespace blink {
13 namespace cssom {
13 14
14 CSSFunctionValue* CSSMatrixTransformComponent::toCSSValue() const 15 CSSFunctionValue* CSSMatrixTransformComponent::toCSSValue() const
15 { 16 {
16 CSSFunctionValue* result = CSSFunctionValue::create(m_is2D ? CSSValueMatrix : CSSValueMatrix3d); 17 CSSFunctionValue* result = CSSFunctionValue::create(m_is2D ? CSSValueMatrix : CSSValueMatrix3d);
17 18
18 if (m_is2D) { 19 if (m_is2D) {
19 double values[6] = {a(), b(), c(), d(), e(), f()}; 20 double values[6] = {a(), b(), c(), d(), e(), f()};
20 for (double value : values) { 21 for (double value : values) {
21 result->append(*CSSPrimitiveValue::create(value, CSSPrimitiveValue:: UnitType::Number)); 22 result->append(*CSSPrimitiveValue::create(value, CSSPrimitiveValue:: UnitType::Number));
22 } 23 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 92
92 CSSMatrixTransformComponent* CSSMatrixTransformComponent::translate3d(double x, double y, double z) 93 CSSMatrixTransformComponent* CSSMatrixTransformComponent::translate3d(double x, double y, double z)
93 { 94 {
94 std::unique_ptr<TransformationMatrix> matrix = TransformationMatrix::create( ); 95 std::unique_ptr<TransformationMatrix> matrix = TransformationMatrix::create( );
95 matrix->setM41(x); 96 matrix->setM41(x);
96 matrix->setM42(y); 97 matrix->setM42(y);
97 matrix->setM43(z); 98 matrix->setM43(z);
98 return new CSSMatrixTransformComponent(std::move(matrix), Translation3DType) ; 99 return new CSSMatrixTransformComponent(std::move(matrix), Translation3DType) ;
99 } 100 }
100 101
102 } // namespace cssom
101 } // namespace blink 103 } // namespace blink
104
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698