<br><br><div class="gmail_quote">On Thu, Feb 14, 2013 at 9:55 AM, Dirk Schulze <span dir="ltr">&lt;<a href="mailto:dschulze@adobe.com" target="_blank">dschulze@adobe.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi WebKit folks,<br>
<br>
I worked on the Path interface defined by the Canvas spec of W3C and WHATWG [1][2] for the last couple of weeks.<br>
<br>
Summary:<br>
Canvas supports a new DOM interface called Path. The Path interface takes a series of very well known path methods like moveTo, lineTo, cubicCurveTo, rect and allows to create and keep a path independent of a Canvas context. Additionally, I added the attribute &#39;currentPath&#39; to the Canvas context to provide read and write access to the current path created on the Canvas context. Code snippet:<br>

<br>
var path = new Path();<br>
path.rect(0,0,100,100);<br>
<br>
var ctx = canvas.getContext(&#39;2d&#39;);<br>
ctx.currentPath = path;<br>
ctx.lineTo(200,200);<br>
ctx.closePath();<br>
<br>
var path2 = ctx.currentPath; // path2 != path<br>
<br>
Not implemented are addText, addPath,  addPathByStrokingText. Another proposal from Rik Cabanier[3] seems to address the idea behind these methods better.<br>
<br>
I would like to ask to enable CANVAS_PATH by default on trunk. Ports can opt-out the flag again. More information about some implementation details in a short article[4]. If there are any concerns, suggestions or questions, I am happy to answer them.<br>
</blockquote><div><br></div><div>Could you please add a runtime enable flag before flipping this on for chromium?  Thanks.</div><div><br></div><div>- James</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Greetings,<br>
Dirk<br>
<br>
[1] <a href="http://www.w3.org/html/wg/drafts/2dcontext/html5_canvas/#path-objects" target="_blank">http://www.w3.org/html/wg/drafts/2dcontext/html5_canvas/#path-objects</a><br>
[2] <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#path-objects" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#path-objects</a><br>

[3] <a href="http://blogs.adobe.com/webplatform/2013/01/31/revised-canvas-paths/" target="_blank">http://blogs.adobe.com/webplatform/2013/01/31/revised-canvas-paths/</a><br>
[4] <a href="http://dschulze.com/blog/articles/10/html-canvas-path-object-in-webkit" target="_blank">http://dschulze.com/blog/articles/10/html-canvas-path-object-in-webkit</a><br>
_______________________________________________<br>
webkit-dev mailing list<br>
<a href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org</a><br>
<a href="https://lists.webkit.org/mailman/listinfo/webkit-dev" target="_blank">https://lists.webkit.org/mailman/listinfo/webkit-dev</a><br>
</blockquote></div><br>