There are libraries building on top of WebGPU for that, like:
https://github.com/linebender/vello
and (shameless plug):
https://github.com/Lichtso/contrast_renderer