W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2009

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

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sun, 06 Sep 2009 11:11:36 -0400
Message-ID: <4AA3D128.6080708@mit.edu>
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
Received on Sunday, 6 September 2009 08:11:36 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:52 UTC