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

Glenn Maynard glenn at zewt.org
Mon Apr 23 18:50:56 PDT 2012


On Mon, Apr 23, 2012 at 12:43 PM, Darin Fisher <darin at chromium.org> wrote:

> That said, I've come around to being OK with getImageDataHD.  As I wrote
> recently, this is because it is possible to implement that in a
> non-blocking fashion.  It can just queue up a readback.  It only becomes
> necessary to block the calling thread when a pixel is dereferenced.  This
> affords developers with an opportunity to instead pass the ImageData off to
> a web worker before dereferencing.  Hence, the main thread should not jank
> up.  This of course requires developers to be very smart about what they
> are doing, and for browsers to be smart too.
>

It's reasonable to expect users to use async APIs in the main thread;
that's just a part of the platform.  It's not reasonable to expect people
to fire up a worker and transfer the buffer to the worker to prevent the
blocking from happening in the main thread.  That's a particularly hackish
workaround, not a replacement for an async API.

-- 
Glenn Maynard



More information about the whatwg mailing list