W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2011

[whatwg] Canvas.getContext error handling

From: Glenn Maynard <glenn@zewt.org>
Date: Tue, 12 Apr 2011 19:32:45 -0400
Message-ID: <BANLkTi=RRBpCL8PV48C1f44AEtfNFavpnw@mail.gmail.com>
Based on some discussion[1], it looks like a clean way to handle the
"permanent failure" case is: If the GPU is blacklisted, or any other
permanent error occurs, treat "webgl" as an unsupported context.  This means
instead of WebGL's context creation algorithm executing and returning null,
it would never be run at all; instead, step 2 of getContext[2] would return

For transient errors, eg. too many open contexts, return a WebGL context in
the "lost" state as Kenneth described.

It was mentioned that the GPU blacklist can change as the browser runs.
That's supported with this method, since whether a context type is
"supported" or not can change over time.

Are there any cases where this wouldn't work?

(I'm not sure if or how webglcontextcreationerror fits in this.  It would
either go away entirely, or be wedged between steps 1 and 2 of getContext; I
don't know how WebGL would specify that.)

[1] http://krijnhoetmer.nl/irc-logs/whatwg/20110413#l-77

Glenn Maynard
Received on Tuesday, 12 April 2011 16:32:45 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:05 UTC