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

Side by Side Diff: Source/core/dom/DOMMatrixReadOnly.h

Issue 460713002: DOMMatrix should use TransformationMatrix internally. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « Source/core/dom/DOMMatrix.cpp ('k') | Source/core/dom/DOMMatrixReadOnly.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef DOMMatrixReadOnly_h 5 #ifndef DOMMatrixReadOnly_h
6 #define DOMMatrixReadOnly_h 6 #define DOMMatrixReadOnly_h
7 7
8 #include "bindings/core/v8/ScriptWrappable.h" 8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "platform/heap/Handle.h" 9 #include "platform/heap/Handle.h"
10 #include "platform/transforms/TransformationMatrix.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 class DOMMatrixReadOnly : public GarbageCollected<DOMMatrixReadOnly>, public Scr iptWrappableBase { 14 class DOMMatrixReadOnly : public GarbageCollected<DOMMatrixReadOnly>, public Scr iptWrappableBase {
14 public: 15 public:
15 double a() const { return m11(); } 16 double a() const { return m_matrix.m11(); }
16 double b() const { return m12(); } 17 double b() const { return m_matrix.m12(); }
17 double c() const { return m21(); } 18 double c() const { return m_matrix.m21(); }
18 double d() const { return m22(); } 19 double d() const { return m_matrix.m22(); }
19 double e() const { return m41(); } 20 double e() const { return m_matrix.m41(); }
20 double f() const { return m42(); } 21 double f() const { return m_matrix.m42(); }
21 22
22 double m11() const { return m_matrix[0][0]; } 23 double m11() const { return m_matrix.m11(); }
23 double m12() const { return m_matrix[0][1]; } 24 double m12() const { return m_matrix.m12(); }
24 double m13() const { return m_matrix[0][2]; } 25 double m13() const { return m_matrix.m13(); }
25 double m14() const { return m_matrix[0][3]; } 26 double m14() const { return m_matrix.m14(); }
26 double m21() const { return m_matrix[1][0]; } 27 double m21() const { return m_matrix.m21(); }
27 double m22() const { return m_matrix[1][1]; } 28 double m22() const { return m_matrix.m22(); }
28 double m23() const { return m_matrix[1][2]; } 29 double m23() const { return m_matrix.m23(); }
29 double m24() const { return m_matrix[1][3]; } 30 double m24() const { return m_matrix.m24(); }
30 double m31() const { return m_matrix[2][0]; } 31 double m31() const { return m_matrix.m31(); }
31 double m32() const { return m_matrix[2][1]; } 32 double m32() const { return m_matrix.m32(); }
32 double m33() const { return m_matrix[2][2]; } 33 double m33() const { return m_matrix.m33(); }
33 double m34() const { return m_matrix[2][3]; } 34 double m34() const { return m_matrix.m34(); }
34 double m41() const { return m_matrix[3][0]; } 35 double m41() const { return m_matrix.m41(); }
35 double m42() const { return m_matrix[3][1]; } 36 double m42() const { return m_matrix.m42(); }
36 double m43() const { return m_matrix[3][2]; } 37 double m43() const { return m_matrix.m43(); }
37 double m44() const { return m_matrix[3][3]; } 38 double m44() const { return m_matrix.m44(); }
38 39
39 bool is2D() const; 40 bool is2D() const;
40 bool isIdentity() const; 41 bool isIdentity() const;
41 42
43 const TransformationMatrix& matrix() const { return m_matrix; }
44
42 void trace(Visitor*) { } 45 void trace(Visitor*) { }
43 46
44 protected: 47 protected:
45 double m_matrix[4][4]; 48 TransformationMatrix m_matrix;
46 bool m_is2D; 49 bool m_is2D;
47 }; 50 };
48 51
49 } // namespace blink 52 } // namespace blink
50 53
51 #endif 54 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/DOMMatrix.cpp ('k') | Source/core/dom/DOMMatrixReadOnly.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698