[cairo] multiple paths
control.h at gmail.com
Mon Nov 5 11:55:46 PST 2007
> Normally, you should go ahead and write the code the easiest way
> possible. Then if it's slow, profile it and find a bottleneck and
> optimize that. This kind of assumption you are making most probably
> falls in the premature-optimization zone.
Which in this case will be: just go through the list 3 times, 2 times
forward and 1 time backwards.
> > I was thinking of a solution like this: make 3 cairo paths. For every
> > x_i, line_to in path1, line_to(i,x_i - variance_x_i) in path2 and
> > line_to (i,x_i + variance_x_i) in path three. At the end, stroke
> > path1, reverse path3, concat path3 to path2 and close path2, stroke
> > path2.
> I'd say build path1, path2, and path3, then just stroke them, and fixup
> anything on the sides if you need. Avoid the reversing.
Maybe I didn't really make it clear because I said "stroke path2", but
I really meant fill path2. I want the upper path and the lower path
(path2 and path3 resp.) be connected to each other so that I can fill
the area they cover. The problem is that when I don't reverse path3,
the concatenated path2,3 will self intersect, therefore it will not
Anyway, I thought maybe there's just some neat trick to do this in
cairo, but I understand there isn't. No problem, I'll just go
backwards through the list myself.
ps Comment to the developers: I really like the fact that you can also
render to pdf!
More information about the cairo