[cairo] Tessellator regressions

M Joonas Pihlaja jpihlaja at cc.helsinki.fi
Tue Dec 5 18:54:00 PST 2006

Hi Carl & list,

On Tue, 5 Dec 2006, Carl Worth wrote:

[snip lots]
[snip code that creates a temporary surface and point samples
> Same thing here. It looks really weird to be creating a new target
> surface in a test, (since one of the primary purposes of the test
> suite is to test the same code across all backends).

Right, makes sense.  I was wondering about this also in this test
case which checks cairo_in_fill(), but the thing under test is
really a part of the tessellator output.  It's not supposed to be
exercising the rasterisation of any backends at all, really,
since cairo_in_fill() is always implemented currently as
"tessellate, then loop over trapezoids checking for the point."
I suppose that could change some day, though.

The first test case that does point sampling is similar in the
sense that it also is triggering a bug in the tessellator, and
not in the backends.  But then, it's a little different in that
all backends really ought to be able to produce the same output
even without the point sampling, even if they were given
degenerate trapezoids, IMHO.  Having said that, the right thing
to do is to not let degenerate trapezoids escape from the
tessellator in the first place.

> > +     * What it looke like with the bug, when the rightmost edge's end
> > +     * is missed:
> > +     *
> > +     * |\    |\
> > +     * |#\   |#\
> > +     * |##\__|##\
> > +     *     \#####|
> > +     *      \####|
> Oops. Nice catch. Thanks.

Heh.. that's my bad actually.  Deferred trapezoid generation
broke this case. :-}

> > +	     * respect ordering.  Currently it doesn't though, since
> > +	     * CAIRO_BO_GUARD_BITS is zero.) */
> I'm confused here. If we're making CAIRO_BO_GUARD_BITS 0, then why are
> we preserving all this ugly code? Why don't we just throw away
> anything that mentions the guard bits?

OK, you caught me.  I was hoping to sneak past a version that
would let me test the whole guard bits thing in my own time
later. :)

> Anyway, I hope that's helpful. I think I feel pretty comfortable with
> all of these going in as-is except for this last one.

Yes, thanks, they're very helpful.  I'll fix the last commit and
do the remaining fixes for the earlier commits tomorrow.



More information about the cairo mailing list