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

Re: [Public WebGL] Bug in context-lost.html conformance test: getContextAttributes should not return null



Sorry for the delay replying; was swamped.

After giving this more thought, I would like to change
getContextAttributes to return "WebGLContextAttributes?", and define
that the context returns null for this value while in the context lost
state. The "actual context parameters" are associated with the drawing
buffer, and there is no drawing buffer while the context is in the
lost state. I agree with Gregg's assessment that there's no reasonable
value to be returned in some situations.

Some months ago there was a plan to add an asynchronous context
creation bit to the WebGLContextAttributes; when set, the context
would be created in the lost state and have a webglcontextrestored
event fired at it in the future. I think it would still be a good idea
to add this API, but at this point I would really like to stabilize
the top of tree conformance suite, and take another snapshot of it and
the improved spec as "version 1.0.2", before forging ahead with more
API additions.

To be concrete: are there any objections to making the return value of
getContextAttributes nullable?

-Ken


On Thu, Oct 25, 2012 at 11:29 AM, Gregg Tavares (社用) <gman@google.com> wrote:
> Yes, we can actually. Ideally we can call
>
> var gl = canvas.getContext("webgl");
>
> and the context is already lost.  isContextLost() returns true and the
> contextlostevent will be delivered once the current event exits
>
> Note, the samples on the WebGL wiki and the ones on
> webglsamples.googlecode.com all handle this case.
>
> That does bring up a good point as to why getContextAttrbutes should maybe
> return null during contextlost. I know that sucks though since you have to
> be defensive about accessing it but I don't know what it could report since
> there is no context to give attributes about.
>
>
>
> On Thu, Oct 25, 2012 at 11:05 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
>>
>>
>> On 10/25/12 1:38 PM, Gregg Tavares (社用) wrote:
>>>
>>> Off the top of my head I'd say returning the lost context's attributes
>>> is fine?
>>
>>
>> Can we never be in a lost-context state without having created a context
>> at any point?
>>
>>
>> -Boris
>>
>> -----------------------------------------------------------
>> You are currently subscribed to public_webgl@khronos.org.
>> To unsubscribe, send an email to majordomo@khronos.org with
>> the following command in the body of your email:
>> unsubscribe public_webgl
>> -----------------------------------------------------------
>>
>

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------