[Public WebGL] using the same context with multiple canvases

Florian Bösch [email protected]
Tue Dec 18 12:45:30 PST 2012


On Tue, Dec 18, 2012 at 8:13 PM, Ian Hickson <[email protected]> wrote:

> And then if you want to draw to a canvas instead of an off-screen buffer,
> you just use a Canvas instead of a DrawingBuffer.

So we're gonna get a document.createElement('canvas', {antialias:true,
alpha:false, depth:false}) ?


> I don't know why you have to specify them at all. :-)
>
Because additional functionality that you do not need (such as alpha
compositing, depth buffers, anti-aliasing, stenciling etc.) #1 occupy
memory #2 slow things down.


> Why would a canvas (not context, you've explained why a context may wish
> to paint to different surfaces differently, e.g. to have an area with AA
> and an area without or something) ever need to have its settings changed?
>
You're not drawing the same thing. You're re-using expensive resources
(such as vertex buffers, textures etc.) or using computed resources (RTTs)
to draw different aspects of your application onto different surfaces.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20121218/de8f0cf0/attachment.html>


More information about the public_webgl mailing list