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

Re: [Public WebGL] Help with the WebGL Context Lost specification

On Tue, Dec 6, 2011 at 8:30 PM, Gregg Tavares (wrk) <gman@google.com> wrote:
- EXT_lose_context needs to state that its two methods have explicit context lost handling, or else restoreContext will never work.

Can you be more specific?

EXT_lose_context should effectively do this

1) calling loseContext loses the context. The context will be lost immediately and the steps defined in 5.15.2 are followed except for "queue a task to restore the drawing buffer"
2) calling "restoreContext" "queues a task to restore the drawing buffer" which follows the steps in 5.15.2

If the extension doesn't add restoreContext to explicit context lost handling, then the implementation of restoreContext (restoring the context) will never be executed.  Since the context is lost when the function is called, section 5.14 will execute step 1.2 of the method entry steps ("Terminate this algorithm without calling the method implementation"), and the function will return without doing anything.

The extension just needs to say "loseContext() and restoreContext() are added to the list of functions with explicit context lost handling."

There might be a nicer way of doing this, maybe with a WebIDL extended attribute, eg. "[ExplicitContextLoss] void restoreLost();".  I'm not at all familiar with WebIDL, so I'm not sure if this is an intended use of extended attributes (or even if that's legal); this isn't really a language binding issue.

Glenn Maynard