Re: Hit regions and WebGL...

What's the equivalent of a path in WebGL? Is that even a concept that
exists now or is it something we'd have to define?

On Tue, Apr 12, 2016 at 1:54 PM Justin Novosad <junov@google.com> wrote:

> It was recently pointed out in another thread that there is a lack of
> consideration for WebGL use cases in the design of the canvas hit region
> APIs.
>
> I would like to reboot the discussion on this mailing list where much of
> the discussions on the hit regions spec has taken place in the past.
>
> Three issues with the current spec:
>
>    1. The API methods are on the CanvasRenderingContext2D (no WebGL).
>    They could be either moved to HTMLCanvasElement, or moved to a
>    sub-interface that is implemented by both CanvasRenderingContext2D and
>    WebGLRenderingContext (and any other place they're wanted)
>    2. There is a dependency on the current path and current transform of
>    the 2d rendering context. That information could be passed in as
>    HitRegionOptions fields instead. Also, passing the transform as a DOMMatrix
>    would allow general 3D transforms to be applied, which would be desireable
>    for WebGL. In the whatwg edition of the spec, there is already a 'path'
>    field in HitRegionOptions that takes a Path2D object (another whatwg-ism).
>    3. (Not related to WebGL) The event processing model is inconsistent
>    with other APIs.  That part of the spec should probably be re-written to
>    re-use existing platform features. For example, hit regions could be
>    ordinary event targets. Also, the 'region' event member name is perhaps too
>    generic.
>
> AFAIK, no browsers have yet shipped any hit region APIs, so there is still
> an opportunity to make major changes without breaking the Web.  Shipping in
> Chrome is possibly imminent, but we are almost certainly going to put it on
> hold to take the necessary time resolve the issues mentioned above.
>
> Thoughts?
>
>     -Justin
>
> P.S.: Original thread was in a whatwg issue, here:
> https://github.com/whatwg/html/issues/1030
>

Received on Tuesday, 12 April 2016 23:20:34 UTC