W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2009

[whatwg] "offscreen canvas" /Access to canvas functionality from a worker

From: Jonas Sicking <jonas@sicking.cc>
Date: Fri, 11 Dec 2009 00:49:42 -0800
Message-ID: <63df84f0912110049y2ac5ae1fr628906630ad4d667@mail.gmail.com>
On Thu, Dec 10, 2009 at 1:36 PM, Oliver Hunt <oliver at apple.com> wrote:
> Ideally if we were to have a graphics context in a worker we'd want it to be
> the standard CanvasRenderingContext2D, the only real problem is that
> CanvasRenderingContext2D references the parent canvas element which clearly
> won't fly in a worker.
> I've been thinking of creating something like a WorkerCanvas which is
> basically a DOM-less CanvasRenderingContext2D, so you can do
> var canvas = new WorkerCanvas(width, height);
> canvas.putImageData(myData);

Do you really need all of CanvasRenderingContext2D? I.e. do you really
need things like spline drawing, pattern filling, and text?

My concern weather the libraries backing CanvasRenderingContext2D are
generally threadsafe?

The use case brought up at the beginning of this thread was about
scaling. It would be dramatically easier to implement just a few
things like transformations, cropping and encoding/decoding, than to
implement all of CanvasRenderingContext2D off the main thread.

/ Jonas
Received on Friday, 11 December 2009 00:49:42 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:54 UTC