| OLD | NEW |
| 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 <memory> | 8 #include <memory> |
| 9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
| 10 #include "bindings/core/v8/StringOrUnrestrictedDoubleSequence.h" |
| 10 #include "core/dom/ArrayBufferViewHelpers.h" | 11 #include "core/dom/ArrayBufferViewHelpers.h" |
| 11 #include "core/dom/DOMTypedArray.h" | 12 #include "core/dom/DOMTypedArray.h" |
| 12 #include "platform/bindings/ScriptWrappable.h" | 13 #include "platform/bindings/ScriptWrappable.h" |
| 13 #include "platform/heap/Handle.h" | 14 #include "platform/heap/Handle.h" |
| 14 #include "platform/transforms/TransformationMatrix.h" | 15 #include "platform/transforms/TransformationMatrix.h" |
| 15 | 16 |
| 16 namespace blink { | 17 namespace blink { |
| 17 | 18 |
| 18 class DOMMatrix; | 19 class DOMMatrix; |
| 19 class DOMMatrixInit; | 20 class DOMMatrixInit; |
| 20 class DOMPoint; | 21 class DOMPoint; |
| 21 class DOMPointInit; | 22 class DOMPointInit; |
| 22 | 23 |
| 23 class CORE_EXPORT DOMMatrixReadOnly | 24 class CORE_EXPORT DOMMatrixReadOnly |
| 24 : public GarbageCollectedFinalized<DOMMatrixReadOnly>, | 25 : public GarbageCollectedFinalized<DOMMatrixReadOnly>, |
| 25 public ScriptWrappable { | 26 public ScriptWrappable { |
| 26 DEFINE_WRAPPERTYPEINFO(); | 27 DEFINE_WRAPPERTYPEINFO(); |
| 27 | 28 |
| 28 public: | 29 public: |
| 29 static DOMMatrixReadOnly* Create(ExceptionState&); | 30 static DOMMatrixReadOnly* Create(ExceptionState&); |
| 30 static DOMMatrixReadOnly* Create(const String&, ExceptionState&); | 31 static DOMMatrixReadOnly* Create(StringOrUnrestrictedDoubleSequence&, |
| 31 static DOMMatrixReadOnly* Create(Vector<double>, ExceptionState&); | 32 ExceptionState&); |
| 32 static DOMMatrixReadOnly* fromFloat32Array(NotShared<DOMFloat32Array>, | 33 static DOMMatrixReadOnly* fromFloat32Array(NotShared<DOMFloat32Array>, |
| 33 ExceptionState&); | 34 ExceptionState&); |
| 34 static DOMMatrixReadOnly* fromFloat64Array(NotShared<DOMFloat64Array>, | 35 static DOMMatrixReadOnly* fromFloat64Array(NotShared<DOMFloat64Array>, |
| 35 ExceptionState&); | 36 ExceptionState&); |
| 36 static DOMMatrixReadOnly* fromMatrix(DOMMatrixInit&, ExceptionState&); | 37 static DOMMatrixReadOnly* fromMatrix(DOMMatrixInit&, ExceptionState&); |
| 37 virtual ~DOMMatrixReadOnly(); | 38 virtual ~DOMMatrixReadOnly(); |
| 38 | 39 |
| 39 double a() const { return matrix_->M11(); } | 40 double a() const { return matrix_->M11(); } |
| 40 double b() const { return matrix_->M12(); } | 41 double b() const { return matrix_->M12(); } |
| 41 double c() const { return matrix_->M21(); } | 42 double c() const { return matrix_->M21(); } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // supports 16-byte alignment but Oilpan doesn't. So we use an std::unique_ptr | 135 // supports 16-byte alignment but Oilpan doesn't. So we use an std::unique_ptr |
| 135 // to allocate TransformationMatrix on PartitionAlloc. | 136 // to allocate TransformationMatrix on PartitionAlloc. |
| 136 // TODO(oilpan): Oilpan should support 16-byte aligned allocations. | 137 // TODO(oilpan): Oilpan should support 16-byte aligned allocations. |
| 137 std::unique_ptr<TransformationMatrix> matrix_; | 138 std::unique_ptr<TransformationMatrix> matrix_; |
| 138 bool is2d_; | 139 bool is2d_; |
| 139 }; | 140 }; |
| 140 | 141 |
| 141 } // namespace blink | 142 } // namespace blink |
| 142 | 143 |
| 143 #endif | 144 #endif |
| OLD | NEW |