Initial addition of Canvas2D element


Add Canvas2D QML element. This is similar to Qt Quick Canvas,
but the backend is using Qt Canvas Painter instead of QPainter.
Some features are removed and some added, so that the Canvas2D
API will match to the features of Qt Canvas Painter C++ API.

Current feature differences compared to Qt Quick Canvas element:
- no support for general shadows (shadowBlur, shadowColor etc.)
- no support for current path clipping (see clipRect()).
- no support for dashed stroke, only solid strokes.
- no support for raw pixel operations (createImageData(),
  putImageData(), getImageData()).
+ ellipse() method takes center point and radius like the 2d
  context standard, while Quick Canvas takes x, y, width & height.
  For backwards compatibility, there is a separate "ellipseRect()"
  method.
+ roundRect() method with separate radius for all corners. Quick
  Canvas has differently named non-standard roundedRect() with 2
  radius parameters for combined top & bottom radius.
+ circle() method for simple circles without using e.g. arc().
+ scale() method works also with a single parameter, doing uniform
  scaling.
+ support for 'hanging' text baseline mode.
+ support for box gradient (createBoxGradient()).
+ support for box shadow (createBoxShadow(), drawBoxShadow()).
+ support for global color effects (globalBrightness,
  globalContrast, globalSaturate).
+ use "skew()" as a method name instead of "shear()". Both are
  supported but only skew documented.
+ support "resetClipping()" method, to reset just the clipping.
+ support beginSolidSubPath() and beginHoleSubPath() methods.
+ support antialias property, for adjustable antialias amount.
+ support for grid patterns (createGridPattern()).

Documentation not yet fully updated to Canvas2D.

Task-number: QTBUG-144505
Change-Id: I0b95f4cb27303a8db00d68579612ae5bc3bdb32c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
commit444d346ee70ba874df04c25522927895ce8f78c0
parent74c4af942b3074c563538072cd864b1e47fc98e8
authorKaj Grönholm <kaj.gronholm@qt.io>
committerKaj Grönholm <kaj.gronholm@qt.io>
commit timeFri, 24 Apr 2026 08:42:35 +0000