W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

Re: exposing CANVAS or something like it to Web Workers

From: Charles Pritchard <chuck@jumis.com>
Date: Mon, 14 May 2012 13:32:12 -0700
Message-ID: <4FB16BCC.3070704@jumis.com>
To: "Gregg Tavares (勤)" <gman@google.com>
CC: Web Applications Working Group WG <public-webapps@w3.org>
On 5/14/2012 1:01 PM, Gregg Tavares (勤) wrote:
> I'd like to work on exposing something like CANVAS to web workers.
> Ideally how over it works I'd like to be able to
> *) get a 2d context in a web worker
> *) get a WebGL context in a web worker
> *) download images in a web worker and the images with both 2d 
> contexts and WebGL contexts
> Any thoughts?

As far as implementation, I'd love to be able to pass webkit's 
document.getCSSCanvasContext('2d') around.
It seems like a safe place to experiment.

I can get a lot done with CanvasPattern as a transferable, without 
needing to add Image (or video) into the worker context.

1. getCSSCanvasContext is non-standard. It works with CSS image 
2. I heard that a more generic "-moz-element()" paint server is supposed 
to replace -webkit-canvas in time.
3. Passing the CSS canvas context would let me render off-frame and 
update a canvas visible on the document automatically.

Canvas -should- have toBlob and a typed array buffer for ImageData.
They are both useful for passing image data back to the main frame.

 From my experience with WebGL, I think it should be considered with 
added care and lower priority.
There are stability, speed and memory issues. WebGL in workers seems to 
augment 2d, are there other big benefits?

Received on Monday, 14 May 2012 20:32:38 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 11 February 2015 14:36:58 UTC