| Index: third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.h
|
| diff --git a/third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.h b/third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.h
|
| index cd19086fb95f05e087478c3ee094075bfa73a5c1..10c274be353f2078afa3ef7973055b98f1fbb628 100644
|
| --- a/third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.h
|
| +++ b/third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.h
|
| @@ -20,6 +20,9 @@ class DOMMatrixReadOnly : public GarbageCollectedFinalized<DOMMatrixReadOnly>, p
|
| DEFINE_WRAPPERTYPEINFO();
|
| public:
|
| static DOMMatrixReadOnly* create(Vector<double>, ExceptionState&);
|
| + static DOMMatrixReadOnly* fromFloat32Array(DOMFloat32Array*, ExceptionState&);
|
| + static DOMMatrixReadOnly* fromFloat64Array(DOMFloat64Array*, ExceptionState&);
|
| +
|
| virtual ~DOMMatrixReadOnly();
|
|
|
| double a() const { return m_matrix->m11(); }
|
| @@ -72,15 +75,33 @@ public:
|
|
|
| protected:
|
| DOMMatrixReadOnly() {}
|
| +
|
| + template <typename T>
|
| + DOMMatrixReadOnly(T sequence, int size)
|
| + {
|
| + if (size == 6) {
|
| + m_matrix = TransformationMatrix::create(
|
| + sequence[0], sequence[1], sequence[2], sequence[3],
|
| + sequence[4], sequence[5]);
|
| + m_is2D = true;
|
| + } else if (size == 16) {
|
| + m_matrix = TransformationMatrix::create(
|
| + sequence[0], sequence[1], sequence[2], sequence[3],
|
| + sequence[4], sequence[5], sequence[6], sequence[7],
|
| + sequence[8], sequence[9], sequence[10], sequence[11],
|
| + sequence[12], sequence[13], sequence[14], sequence[15]);
|
| + m_is2D = false;
|
| + } else {
|
| + NOTREACHED();
|
| + }
|
| + }
|
| +
|
| // TransformationMatrix needs to be 16-byte aligned. PartitionAlloc
|
| // supports 16-byte alignment but Oilpan doesn't. So we use an std::unique_ptr
|
| // to allocate TransformationMatrix on PartitionAlloc.
|
| // TODO(oilpan): Oilpan should support 16-byte aligned allocations.
|
| std::unique_ptr<TransformationMatrix> m_matrix;
|
| bool m_is2D;
|
| -
|
| -private:
|
| - DOMMatrixReadOnly(Vector<double> sequence);
|
| };
|
|
|
| } // namespace blink
|
|
|