On Fri, Dec 11, 2009 at 2:30 AM, Jeremy Orlow <span dir="ltr"><<a href="mailto:jorlow@chromium.org">jorlow@chromium.org</a>></span> wrote:<br><div class="gmail_quote"><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><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><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><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>
<br>Rob<br>-- <br>"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]<br>