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

Re: [Public WebGL] Re: Renaming "webglcontextlost" and friend (Was: [whatwg] Hardware accelerated canvas)



This sounds like a good change to the platform, and one which reflects
how graphics hardware will work in the foreseeable future.

I'm in favor of deprecating the WebGL-specific event types in favor of
ones used for all Canvas contexts. Backward compatibility could be
achieved by continuing to send the webglcontextlost/restored event
types if listeners are registered for those events but not the new
ones (presumably "contextlost"/"contextrestored"). If listeners are
registered for the new types, the user agent could stop sending the
old ones.

For WebGL it is desired to continue to have a detail message in the
event object, for debugging purposes if nothing else. Is that feasible
if the context lost/restored events are made generic?

-Ken


On Fri, Dec 14, 2012 at 5:00 PM, Benoit Jacob <bjacob@mozilla.com> wrote:
>
> That sounds fine (and I am all for this addition to Canvas 2D), but
> don't want to break existing WebGL applications --- especially not the
> few ones who were brave enough to implement support for handling these
> events.
>
> Renaming WebGLContextEvent should be fine --- I don't expect that
> real-world code would be affected by that, right? I am more concerned
> about renaming "webglcontext{lost,restored}". To avoid breaking code, we
> would have to keep generating events under the old names, alongside the
> events under the new name. That sounds acceptable though, especially as
> these events aren't supposed to be fired very frequently.
>
> Benoit
>
> On 12-12-14 06:41 PM, Ian Hickson wrote:
>> This is a question for WebGL in the context of some changes we need in the
>> 2D space:
>>
>> So long story short, there are cases where, however hard we try, hardware
>> is going to abandon us and clear the 2D canvas state.
>>
>> WebGL fires a "webglcontextlost" event (using a WebGLContextEvent object,
>> though its one special attribute is not used for this event) when the
>> context is lost, and then a "webglcontextrestored" event when the hardware
>> comes back from lunch (same deal with the event object).
>>
>> It seems like it'd be good if we could reuse that for 2D, ideally though
>> without the "webgl" prefix and just using a regular Event object rather
>> than WebGLContextEvent. If we do that, it'd be ideal if we could also
>> change WebGL to be consistent with the more generic terms and similarly
>> use regular Event objects. Is that possible?
>>
>
>
> -----------------------------------------------------------
> 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
-----------------------------------------------------------