Canvas2D: Add support for transforms


HTML Canvas 2d context uses DOMMatrix object for transforms and Qt
Canvas Painter uses QTransform. Best existing match in Qt Quick is
matrix4x4, but its API is for 3D operations and not very good for
2D transformations. So add own transform2d type for Canvas2D.
Add support into:
- new createTransform2D() method.
- new getTransform() method returning state transform2d.
- additional setTransform() version that takes transform2d.
- addPath() to take transform2d as a second parameter.

For this to work, we need to maintain the current transform in
context as it can't be requested directly from painter which works
asynchronously, possibly on another thread.

Task-number: QTBUG-145974
Change-Id: Iba4cb6ff7fef321df47466e88c91732c1d01614a
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
commitab41598a4dba06cc702356e0f328f4244167e35f
parent21b8861ef8a91a38eb628d3819910d45f4ce5dbe
authorKaj Grönholm <kaj.gronholm@qt.io>
committerKaj Grönholm <kaj.gronholm@qt.io>
commit timeTue, 12 May 2026 12:24:28 +0000