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

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

Issue 446803002: Implement translate() and translateSelf() in DOMMatrix. (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.idl ('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 #include "platform/transforms/TransformationMatrix.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class DOMMatrix;
15
14 class DOMMatrixReadOnly : public GarbageCollected<DOMMatrixReadOnly>, public Scr iptWrappableBase { 16 class DOMMatrixReadOnly : public GarbageCollected<DOMMatrixReadOnly>, public Scr iptWrappableBase {
15 public: 17 public:
16 double a() const { return m_matrix.m11(); } 18 double a() const { return m_matrix.m11(); }
17 double b() const { return m_matrix.m12(); } 19 double b() const { return m_matrix.m12(); }
18 double c() const { return m_matrix.m21(); } 20 double c() const { return m_matrix.m21(); }
19 double d() const { return m_matrix.m22(); } 21 double d() const { return m_matrix.m22(); }
20 double e() const { return m_matrix.m41(); } 22 double e() const { return m_matrix.m41(); }
21 double f() const { return m_matrix.m42(); } 23 double f() const { return m_matrix.m42(); }
22 24
23 double m11() const { return m_matrix.m11(); } 25 double m11() const { return m_matrix.m11(); }
24 double m12() const { return m_matrix.m12(); } 26 double m12() const { return m_matrix.m12(); }
25 double m13() const { return m_matrix.m13(); } 27 double m13() const { return m_matrix.m13(); }
26 double m14() const { return m_matrix.m14(); } 28 double m14() const { return m_matrix.m14(); }
27 double m21() const { return m_matrix.m21(); } 29 double m21() const { return m_matrix.m21(); }
28 double m22() const { return m_matrix.m22(); } 30 double m22() const { return m_matrix.m22(); }
29 double m23() const { return m_matrix.m23(); } 31 double m23() const { return m_matrix.m23(); }
30 double m24() const { return m_matrix.m24(); } 32 double m24() const { return m_matrix.m24(); }
31 double m31() const { return m_matrix.m31(); } 33 double m31() const { return m_matrix.m31(); }
32 double m32() const { return m_matrix.m32(); } 34 double m32() const { return m_matrix.m32(); }
33 double m33() const { return m_matrix.m33(); } 35 double m33() const { return m_matrix.m33(); }
34 double m34() const { return m_matrix.m34(); } 36 double m34() const { return m_matrix.m34(); }
35 double m41() const { return m_matrix.m41(); } 37 double m41() const { return m_matrix.m41(); }
36 double m42() const { return m_matrix.m42(); } 38 double m42() const { return m_matrix.m42(); }
37 double m43() const { return m_matrix.m43(); } 39 double m43() const { return m_matrix.m43(); }
38 double m44() const { return m_matrix.m44(); } 40 double m44() const { return m_matrix.m44(); }
39 41
40 bool is2D() const; 42 bool is2D() const;
41 bool isIdentity() const; 43 bool isIdentity() const;
42 44
45 DOMMatrix* translate(double tx, double ty, double tz = 0);
46
43 const TransformationMatrix& matrix() const { return m_matrix; } 47 const TransformationMatrix& matrix() const { return m_matrix; }
44 48
45 void trace(Visitor*) { } 49 void trace(Visitor*) { }
46 50
47 protected: 51 protected:
48 TransformationMatrix m_matrix; 52 TransformationMatrix m_matrix;
49 bool m_is2D; 53 bool m_is2D;
50 }; 54 };
51 55
52 } // namespace blink 56 } // namespace blink
53 57
54 #endif 58 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/DOMMatrix.idl ('k') | Source/core/dom/DOMMatrixReadOnly.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698