<div class="gmail_quote">On Fri, Dec 11, 2009 at 10:29 AM, Robert O'Callahan <span dir="ltr"><<a href="mailto:robert@ocallahan.org">robert@ocallahan.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Fri, Dec 11, 2009 at 2:30 AM, Jeremy Orlow <span dir="ltr"><<a href="mailto:jorlow@chromium.org" target="_blank">jorlow@chromium.org</a>></span> wrote:<br></div><div class="gmail_quote"><div class="im">

<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
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.</blockquote>


</div><div><br>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.<br>


<br></div><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div class="gmail_quote"><div>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.</div>




</div>
</blockquote></div></div><br>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...<br>

</blockquote><div><br></div><div>Good point.  Maybe that could be in a future version if it proved itself useful.</div></div>