- From: Simon Sarris <simon.sarris@gmail.com>
- Date: Tue, 13 Aug 2013 11:38:07 -0400
- To: Stephen White <senorblanco@chromium.org>
- Cc: Justin Novosad <junov@google.com>, WHATWG List <whatwg@whatwg.org>, Ian Hickson <ian@hixie.ch>, Rik Cabanier <cabanier@gmail.com>
> If this is strictly a performance issue, then we definitely should fix that before adding new API, IMHO. It would be great to get some reduced test cases where save()/restore() is a bottleneck. I'd argue its not strictly a performance issue. More generally its awkward that you can reset any piece of the canvas context state except the clipping region. The clipping region alone requires you to clobber all state in order to reset it. You can set the fillStyle back to black, you can set the transformation matrix back to identity, etc. But you can't set the clipping region back to the entire canvas area without save()/restore() or can.width=can.width. It's the only thing like that. That ought to be considered bad on principle I think. It makes clipping a really odd operation compared to anything else, and at the least it makes the one part of the API unintuitive.
Received on Tuesday, 13 August 2013 15:38:33 UTC