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

[whatwg] [canvas] request for {create, get, put}ImageDataHD and ctx.backingStorePixelRatio

From: Glenn Maynard <glenn@zewt.org>
Date: Tue, 20 Mar 2012 17:36:05 -0500
Message-ID: <CABirCh9=Z2RqY7_5Pp_7VXcj1wDB7jZp10oaV-qmD0DNwjYWsQ@mail.gmail.com>
On Tue, Mar 20, 2012 at 2:08 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:

> That would indeed be very nice.  The question is what happens if drawing
> happens after the getImageData call...  Or for that matter after the
> putImageData call (though I suspect there's less need for putImageData to
> be async).
>

The drawing calls that happen after would need to be buffered (or otherwise
flush the queue, akin to calling glFinish), so the operations still happen
in order.

putImageData being async makes sense, too, for the same reason: it avoids
having to flush drawing commands earlier in the queue, which helps keep
putImageData from blocking.  It's a bit trickier, though: what happens if
the argument passed to putImageData is modified before it's written?  You'd
either need a mechanism to detect changes, so you can make a copy (eg. a
copy-on-write mechanism for ArrayBuffer--though that sort of sounds useful
in its own right), or to just say that any changes to made to the buffer
before the async operation completes will be reflected in the copy.

-- 
Glenn Maynard
Received on Tuesday, 20 March 2012 15:36:05 UTC

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