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

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

Issue 2255563002: Add constructor for DOMMatrixReadOnly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 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
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/ExceptionState.h"
8 #include "bindings/core/v8/ScriptWrappable.h" 9 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/dom/DOMTypedArray.h" 10 #include "core/dom/DOMTypedArray.h"
10 #include "platform/heap/Handle.h" 11 #include "platform/heap/Handle.h"
11 #include "platform/transforms/TransformationMatrix.h" 12 #include "platform/transforms/TransformationMatrix.h"
12 #include <memory> 13 #include <memory>
13 14
14 namespace blink { 15 namespace blink {
15 16
16 class DOMMatrix; 17 class DOMMatrix;
17 18
18 class DOMMatrixReadOnly : public GarbageCollectedFinalized<DOMMatrixReadOnly>, p ublic ScriptWrappable { 19 class DOMMatrixReadOnly : public GarbageCollectedFinalized<DOMMatrixReadOnly>, p ublic ScriptWrappable {
19 DEFINE_WRAPPERTYPEINFO(); 20 DEFINE_WRAPPERTYPEINFO();
20 public: 21 public:
22 static DOMMatrixReadOnly* create(Vector<double>, ExceptionState&);
21 virtual ~DOMMatrixReadOnly(); 23 virtual ~DOMMatrixReadOnly();
22 24
23 double a() const { return m_matrix->m11(); } 25 double a() const { return m_matrix->m11(); }
24 double b() const { return m_matrix->m12(); } 26 double b() const { return m_matrix->m12(); }
25 double c() const { return m_matrix->m21(); } 27 double c() const { return m_matrix->m21(); }
26 double d() const { return m_matrix->m22(); } 28 double d() const { return m_matrix->m22(); }
27 double e() const { return m_matrix->m41(); } 29 double e() const { return m_matrix->m41(); }
28 double f() const { return m_matrix->m42(); } 30 double f() const { return m_matrix->m42(); }
29 31
30 double m11() const { return m_matrix->m11(); } 32 double m11() const { return m_matrix->m11(); }
(...skipping 24 matching lines...) Expand all
55 double ox = 0, double oy = 0, double oz = 0); 57 double ox = 0, double oy = 0, double oz = 0);
56 58
57 DOMFloat32Array* toFloat32Array() const; 59 DOMFloat32Array* toFloat32Array() const;
58 DOMFloat64Array* toFloat64Array() const; 60 DOMFloat64Array* toFloat64Array() const;
59 61
60 const TransformationMatrix& matrix() const { return *m_matrix; } 62 const TransformationMatrix& matrix() const { return *m_matrix; }
61 63
62 DEFINE_INLINE_TRACE() { } 64 DEFINE_INLINE_TRACE() { }
63 65
64 protected: 66 protected:
67 DOMMatrixReadOnly() {}
65 // TransformationMatrix needs to be 16-byte aligned. PartitionAlloc 68 // TransformationMatrix needs to be 16-byte aligned. PartitionAlloc
66 // supports 16-byte alignment but Oilpan doesn't. So we use an std::unique_p tr 69 // supports 16-byte alignment but Oilpan doesn't. So we use an std::unique_p tr
67 // to allocate TransformationMatrix on PartitionAlloc. 70 // to allocate TransformationMatrix on PartitionAlloc.
68 // TODO(oilpan): Oilpan should support 16-byte aligned allocations. 71 // TODO(oilpan): Oilpan should support 16-byte aligned allocations.
69 std::unique_ptr<TransformationMatrix> m_matrix; 72 std::unique_ptr<TransformationMatrix> m_matrix;
70 bool m_is2D; 73 bool m_is2D;
74
75 private:
76 DOMMatrixReadOnly(Vector<double> sequence);
71 }; 77 };
72 78
73 } // namespace blink 79 } // namespace blink
74 80
75 #endif 81 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698