From d2c3ea08ebf8f94ba711dbb7bb222d3ba26cca12 Mon Sep 17 00:00:00 2001 From: Job Bautista Date: Thu, 11 May 2023 22:03:17 +0800 Subject: [PATCH] Issue #2241 - Part 3: Extend DOMMatrixReadOnly to allow instantiation with a Matrix4x4. Backported from Mozilla bug 1355675. --- dom/base/DOMMatrix.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dom/base/DOMMatrix.h b/dom/base/DOMMatrix.h index a9c52fa8c3..9b83548efa 100644 --- a/dom/base/DOMMatrix.h +++ b/dom/base/DOMMatrix.h @@ -42,6 +42,12 @@ public: } } + DOMMatrixReadOnly(nsISupports* aParent, const gfx::Matrix4x4& aMatrix) + : mParent(aParent) + { + mMatrix3D = new gfx::Matrix4x4(aMatrix); + } + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMMatrixReadOnly) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMMatrixReadOnly) @@ -154,6 +160,10 @@ public: : DOMMatrixReadOnly(aParent, other) {} + DOMMatrix(nsISupports* aParent, const gfx::Matrix4x4& aMatrix) + : DOMMatrixReadOnly(aParent, aMatrix) + {} + static already_AddRefed Constructor(const GlobalObject& aGlobal, ErrorResult& aRv); static already_AddRefed