Replace point sampling in the fill-degenerate-sort-order with rendering.

Clean up the test to not even check the ps backend as per:

http://lists.freedesktop.org/archives/cairo/2006-December/008806.html
This commit is contained in:
M Joonas Pihlaja 2006-12-07 01:42:07 +02:00
parent 565a715d11
commit c13a1a2ed0
4 changed files with 6 additions and 29 deletions

View file

@ -69,6 +69,9 @@ static const char *vector_ignored_tests[] = {
"text-antialias-none",
"text-antialias-subpixel",
"unantialiased-shapes",
/* Nor do we care about rendering anomalies in external renderers. */
"fill-degenerate-sort-order",
NULL
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 611 B

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -47,22 +47,9 @@ cairo_test_t test = {
/* Derived from zrusin's "another" polygon in the performance suite. */
static cairo_test_status_t
draw (cairo_t *cr_orig, int width, int height)
draw (cairo_t *cr, int width, int height)
{
/* XXX: I wanted to be able to simply fill the nasty path to the
* surface and then use a reference image to catch bugs, but the
* renderer used when testing the postscript backend gets the
* degeneracy wrong, thus leading to an (unfixable?) test case
* failure. Are external renderer bugs our bugs too? Instead,
* tessellate the polygon and render to the surface the results of
* point sampling the tessellated path. If there would be a way
* to XFAIL only some backends we could do that for the .ps
* backend only. */
int x,y;
int sample_stride;
cairo_surface_t *surf = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
cairo_t *cr = cairo_create (surf);
cairo_set_source_rgb (cr_orig, 1, 0, 0);
cairo_set_source_rgb (cr, 1, 0, 0);
/* The polygon uses (43,103) as its "base point". Closed
* subpaths are simulated by going from the base point to the
@ -86,21 +73,8 @@ draw (cairo_t *cr_orig, int width, int height)
cairo_line_to (cr, 176, 110);
cairo_close_path (cr);
cairo_fill (cr);
/* Point sample the tessellated path. The x and y starting offsets
* are chosen to hit the nasty bits while still being able to do a
* relatively sparse sampling. */
sample_stride = 4;
for (y = 0; y < height; y += sample_stride) {
for (x = 0; x < width; x += sample_stride) {
if (cairo_in_fill (cr, x, y)) {
cairo_rectangle(cr_orig, x, y, sample_stride, sample_stride);
cairo_fill (cr_orig);
}
}
}
cairo_destroy (cr);
cairo_surface_destroy (surf);
return CAIRO_TEST_SUCCESS;
}