[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] WebGL back buffer contents

On Wed, Jan 27, 2010 at 11:10 AM, Oliver Hunt <oliver@apple.com> wrote:

On Jan 27, 2010, at 11:08 AM, Gregg Tavares wrote:

Just for clarity are we referring to the buffer size changing, or the display size changing?

eg. changing canvasElement.width/height vs canvasElement.style.width/height

To remain in keeping with CanvasRenderingContext2D behaviour, changing display size should not
have any impact at all on the graphics state, although given that can happen non-programmatically
we may want an event?

How does this happen non-programmatically?

<canvas style="width:50%"></canvas>
Then the element resizes with the browser window.

That doesn't change the size of the backbuffer, it only changes the size the backbuffer is displayed at on the screen. That exact example would give you 300x300 pixel backbuffer which is then scaled to fit whatever size the it needs to be scaled to for size of that element on the page. As it scales the backbuffer would say 300x300 pixels.

The size of the backbuffer can only be set 2 ways

<cavnas width="100" ...>

canvas.width = 100;
Neither of those settings can be a percent.