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

[whatwg] fxCanvas 0.2 and some remarks about canvas spec

From: Samuel Ytterbrink <samuel@ytterbrink.nu>
Date: Mon, 15 Nov 2010 13:15:01 +0100
Message-ID: <AANLkTinimKaXpOW6SVhVGCgjdqWEFTikjnKn-KTASq=E@mail.gmail.com>
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?

/Samuel Ytterbrink

2010/11/13 Evgeny Burzak <buzzilo at gmail.com>

> Hi,
> I have just published new Canvas stub for IE (based on flash).  I'm
> using it in another my project - Drawform, to make it working under
> IE.
> Drawform: http://burzak.com/proj/drawform/
> fxCanvas: http://burzak.com/proj/fxcanvas/
>
> So I have some remarks about Canvas spec.
>
> I faced some troubles when using default image data, because of in old
> Explorers used extremely ineffective memory manager, so that  I made
> some tests and figure out that fastest and less memory consumption is
> array with pixel colors encoded in 32-bit integer. Here is the test:
> http://burzak.com/proj/fxcanvas/tests/data-structure-comparison.html
>
> But , the test results looks  similar for all vendors! On average the
> difference in processing speed is about 2-3 times (five times in
> Firefox 4). This is due to the fact that loops take less time (width x
> height * 4 vs. width x height) and arrays with less elements take less
> memory.  Though I realize that main idea for data structure was
> simplicity, but in this case it seems simplicity is evil, not good.
>
> Another thing is reusable canvas path.  I've added experimental class
> CanvasPath and and some related methods to Canvas context.
> For example:
> var p = new CanvasPath() // I think first argument can be string from
> SVG "d" attribute
> p.moveTo(0, 0)
> p.lineTo(10, 20)
> ctx.beginPath()
> ctx.appendPath(p)
> ... and so on. If you are interested in it, I can describe my idea
> futher...
> This is quite useful thing, at least for me.
>
> Evgeny
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20101115/09800816/attachment.htm>
Received on Monday, 15 November 2010 04:15:01 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:28 UTC