Re: [whatwg] Grouping in canvas 2d

2014-04-03 Thread Jürg Lehni
Here another simple example: When both filling and stroking a path and then drawing it with with an opacity of less than 100%, the path will be rendered differently than in an SVG (a large stroke width will make the issue more apparent): - In Canvas, both the fill and the stroke will be

Re: [whatwg] Grouping in canvas 2d

2014-03-14 Thread Ian Hickson
On Wed, 4 Dec 2013, Jürg Lehni wrote: Implementing [layering/grouping] would help us greatly to optimize aspects of Paper.js, as double buffering into separate canvases is very slow and costly. Can you elaborate on what precisely the performance bottleneck is? I was looking through this

Re: [whatwg] Grouping in canvas 2d

2014-03-14 Thread Rik Cabanier
On Fri, Mar 14, 2014 at 11:09 AM, Ian Hickson i...@hixie.ch wrote: On Wed, 4 Dec 2013, Jürg Lehni wrote: Implementing [layering/grouping] would help us greatly to optimize aspects of Paper.js, as double buffering into separate canvases is very slow and costly. Can you elaborate on what

Re: [whatwg] Grouping in canvas 2d

2013-12-04 Thread Rik Cabanier
I On Wed, Dec 4, 2013 at 11:41 AM, Jürg Lehni li...@scratchdisk.com wrote: This discussion seems to have stalled. Implementing this would help us greatly to optimize aspects of Paper.js, as double buffering into separate canvases is very slow and costly. Is this still on the map? There

Re: [whatwg] Grouping in canvas 2d

2013-12-04 Thread Jürg Lehni
This discussion seems to have stalled. Implementing this would help us greatly to optimize aspects of Paper.js, as double buffering into separate canvases is very slow and costly. Is this still on the map? There appears to be a library that emulates this functionality, using the same approach

Re: [whatwg] Grouping in canvas 2d

2013-06-18 Thread Justin Novosad
On Fri, Jun 14, 2013 at 2:34 PM, Rik Cabanier caban...@gmail.com wrote: I think so. If you leave a layer 'open', what would you display. It wouldn't just be for requestAnimationFrame, you would also need to define what happens if you read pixels with getImageData inside a beginLayer. I

Re: [whatwg] Grouping in canvas 2d

2013-06-18 Thread Rik Cabanier
On Tue, Jun 18, 2013 at 7:25 AM, Justin Novosad ju...@google.com wrote: On Fri, Jun 14, 2013 at 2:34 PM, Rik Cabanier caban...@gmail.com wrote: I think so. If you leave a layer 'open', what would you display. It wouldn't just be for requestAnimationFrame, you would also need to define

Re: [whatwg] Grouping in canvas 2d

2013-06-17 Thread Jürg Lehni
I am very much interested in this feature. Of course you can use separate canvases to achieve the same, which is what we currently do in Paper.js, but it appears to be rather slow to do so. I think performance could improve a lot which this alternative API proposal. Jürg On Jun 13, 2013, at

Re: [whatwg] Grouping in canvas 2d

2013-06-14 Thread Rik Cabanier
On Fri, Jun 14, 2013 at 6:04 AM, Brian Salomon bsalo...@chromium.orgwrote: As an implementor, we would prefer the layer approach. This would have lower overhead in Chromium/Skia. We can make better decisions about caching and deferred rendering. It also seems like a really handy API for devs,

[whatwg] Grouping in canvas 2d

2013-06-13 Thread Rik Cabanier
Last year, I requested if grouping could be added to canvas. The API would look like this: void beginLayer(); void beginLayer(unsigned long x, unsigned long y, unsigned long w, unsigned long h); void endLayer(); When you call beginLayer, you inherit everything from the graphics state except