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

Re: [whatwg] CanvasRenderingContext2D with addPath, currentPath

From: Ian Hickson <ian@hixie.ch>
Date: Sat, 2 Nov 2013 21:45:40 +0000 (UTC)
To: Rik Cabanier <cabanier@gmail.com>
Message-ID: <alpine.DEB.2.00.1311022142220.838@ps20323.dreamhostps.com>
Cc: "whatwg@whatwg.org" <whatwg@whatwg.org>
On Fri, 1 Nov 2013, Rik Cabanier wrote:
> On Fri, Nov 1, 2013 at 7:22 PM, Ian Hickson <ian@hixie.ch> wrote:
> > On Fri, 1 Nov 2013, Rik Cabanier wrote:
> > >
> > > The latest Safari is shipping currentPath and Blink has implemented 
> > > it behind a runtime flag. Could we put this in the specification?
> >
> > What's the use case?
> 
> It would be a very fast way to set a cached path in the graphics state. 
> There's no need to apply the current transform and the underlying path 
> object can quickly be copied since it replaces the current path (as 
> opposed to adding to it)

What's the use case for setting a cached path? Is it just stroking or 
filling or setting the clipping region? If it is, and if having the 
identity transform isn't sufficient (why wouldn't it be?) then it seems 
that the better way to do this would be to provide direct methods for 
stroking and filling and so forth without applying the transform.

But I don't really see why it wouldn't be better to just set the transform 
to the identity matrix and then use the Path facilities. No need to set 
the implicit path.


> > I intentionally didn't add this to the spec when I was adding the last 
> > set of path-related features, because it seems entirely redundant with 
> > Path objects. I thought we'd want people to move away from using the 
> > implicit path, rather than making it more powerful.
> 
> The intent is to move away from path to describe filled or stroked 
> regions.

The intent of what? And why?


> > > the proposal is for a new attribute on the 2d canvas rendering 
> > > context:
> > >
> > > attribute Path currentPath;
> > >
> > > This attribute would give you a non-live/copy of the current path in 
> > > device space.
> >
> > If it returns a copy, it should be a method.
> 
> That's a problem :-( Shipping Safari has an attribute and it duplicates 
> the path when ask for the current path.

Yeah, we definitely shouldn't standardise something like that, IMHO. That 
goes against pretty firmly established design principles.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Saturday, 2 November 2013 21:46:15 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:13 UTC