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

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




On Nov 10, 2012, at 12:14 PM, John Bauman <jbauman@chromium.org> wrote:

I guess one question is what is the pre-existing content of the drawing buffer when you switch to back to a canvas (and preserveDrawingBuffer=true)? Is it the same as what it was when you switched away from that canvas previously, the current contents of the drawing buffer (nothing changes), 0s, or something else?

preserveDrawingBuffer doesn't have to apply here. Today it applies to frame-to-frame preservation. But I think you've hit on the salient issue. If I create a context, not associated with a canvas, render to it, then associate it with a canvas, what happens? I can imagine implementations where you'd need to modify the drawing buffer once you know what canvas it will display to. But that's probably fine. Worst case you'd have to create a new drawing buffer when you attach to the canvas and copy the old drawing buffer to it.

I could imagine giving control over whether or not you want this behavior. But if we did that, I think it would be better to have a separate flag, "preserveDrawingBufferOnAttach" or something like that. There may be different criteria (and performance implications) for each case.

-----
~Chris Marrin
cmarrin@apple.com