hmm... Can you explain the path-object more in detail. It sounds interesting... but why shouldn't i just create a function that takes a context and do the same path commands on it instead of having a context taking a path object?<div>
<div><br></div><div>/Samuel Ytterbrink<br><br><div class="gmail_quote">2010/11/13 Evgeny Burzak <span dir="ltr"><<a href="mailto:buzzilo@gmail.com">buzzilo@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
I have just published new Canvas stub for IE (based on flash). I'm<br>
using it in another my project - Drawform, to make it working under<br>
IE.<br>
Drawform: <a href="http://burzak.com/proj/drawform/" target="_blank">http://burzak.com/proj/drawform/</a><br>
fxCanvas: <a href="http://burzak.com/proj/fxcanvas/" target="_blank">http://burzak.com/proj/fxcanvas/</a><br>
<br>
So I have some remarks about Canvas spec.<br>
<br>
I faced some troubles when using default image data, because of in old<br>
Explorers used extremely ineffective memory manager, so that I made<br>
some tests and figure out that fastest and less memory consumption is<br>
array with pixel colors encoded in 32-bit integer. Here is the test:<br>
<a href="http://burzak.com/proj/fxcanvas/tests/data-structure-comparison.html" target="_blank">http://burzak.com/proj/fxcanvas/tests/data-structure-comparison.html</a><br>
<br>
But , the test results looks similar for all vendors! On average the<br>
difference in processing speed is about 2-3 times (five times in<br>
Firefox 4). This is due to the fact that loops take less time (width x<br>
height * 4 vs. width x height) and arrays with less elements take less<br>
memory. Though I realize that main idea for data structure was<br>
simplicity, but in this case it seems simplicity is evil, not good.<br>
<br>
Another thing is reusable canvas path. I've added experimental class<br>
CanvasPath and and some related methods to Canvas context.<br>
For example:<br>
var p = new CanvasPath() // I think first argument can be string from<br>
SVG "d" attribute<br>
p.moveTo(0, 0)<br>
p.lineTo(10, 20)<br>
ctx.beginPath()<br>
ctx.appendPath(p)<br>
... and so on. If you are interested in it, I can describe my idea futher...<br>
This is quite useful thing, at least for me.<br>
<font color="#888888"><br>
Evgeny<br>
</font></blockquote></div><br></div></div>