Thank you Carl and Vlad for your helpful explanations. I'm also very impressed with the general activity on the mailing list.<br><br>After reading your explanations, a lot of issues I've been noticing (in addition to the ones I previously mentioned) make more sense. I am indeed doing a lot of drawing at non-integer pixel values. It is a bit troubling to hear that there isn't really an easy solution at this point, but it seems I could do the following things to improve performance:<br>
<br>1. Before doing any drawing, translate the entire surface by .5 pixels horizontally and vertically so that even integer values land on the boundaries between pixels and not in the middle of pixels. Also, I should use only integer values for line widths.<br>
<br>2. Break long diagonal lines up into smaller diagonal lines so that the overall needless computation is lowered.<br><br>Any other ideas? Should I keep antialiasing off? Is it worth updating from 1.8.0 to the most recent 1.8.2 with respect to these issues?<br>
<br>Thanks again for your help!<br><br>Giles<br><br><br><div class="gmail_quote">On Fri, Oct 31, 2008 at 1:03 PM, Carl Worth <span dir="ltr"><<a href="mailto:cworth@cworth.org">cworth@cworth.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Fri, 2008-10-31 at 12:41 -0700, Vladimir Vukicevic wrote:<br>
> But since you're hitting the general case, the first thing that happens<br>
> is that a large temporary surface big enough to encompass the set of<br>
> trapezoids to be rendered is created -- in your case somewhere around<br>
> 1200 x 950. The trapezoids are rendered to that, and then that surface<br>
> is used as a mask for the final filling operation. You can see the<br>
> problem -- that's a large surface, and you're both rendering to it and<br>
> then compositing with it, not to mention creating/destroying it just to<br>
> execute that simple stroke!<br>
<br>
</div>Ah, of course. Thanks for explaining that Vlad.<br>
<div class="Ih2E3d"><br>
> For the diagonal case, it's not possible to optimize it as rectangular<br>
> fills, so you end up creating the large temporary surface which can<br>
> contain the entire diagonal line (which is essentially the worst case<br>
> scenario).<br>
><br>
> big-diagonal-lines would actually make a great perf test...<br>
<br>
</div>Yes, we definitely need to do better on that. Even without a big change<br>
to the rasterizer it should be obvious that even just breaking up the<br>
geometry into smaller segments would perform much better, (as the<br>
smaller intermediate masks would no longer include large regions of<br>
useless compositing). So we should start tracking this in cairo-perf and<br>
see what we can do to make this case faster in cairo itself, (without<br>
the application needing to slice up its geometry in silly ways).<br>
<font color="#888888"><br>
-Carl<br>
<br>
</font></blockquote></div><br>