On Nov 9, 2012, at 3:33 PM, Ian Hickson <firstname.lastname@example.org> wrote:
I've been looking at this in the context of the 2D context and cross-worker canvases.
Yes, putting this on Canvas would be more sane. My proposal was simply trying to avoid changes outside WebGL. My one issue with this approach is that having getContext() fail after setContext() is confusing. Really getContext() becomes a misnomer used this way. It is really createContext() or something similar. But since we can't change that, maybe we can create a new pair of calls:
context = canvas.getRenderingContext();
Then we could leave getContext() alone and use it for legacy purposes. But I agree that, in this scenario, getContext should fail if you've ever called setRenderingContext().