[cairo] Stroke vs. fill for rectilinear figures

Benjamin Berg benjamin at sipsolutions.net
Sun Nov 19 14:42:55 PST 2006


On Fri, 2006-17-11 at 19:56 -0800, Carl Worth wrote: 
> I am curious to know how often this bug is getting hit. I would
> imagine that rectilinear elements like this are extremely common. But
> when I mentioned this bug to Owen once he said that GTK+ (in the
> default theme at least) doesn't actually use cairo for drawing box
> outlines. But for other themes, who knows?
> 
> I know some theme authors have definitely hit this bug, since they're
> the ones who originally pointed it out to me.

This problem gets hit all over the place. Themes like ThinIce, Redmond,
Mist and Glider that are rectangular mostly of course see the largest
overall improvement. But also other like Clearlooks and Crux benefit in
some cases.

There is a benchmark available at
http://benjamin.sipsolutions.net/theme-perf/stroke-vs-fill/
(G4 1.6GHz, test run inside Xvfb)

Some examples from the benchmark:
Theme            Test                       before    after
Glider           button-box-normal-out       4.54ms    2.35ms
HighContrast     button-box-normal-out       0.71ms    0.96ms
Mist             button-box-normal-out       1.99ms    0.71ms
Redmond          button-box-normal-out       3.14ms    0.79ms
ThinIce          button-box-normal-out       1.96ms    0.73ms
Clearlooks       notebook-box               36.12ms   26.08ms
Crux             notebook-box               34.68ms    5.97ms
Glider           notebook-box               45.07ms    4.36ms

As you can see there are some pretty good improvements. In particular
the Glider notebook box is about 10x faster in this benchmark.
It is also interesting to see is that the performance of the
HighContrast theme was good before the change, and even seems to
decrease slightly. I guess this is because the line width in the theme
is 2px, so the pixel coordinates are also aligned for the stroke case.

Benjamin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20061119/bfe44c96/attachment.pgp


More information about the cairo mailing list