W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2011

Re: Using ArrayBuffer as payload for binary data to/from Web Workers

From: Glenn Maynard <glenn@zewt.org>
Date: Mon, 7 Mar 2011 20:55:49 -0500
Message-ID: <AANLkTikrP2u3o5zyWGHdKzb+DLo0x+AxoVVRrJSn+OPu@mail.gmail.com>
To: Chris Marrin <cmarrin@apple.com>
Cc: Web Applications Working Group WG <public-webapps@w3.org>
On Mon, Mar 7, 2011 at 8:04 PM, Chris Marrin <cmarrin@apple.com> wrote:

> > Probably not the only one, but check the "WebWorkers and images" thread
> on whatwg.
> Yeah, I thought about that case. The extra complication there is that
> images are rendering resources, which muddies the issues some. If the 2D
> Canvas API were able to use ArrayBuffer data as an image source like WebGL
> can, then we could kill 2 birds with one stone. Pass the ArrayBuffer to the
> worker and have it generate some image data, then pass it back and render it
> to a canvas. You could even split the array buffer into tiles and have
> multiple workers operate on the tiles.

I'd expect CanvasPixelArray to allow optimizations that ArrayBuffer doesn't,
since the implementation can use the native surface format, translating to
RGBA for the script transparently.  This can matter for streaming textures
to OpenGL/D3D, too; creating BGRA textures on nVidia hardware is typically
much faster than RGBA ones.

I don't recall if this has been brought up: are there cases where explicit
zero-copy messaging is better than transparent copy-on-write?

Glenn Maynard
Received on Tuesday, 8 March 2011 01:56:22 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:16 UTC