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>