Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That the canvas API is implemented with OpenGL is very impressive. CocoonJS [1] (a similar project for Android, as noted in the comments below) seems to have taken the same approach.

On a completely tangential note, given that the main desktop browsers now sport hardware accelerated canvas implementations, is there a performance difference in 2D graphics rendered with canvas vs. WebGL?

[1] http://ludei.com/tech/cocoonjs



webgl can be much faster because you can draw many primitives with one call. there's a lot of overhead from js down to gl.


Then what is stopping browser vendors from implementing canvas directly in gl directly, making canvas more or less a wrapper?


Canvas is directly implemented in gl (or directx) in most browsers at this point. WebGL is still faster like the poster above says because you as the programmer an can make optimizations that are not possible with the canvas api like drawing many things with one call.

http://blog.tojicode.com/2012/07/sprite-tile-maps-on-gpu.htm...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: