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

Unified Diff: Source/core/dom/DOMMatrixReadOnly.h

Issue 426063007: Implement basic interfaces and attributes for DOMMatrix. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add is2d test 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/DOMMatrix.idl ('k') | Source/core/dom/DOMMatrixReadOnly.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMMatrixReadOnly.h
diff --git a/Source/core/dom/DOMMatrixReadOnly.h b/Source/core/dom/DOMMatrixReadOnly.h
new file mode 100644
index 0000000000000000000000000000000000000000..1d99724d223edcf840d05dedcf67745e0ba94d01
--- /dev/null
+++ b/Source/core/dom/DOMMatrixReadOnly.h
@@ -0,0 +1,50 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DOMMatrixReadOnly_h
+#define DOMMatrixReadOnly_h
+
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class DOMMatrixReadOnly : public GarbageCollected<DOMMatrixReadOnly> {
+public:
+ double a() const { return m11(); }
+ double b() const { return m12(); }
+ double c() const { return m21(); }
+ double d() const { return m22(); }
+ double e() const { return m41(); }
+ double f() const { return m42(); }
+
+ double m11() const { return m_matrix[0][0]; }
+ double m12() const { return m_matrix[0][1]; }
+ double m13() const { return m_matrix[0][2]; }
+ double m14() const { return m_matrix[0][3]; }
+ double m21() const { return m_matrix[1][0]; }
+ double m22() const { return m_matrix[1][1]; }
+ double m23() const { return m_matrix[1][2]; }
+ double m24() const { return m_matrix[1][3]; }
+ double m31() const { return m_matrix[2][0]; }
+ double m32() const { return m_matrix[2][1]; }
+ double m33() const { return m_matrix[2][2]; }
+ double m34() const { return m_matrix[2][3]; }
+ double m41() const { return m_matrix[3][0]; }
+ double m42() const { return m_matrix[3][1]; }
+ double m43() const { return m_matrix[3][2]; }
+ double m44() const { return m_matrix[3][3]; }
+
+ bool is2D() const;
+ bool isIdentity() const;
+
+ void trace(Visitor*) { }
+
+protected:
+ double m_matrix[4][4];
+ bool m_is2D;
+};
+
+} // namespace blink
+
+#endif
« 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