- From: Simon Sarris <simon.sarris@gmail.com>
- Date: Tue, 29 Jan 2013 20:12:04 -0500
- To: Rik Cabanier <cabanier@gmail.com>
- Cc: whatwg@whatwg.org, public-canvas-api@w3.org
- Message-ID: <CAA5isUY=PmcRHe09LC1LMGJMOc3TN65UL_Up=i5qzm=8nY51Dw@mail.gmail.com>
I opened the bug about this originally back in 2011, asking that it be added (it was in March 2012 to the WHATWG spec). For the sake of the discussion that bug is here: https://www.w3.org/Bugs/Public/show_bug.cgi?id=14499 The reason is that (almost) every single piece of canvas context state can be reset on its own (ie, to reset the fillStyle: ctx.fillStyle = 'black') Yet the only part of the context state that cannot be reset on its own is the clipping region. For this to be reset you must use save and restore, which affect all state and are to be avoided in performance-minded applications (games, diagramming libraries, etc). So from a heavy canvas-user's perspective resetClip() has a definite utility. On the other hand I can't comment on difficulty of implementation. On Tue, Jan 29, 2013 at 8:00 PM, Rik Cabanier <cabanier@gmail.com> wrote: > All, > > we were looking at how resetClip [1] could be implemented in WebKit. > Looking over the Core Graphics implementation, this feature can't be > implemented without significant overhead. I also found an email from 2007 > where Maciej states the same concern. [2] > > Since no browser has implemented it, can it be removed from the spec? > > Rik > > 1: > > http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-resetclip > 2: http://permalink.gmane.org/gmane.org.w3c.whatwg.discuss/10582 >
Received on Wednesday, 30 January 2013 01:12:34 UTC