W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2013

Re: [whatwg] remove resetClip from the Canvas 2D spec

From: Simon Sarris <simon.sarris@gmail.com>
Date: Tue, 29 Jan 2013 20:12:04 -0500
Message-ID: <CAA5isUY=PmcRHe09LC1LMGJMOc3TN65UL_Up=i5qzm=8nY51Dw@mail.gmail.com>
To: Rik Cabanier <cabanier@gmail.com>
Cc: whatwg@whatwg.org, public-canvas-api@w3.org
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:


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:32 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:52 UTC