[cairo] perf: long dashed lines

Vladimir Vukicevic vladimir at pobox.com
Fri Feb 1 12:28:32 PST 2008

On Jan 31, 2008, at 5:06 PM, Jeff Muizelaar wrote:

> On Thu, Jan 31, 2008 at 12:07:58PM -0800, Vladimir Vukicevic wrote:
>> Any thoughts on where we could optimize this?  The complex thing  
>> seems
>> to be in making sure that the dash pattern starts at the right point
>> when the path is visible again.
> I guess you could just check in _cairo_stroker_line_to_dashed whether
> you were sufficiently outside of the clip and then switch to just
> iterating through the dash array till you're back inside. That should
> eliminate the compute_face overhead. It's certainly doable, however,  
> it
> would almost certainly make the code messier.

Yep, that's the eventual solution I was thinking of.  I'm looking at  
hoisting a bunch of floating point arithmetic/sqrts up as well, as  
behdad suggested.

> Out of curiosity, in what situation are you getting these long  
> dashed lines?

Long webpage, with a dotted/dashed border around the entire thing.   
Wikipedia does this, among many other pages.  See https://bugzilla.mozilla.org/show_bug.cgi?id=379834 
  for some HTML testcases.

     - Vlad

More information about the cairo mailing list