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

Re: [Public WebGL] using the same context with multiple canvases

On 11/10/12 10:57 PM, Ian Hickson wrote:
Look at this test (warning, has a loop with 10000 getImageData/drawImage
calls, so can take a long time to render):


Between the time that the timeout fires and the time the timeout ends,
which should hopefully be noticeable unless your computer is quite new
(in which case just up the iteration count, thanks!), you can see the
canvas on the screen is still completely transparent, but the bitmap of
the canvas/context itself (they're shared in this case) is clearly not
showing the same thing, since after the loop has finished, you see two
squares, despite only one having been drawn -- the second is a copy from
this "off-screen" buffer to itself.

Sure. So there is an off-screen buffer that's acting as the canvas backing store. The point is that continuing to paint a transparent canvas on-screen in this case does not require a second buffer the size of the backing store. It only requires a buffer the size of the part of the backing store that was visible the last time layout got updated, since presumably the expectation is that there should be no layout or other updates making their way to the screen during the loop on your test.


----------------------------------------------------------- You are currently subscribed to public_webgl@khronos.org. To unsubscribe, send an email to majordomo@khronos.org with the following command in the body of your email: unsubscribe public_webgl -----------------------------------------------------------