Implement stencil-based path/region clipping


This patch is primarily focused on API and correctness.
The implementation is not fully optimized. The API is
marked as \internal, since it does expose implementation
details, and there are significant limitations. One
inherent limitation is that stencil clipping cannot
support antialiasing.

The stencil is treated more like a render
target, so save/restore does not affect stencil clipping.
Multiple stencil clipping draws will be intersected, and
painter transforms are respected.

Path clipping supports both winding and even-odd fill
rules, but all sub-paths need to be convex, since no
actual triangulation is performed.

Change-Id: Ia6a1f322f3100f9efc822473479dba58b55743c6
Reviewed-by: Owais Akhtar <owais.akhtar@qt.io>
Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
commit20c64d2750ac0e1cb0a2a741ebe4b5feb7766eb6
parenta7fcc3d428e1ff6eca7620e929093122e09aad59
authorPaul Olav Tvete <paul.tvete@qt.io>
committerPaul Olav Tvete <paul.tvete@qt.io>
commit timeTue, 26 May 2026 08:25:26 +0000