Canvas has a general clip() method, but it is currently implemented in the most general way that assumes that the clip is an arbitrary shape with soft edges. The performance would be much higher if we detected rectangular clips and implemented them using scissor clipping rather than raster operations.
It would be even more useful to programmers to implement a front end API on GraphicsContext to let them specify a rectangular clip up front rather than having to construct a path.
It would be even more useful to programmers to implement a front end API on GraphicsContext to let them specify a rectangular clip up front rather than having to construct a path.