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

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

Issue 1673093003: blink::TransformationMatrix implement create methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove TransfromationMatrix::create(const AffineTransform&) Created 4 years, 10 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 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() 9 DOMMatrix* DOMMatrix::create()
10 { 10 {
11 return new DOMMatrix(TransformationMatrix()); 11 return new DOMMatrix(TransformationMatrix());
12 } 12 }
13 13
14 DOMMatrix* DOMMatrix::create(DOMMatrixReadOnly* other) 14 DOMMatrix* DOMMatrix::create(DOMMatrixReadOnly* other)
15 { 15 {
16 return new DOMMatrix(other->matrix(), other->is2D()); 16 return new DOMMatrix(other->matrix(), other->is2D());
17 } 17 }
18 18
19 DOMMatrix::DOMMatrix(const TransformationMatrix& matrix, bool is2D) 19 DOMMatrix::DOMMatrix(const TransformationMatrix& matrix, bool is2D)
20 { 20 {
21 m_matrix = adoptPtr(new TransformationMatrix(matrix)); 21 m_matrix = TransformationMatrix::create(matrix);
22 m_is2D = is2D; 22 m_is2D = is2D;
23 } 23 }
24 24
25 void DOMMatrix::setIs2D(bool value) 25 void DOMMatrix::setIs2D(bool value)
26 { 26 {
27 if (m_is2D) 27 if (m_is2D)
28 m_is2D = value; 28 m_is2D = value;
29 } 29 }
30 30
31 DOMMatrix* DOMMatrix::multiplySelf(DOMMatrix* other) 31 DOMMatrix* DOMMatrix::multiplySelf(DOMMatrix* other)
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 else 94 else
95 m_matrix->scale3d(sx, sy, sz); 95 m_matrix->scale3d(sx, sy, sz);
96 96
97 if (hasTranslation) 97 if (hasTranslation)
98 translateSelf(-ox, -oy, -oz); 98 translateSelf(-ox, -oy, -oz);
99 99
100 return this; 100 return this;
101 } 101 }
102 102
103 } // namespace blink 103 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698