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

Robert O'Callahan robert at ocallahan.org
Fri Dec 11 10:29:37 PST 2009


On Fri, Dec 11, 2009 at 2:30 AM, Jeremy Orlow <jorlow at chromium.org> wrote:

> CanvasRenderingContext2Ds would never need to be shared between threads
> because they're "cloned" when passed...so is your concern that the libraries
> are only meant to ever be used from one thread?  Maybe I'm being naive, but
> it would surprise me if that turned out to be an issue.


In Gecko we build cairo configured to only be usable from one thread. This
reduces locking overhead around global caches. We could change that
decision, but that would impose a small penalty on normal rendering, so it's
a trade-off.

Resizing images was just one use.  I could easily imagine apps wanting to
> generate more complex images on background threads without needing to
> implement things like spline drawing, pattern filling, and text themselves.
>

Drawing text on a worker thread means making CSS font parsing, associated
font objects, text shaping, and bidi processing all usable from multiple
threads. That would be a much bigger problem for us than the actual
drawing...

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20091211/1101ad90/attachment-0002.htm>


More information about the whatwg mailing list