[cairo] Backend API composite_trapezoids question
persquare at mac.com
Wed May 2 00:12:51 PDT 2007
On Fri, 27 Apr 2007 Carl Worth wrote:
>But with cairo_stroke, the tessellator isn't involved at all, and
>instead a linear-time algorithm simply walks the path and emits
>trapezoids as it goes.
>I did write a version of cairo_stroke that computes the polygon of the
>stroke, and then calls the tessellator on that to generate a list of
>non-intersecting trapezoids. But that slows things down without much
>benefit in most cases.
Out of curiosity, was that code ever pushed to the repository or available as a patch?
In case I end up fiddling with tessellation it would be nice to have for reference.
>> If so, some post-processing of the trapezoids is obviuosly required
>> and I'd be happy if anyone could provide me with pointers to some
>> reasoning how this is supposed to work.
>What the other cairo backends do here is that they render the set of
>trapezoids to a single mask, and the composite with that mask.
OK, that makes sense.
>That avoids the large problems you're seeing, (though it does
>introduce single-pixel errors when the path intersects itself).
>Would such an approach seem reasonable with your backend?
Most likely, but it would be interesting to compare to a tessellation approach.
>If not, you'll need to investigate changing the way cairo works here.
>I hope that helps---and I hope you're having fun with cairo.
It helps a lot, and yes, I'm enjoying myself :-)
More information about the cairo