W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2012

Re: [whatwg] isPointInPath v. set of pixels in canvas hit regions

From: Charles Pritchard <chuck@jumis.com>
Date: Thu, 5 Jul 2012 13:32:38 -0700
Message-Id: <1A0C159D-F1DD-493E-B3C0-A9BC697A9B44@jumis.com>
To: Edward O'Connor <eoconnor@apple.com>
Cc: "whatwg@lists.whatwg.org" <whatwg@lists.whatwg.org>

On Jul 5, 2012, at 1:05 PM, Edward O'Connor <eoconnor@apple.com> wrote:

> Hi,
> As things currently stand in the spec, implementations basically need to
> keep N+1 bitmaps per canvas, where N is the number of hit regions. I
> doubt any implementors would be enthusiastic to implement hit regions
> like this. From a WebKit perspective, we'd much prefer keeping a Path
> for each hit region, and then simply using isPointInPath for hit
> testing. This also implies that the current piggybacking of "Clear
> regions that cover the pixels" in clearRect() could go away. Yay! :)

I couldn't agree more.

The hit testing code from SVG in WebKit could easily be reused by the Canvas implementation.

I believe the rationale for bitmap backing was based on an assumption that it would be easier for authors. I've consistently argued against this assumption.

Received on Thursday, 5 July 2012 20:33:10 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:43 UTC