[whatwg] Any chance for Double Buffering in the <canvas>?

Boris Zbarsky bzbarsky at MIT.EDU
Sun Sep 6 08:11:36 PDT 2009


Marius Gundersen wrote:
> I've been playing around with the canvas element, making a 3D engine. It 
> works, but is incredibly slow. Part of the reason is probably that the 
> browser renders the canvas everytime I draw something to it.

Depends on what I mean by "renders".  Anything you draw to the canvas is 
rasterized (converted to pixel information from the vector instructions 
you give the canvas) immediately.  It's not actually painted to the 
screen until sometime later; certainly not before your JS finishes 
executing.

Not having seen your code, I would bet that your issue is doing lots and 
lots of tiny paint operations that involve a good bit of rasterization 
overhead...  If your code is publicly available, I can probably give you 
more specific details than that if you point me to it.

-Boris



More information about the whatwg mailing list