News for hackers. Stuff that matters.
Re:Why I Develop For The Mac by stevejohnson on Sunday May 05, 2013 @02:29PM (#5659229)
Technical reasons aside, the canvas tag is still orders of magnitude slower than writing Core Graphics by hand. Personally I'd say almost unacceptably slow, but YMMV.

You succeeded in picking out a minor technical inaccuracy, but not in addressing the point the author was making about rendering performance.

Re:Why I Develop For The Mac by ccgus on Sunday May 05, 2013 @04:32PM (#5659635)
One of the reasons it's slow is because CG bitmap contexts are pre-multiplied, but the Canvas spec requires things to be not-premultiplied, so there's a bit of extra math that needs to happen w/ Canvas vs. straight CG/Quartz.
Re:Why I Develop For The Mac by daeken on Sunday May 05, 2013 @06:42PM (#5660069)
> the Canvas spec requires things to be not-premultiplied

It does, but unfortunately neither Webkit nor Gecko respect this. Take a PNG with an alpha channel and draw it to a canvas over a white div then read back the pixels; you get the pixels premultiplied by the white behind it. Same with other backing colors. There are cases where it won't premultiply, but unfortunately they're a minority.

(The reason I ran across this particular case is that I use PNGs to compress data, and using the alpha channel to store data is impossible because of the premultiplication.)