[whatwg] Adding 2D Canvas features (Was: Grouping in canvas 2d)

Ian Hickson ian at hixie.ch
Fri Jun 14 10:42:42 PDT 2013


On Fri, 14 Jun 2013, Brian Salomon wrote:
>
> 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, especially the ability to inherit the graphics state. Would 
> the spec have anything to say about beginLayer()/endLayer() balancing, 
> especially with respect to RAF?

I have no ojection to adding this to the spec, but right now the spec has 
a bunch of features that aren't implemented, and there's a long list of 
other features people want that aren't yet specced. I'm very hesitant to 
get the spec further and further away from implementations.

For example, here are some of the bug numbers for <canvas> feature 
requests:

11399	<canvas> Locking individual color channels (e.g. drawing to alpha 
                 only)
21835	<canvas> Path object should have a way to add paths keeping only 
                 the union given a fill rule
21939	<canvas> Path objects would be much more useful if their 
                 individual commands (moveTo, lineTo, etc.) could be 
                 inspected from JavaScript [...]
8794	<canvas> lineWidth = 'hairline'
11739	<canvas> clearPath() that clears pixels the way clearRect() does, 
                 but using a path
9236	<canvas> Detecting the intersection of Path objects
9235	<canvas> perspective transformations
18751	<canvas> a way to get the coordinate of the last point in a path
21346	<canvas> Have ImageBitmap expose height and width attributes

(Bugs accessible from https://www.w3.org/Bugs/Public/)

There's also the printCallback API proposal from Mozilla:
http://lists.w3.org/Archives/Public/public-whatwg-archive/2012Sep/0371.html

Adding a parameter to drawImage for sprite sheets to avoid bleeding, 
proposal from Chrome:
http://lists.w3.org/Archives/Public/public-whatwg-archive/2012Dec/0088.html

Stroke alignment:
http://lists.w3.org/Archives/Public/public-whatwg-archive/2010Jul/0238.html

Page flipping instead of double buffering:
http://lists.w3.org/Archives/Public/public-whatwg-archive/2013Jan/0073.html

Inner shadows:
http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-November/038079.html


Plus, as I mentioned, things in the spec that aren't implemented widely: 
Right now, the things in the spec that aren't widely implemented are the 
things that were needed for accessibility (hit regions) and the things 
that are the basis for some of the most-requested features (Paths).


I think before we add more features, it's important that we figure out 
which browsers want to implement which features, and that we start with 
the highest priority ones.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list