A function-based shading was sampled at one step per user-space unit of
its own matrix, so a unit domain scaled up by the CTM, a form matrix or
a pattern matrix was drawn with a single cell.
The sampling grid is now computed from the transform the shading is
painted with, and the generated meshes are cached per grid size.
The setFillColorN/setStrokeColorN cases are merged so the base transform
is only passed in one place.
The software mesh rasterizer now clamps triangles to the canvas, so
pixels on the right edge no longer wrap into the next row.
It fixes#22616.