[cairo-bugs] [Bug 43064] stroke performance is super-linear in number of points in the path

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Nov 18 07:25:08 PST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=43064

--- Comment #3 from Oleg Bulatov <oleg at bulatov.mobi> 2011-11-18 07:25:08 PST ---
Drawing straight line between two points shouldn't depend on its background. I
I suspect drawing time for broken line O(N), where N = number of points. If it
O(N*sqrt(N)) or something like that, calling stroke and new_path after each
point will give O(N) if sublines approximently equal.

For range 1000..6000 dots it is true.

cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE); do not solve this problem.

This loop works faster for large N:
for (i = 1; i < n; ++i)
{
    cairo_new_path(cr);
    cairo_move_to(cr, (double)(i - 1) / n * WIDTH, data[i - 1]);
    cairo_line_to(cr, (double)i / n * WIDTH, data[i]);
    cairo_stroke(cr);
}

What do you mean by 'intersections'? If line has intersection, then it should
be darker here.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.


More information about the cairo-bugs mailing list