summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJob Bautista <jobbautista9@aol.com>2023-05-11 22:03:17 +0800
committerJob Bautista <jobbautista9@aol.com>2023-05-12 16:26:05 +0800
commit29bdffbb54691ce31245c921dd07850fb6478d4c (patch)
tree8f8c503e371eba0b8350fc2834b5a6c8853f0f24
parentef31c426b19568a72932d9d6982685ad6baf0af6 (diff)
downloaduxp-29bdffbb54691ce31245c921dd07850fb6478d4c.tar.gz
Issue #2241 - Part 3: Extend DOMMatrixReadOnly to allow instantiation with a Matrix4x4.
Backported from Mozilla bug 1355675.
-rw-r--r--dom/base/DOMMatrix.h10
1 files changed, 10 insertions, 0 deletions
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<DOMMatrix>
Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
static already_AddRefed<DOMMatrix>