Re: [whatwg] Canvas resetClip() API

On Oct 7, 2013, at 8:55 PM, Rashmi Shyamasundar <> wrote:

> Hi All,
> This is regarding the resetClip() API for canvas. Please take a look at my
> patches to the bug
> resetClip() can be implemented in Cairo, without any overhead, since Cairo
> supports resetClip.
> I tried to implement the API in CG, using the below approach :- (Please
> check )

I donít like the resetClip() API, and donít think it should be added to canvas.

The reason resetClip() is a bad API is that it breaks the ability to robustly modularize
drawing code. For example, say that you have the following code:;
// Ö set up a path to clip to

In the absence of resetClip(), you are guaranteed that someJSLibrary.drawSomething()
canít draw outside of the clip you specified. With resetClip(), that JS library can draw
wherever the heck it wants, which may totally break your canvas drawing.

If you really need resetClip() in your own drawing code, youíre probably doing it wrong.


Received on Tuesday, 8 October 2013 23:54:14 UTC