Issue #1810 - Implement {get|set}Transform with DOMMatrix arguments.

We already had part of the plumbing for other canvas manipulations, so
this is somewhat simplified.

This excludes the interface as that is breaking the build at this stage.
Some more research is required.
This commit is contained in:
Moonchild 2024-08-16 11:02:07 +02:00 • committed by roytam1
commit 71bd54891a
4 changed files with 46 additions and 8 deletions

View file

@ -52,6 +52,11 @@ public:
mMatrix3D = new gfx::Matrix4x4(aMatrix);
}
DOMMatrixReadOnly(nsISupports* aParent, const gfx::Matrix& aMatrix)
: mParent(aParent) {
mMatrix2D = new gfx::Matrix(aMatrix);
}
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMMatrixReadOnly)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMMatrixReadOnly)
@ -234,7 +239,7 @@ protected:
* The init dictionary's dimension must match the matrix one.
*/
void SetDataFromMatrix2DInit(const DOMMatrix2DInit& aMatrixInit);
void SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit);
void SetDataFromMatrixInit(const DOMMatrixInit& aMatrixInit);
DOMMatrixReadOnly* SetMatrixValue(const nsAString& aTransformList, ErrorResult& aRv);
void Ensure3DMatrix();
@ -268,6 +273,10 @@ public:
: DOMMatrixReadOnly(aParent, aMatrix)
{}
DOMMatrix(nsISupports* aParent, const gfx::Matrix& aMatrix)
: DOMMatrixReadOnly(aParent, aMatrix)
{}
static already_AddRefed<DOMMatrix>
FromMatrix(nsISupports* aParent, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv);
static already_AddRefed<DOMMatrix>