[whatwg] Canvas size and double buffering.

Boris Zbarsky bzbarsky at MIT.EDU
Wed Feb 3 07:59:58 PST 2010

On 2/3/10 9:05 AM, Tim Hutt wrote:
> 1. You can only set the size exactly in pixels. It is very hard to get
> a resizable canvas that fills the page. You *can* set the size in CSS,
> but it doesn't work very well (e.g. using left,right-margin: auto; to
> centre the canvas doesn't work. Also it scales the canvas rather than
> resizes it.

That's right, because resizing the canvas (as in, changing the number of 
pixels in the backing store) involves clearing it at the moment.  Your 
proposal would mean that if the user changes the window size your canvas 
will immediately get cleared.  Is that what you're after?  If not, how 
do you envision the backing-store resize being performed?

> 2. There doesn't appear to be any kind of double buffering capability.
> This is pretty critical for animations where you might need to clear
> the canvas and then draw stuff. You currently get flickering if you
> try.

You do?  Under what circumstances?  At least in Gecko, run-to-completion 
means that while you script is running the canvas won't be painted. 
What UAs are you seeing flicker in, and under what circumstances?


More information about the whatwg mailing list