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

Re: [whatwg] <canvas> and high-density displays

From: Glenn Maynard <glenn@zewt.org>
Date: Mon, 24 Sep 2012 19:41:32 -0500
Message-ID: <CABirCh9_rDG8Wyd=u50VrU_+zpB0_tAYjN+KfgS97-6Qkutwog@mail.gmail.com>
To: Ian Hickson <ian@hixie.ch>
Cc: whatwg@whatwg.org
On Mon, Sep 24, 2012 at 6:40 PM, Ian Hickson <ian@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
Received on Tuesday, 25 September 2012 00:44:35 UTC

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