On Tue, Mar 20, 2012 at 2:08 PM, Boris Zbarsky <bzbar...@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