[whatwg] <canvas> and high-density displays

Glenn Maynard glenn at zewt.org
Mon Sep 24 17:41:32 PDT 2012

On Mon, Sep 24, 2012 at 6:40 PM, Ian Hickson <ian at hixie.ch> wrote:

> We could add an event that fires on ImageData (or even ArrayBuffer) that
> fires when the data is available. If we add it to ArrayBuffer it's
> something that could be used in other contexts, too.
> Is this something that people think we should do? If so, should we add it
> to TypedArray generically?

If it's done this way, a nonblocking function may be needed to request that
the event be fired, without the blocking side-effects of actually
performing a pixel read.  Otherwise, implementations that don't perform the
readback at all until it knows it's really needed (eg. that it can't be
done with an in-GPU blit) would simply never fire the event at all.
Passing in a callback probably makes more sense this way than having it
request that an event be fired.

That would also allow waiting for readability without knowing in advance
whether the event was already fired or not, which would be important eg. if
you just received the ArrayBuffer in a message. (An attribute could do this
as well, but that might be more prone to developer error.)

Glenn Maynard

More information about the whatwg mailing list