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

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



On Tue, Dec 18, 2012 at 8:13 PM, Ian Hickson <ian@hixie.ch> 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.