[whatwg] canvas, img, file api and blobs

Stefan Haustein haustein at google.com
Tue Feb 16 09:25:28 PST 2010

On Tue, Feb 16, 2010 at 5:09 PM, Stef Epardaud <stef at epardaud.fr> wrote:

> On Tue, Feb 16, 2010 at 11:39:31AM -0500, Joel Webber wrote:
> >    And in particular, does it bear any resemblance to the WebGLArray
> >    interfaces, as proposed in
> >    ([3]http://people.mozilla.com/~vladimir/jsvec/TypedArray-spec.html)?
> I'm
> >    particularly concerned with the interfaces among all these different
> >    subsystems (WebGL, Canvas, XHR, File, etc., as being discussed on this
> >    thread) that want to operate on binary data.
> >    We've found that getting data from XHR to WebGL via WebGLArrays to be
> a huge
> >    (read: probably orders-of-magnitude) bottleneck; but being able to
> slice
> >    mesh and texture data out of arrays directly from XHR responses would
> >    completely fix this.
> The TypedArray proposal seems to lack a way to efficiently copy ranges
> of bytes from one array to another. This is essential if we want to
> resize arrays (which is going to be needed if we want to add EXIF data
> to an image for example). Copying byte by byte would be unacceptable.
> It is mentioned in section 5, but a proposed solution is a constructor,
> which is a bit restrictive (how would we concatenate two byte arrays?)

The WebGL spec has a corresponding set method (see

set(array, offset)

Set multiple values, reading input values from the array. The optional
offset value indicates the index in the current array where values are
written. If omitted, it is assumed to be 0.

If the offset plus the length of the given array is out of range for the
current WebGLArray, an exception is raised.
Not sure why this was omitted in Vladimir's version...

> --
> Stéphane Epardaud

Stefan Haustein
Google UK Limited

Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W
9TQ; Registered in England Number: 3977902
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100216/f7532c5c/attachment-0002.htm>

More information about the whatwg mailing list