Fix remaining tests
|
|
@ -196,7 +196,7 @@ typedef struct _cairo_svg_stream {
|
|||
cairo_array_t elements;
|
||||
} cairo_svg_stream_t;
|
||||
|
||||
cairo_svg_stream_t
|
||||
static cairo_svg_stream_t
|
||||
_cairo_svg_stream_create ()
|
||||
{
|
||||
cairo_svg_stream_t svg_stream;
|
||||
|
|
@ -205,7 +205,7 @@ _cairo_svg_stream_create ()
|
|||
return svg_stream;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
_cairo_svg_stream_write (cairo_svg_stream_t *svg_stream,
|
||||
const void *data,
|
||||
size_t length)
|
||||
|
|
@ -236,7 +236,7 @@ _cairo_svg_stream_write (cairo_svg_stream_t *svg_stream,
|
|||
_cairo_output_stream_write (last_element->text.output_stream, data, length);
|
||||
}
|
||||
|
||||
void CAIRO_PRINTF_FORMAT (2, 0)
|
||||
static void CAIRO_PRINTF_FORMAT (2, 0)
|
||||
_cairo_svg_stream_printf (cairo_svg_stream_t *svg_stream,
|
||||
const char *fmt,
|
||||
...)
|
||||
|
|
@ -270,7 +270,7 @@ _cairo_svg_stream_printf (cairo_svg_stream_t *svg_stream,
|
|||
va_end (ap);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
_cairo_svg_stream_append_paint_dependent (cairo_svg_stream_t *svg_stream,
|
||||
unsigned int source_id,
|
||||
enum cairo_svg_stream_paint_dependent_element_type type)
|
||||
|
|
@ -287,7 +287,7 @@ _cairo_svg_stream_append_paint_dependent (cairo_svg_stream_t *svg_stream,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
_cairo_svg_stream_copy (cairo_svg_stream_t *from,
|
||||
cairo_svg_stream_t *to)
|
||||
{
|
||||
|
|
@ -320,7 +320,7 @@ _cairo_svg_stream_copy (cairo_svg_stream_t *from,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
_cairo_svg_stream_copy_to_output_stream (cairo_svg_stream_t *from,
|
||||
cairo_output_stream_t *to,
|
||||
cairo_hash_table_t *paints)
|
||||
|
|
@ -378,7 +378,7 @@ _cairo_svg_stream_copy_to_output_stream (cairo_svg_stream_t *from,
|
|||
}
|
||||
}
|
||||
|
||||
cairo_status_t
|
||||
static cairo_status_t
|
||||
_cairo_svg_stream_destroy (cairo_svg_stream_t *svg_stream)
|
||||
{
|
||||
cairo_status_t status = svg_stream->status;
|
||||
|
|
@ -1686,10 +1686,11 @@ _cairo_svg_surface_emit_static_filter (cairo_svg_document_t *document, enum cair
|
|||
_cairo_svg_stream_printf (&document->xml_node_filters,
|
||||
"<filter id=\"filter-remove-color\" "
|
||||
"x=\"0%%\" y=\"0%%\" width=\"100%%\" height=\"100%%\">\n"
|
||||
"<feColorMatrix values=\"0 0 0 0 1 "
|
||||
/* */ "0 0 0 0 1 "
|
||||
/* */ "0 0 0 0 1 "
|
||||
/* */ "0 0 0 1 0\"/>\n"
|
||||
"<feColorMatrix color-interpolation-filters=\"sRGB\" "
|
||||
"values=\"0 0 0 0 1 "
|
||||
/* */ "0 0 0 0 1 "
|
||||
/* */ "0 0 0 0 1 "
|
||||
/* */ "0 0 0 1 0\" />\n"
|
||||
"</filter>\n");
|
||||
break;
|
||||
case CAIRO_SVG_FILTER_REMOVE_COLOR_AND_INVERT_ALPHA:
|
||||
|
|
@ -1697,10 +1698,11 @@ _cairo_svg_surface_emit_static_filter (cairo_svg_document_t *document, enum cair
|
|||
_cairo_svg_stream_printf (&document->xml_node_filters,
|
||||
"<filter id=\"filter-remove-color-and-invert-alpha\" "
|
||||
"x=\"0%%\" y=\"0%%\" width=\"100%%\" height=\"100%%\">\n"
|
||||
"<feColorMatrix values=\"0 0 0 0 1 "
|
||||
/* */ "0 0 0 0 1 "
|
||||
/* */ "0 0 0 0 1 "
|
||||
/* */ "0 0 0 -1 1\"/>\n"
|
||||
"<feColorMatrix color-interpolation-filters=\"sRGB\" "
|
||||
"values=\"0 0 0 0 1 "
|
||||
/* */ "0 0 0 0 1 "
|
||||
/* */ "0 0 0 0 1 "
|
||||
/* */ "0 0 0 -1 1\"/>\n"
|
||||
"</filter>\n");
|
||||
break;
|
||||
case CAIRO_SVG_FILTER_COLOR_TO_ALPHA:
|
||||
|
|
@ -1708,10 +1710,11 @@ _cairo_svg_surface_emit_static_filter (cairo_svg_document_t *document, enum cair
|
|||
_cairo_svg_stream_printf (&document->xml_node_filters,
|
||||
"<filter id=\"filter-color-to-alpha\" "
|
||||
"x=\"0%%\" y=\"0%%\" width=\"100%%\" height=\"100%%\">\n"
|
||||
"<feColorMatrix values=\"0 0 0 0 1 "
|
||||
/* */ "0 0 0 0 1 "
|
||||
/* */ "0 0 0 0 1 "
|
||||
/* */ "0.2126 0.7152 0.0722 0 0\"/>\n"
|
||||
"<feColorMatrix color-interpolation-filters=\"sRGB\" "
|
||||
"values=\"0 0 0 0 1 "
|
||||
/* */ "0 0 0 0 1 "
|
||||
/* */ "0 0 0 0 1 "
|
||||
/* */ "0.2126 0.7152 0.0722 0 0\"/>\n"
|
||||
"</filter>\n");
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -638,8 +638,8 @@ expect_fail_due_to_env_var (cairo_test_context_t *ctx,
|
|||
|
||||
/* Look for the test name in the env var (comma separated) */
|
||||
if (env) {
|
||||
while (1) {
|
||||
char *match = strstr (env, ctx->test_name);
|
||||
for (size_t start = 0;; start += strlen (ctx->test_name)) {
|
||||
char *match = strstr (env + start, ctx->test_name);
|
||||
if (!match)
|
||||
break;
|
||||
|
||||
|
|
@ -653,7 +653,6 @@ expect_fail_due_to_env_var (cairo_test_context_t *ctx,
|
|||
break;
|
||||
}
|
||||
}
|
||||
env = match + strlen (ctx->test_name);
|
||||
}
|
||||
}
|
||||
if (result)
|
||||
|
|
@ -951,19 +950,7 @@ main (int argc, char **argv)
|
|||
status = CAIRO_TEST_XFAILURE;
|
||||
} else {
|
||||
fprintf (stderr, "Test was expected to fail due to an environment variable, but did not!\n");
|
||||
fprintf (stderr, "Please remove the hack to ignore fallback-resolution failures.\n");
|
||||
status = CAIRO_TEST_ERROR;
|
||||
}
|
||||
}
|
||||
if (getenv ("CAIRO_TEST_UGLY_HACK_TO_IGNORE_FALLBACK_RESOLUTION") && strcmp (ctx.test_name, "fallback-resolution") == 0) {
|
||||
if (status == CAIRO_TEST_FAILURE) {
|
||||
cairo_test_log (&ctx, "Turning FAIL into XFAIL due to env\n");
|
||||
fprintf (stderr, "Turning FAIL into XFAIL due to env\n");
|
||||
runner.num_ignored_via_env++;
|
||||
status = CAIRO_TEST_XFAILURE;
|
||||
} else {
|
||||
fprintf (stderr, "Test was expected to fail due to an environment variable, but did not!\n");
|
||||
fprintf (stderr, "Please remove the hack to ignore fallback-resolution failures.\n");
|
||||
fprintf (stderr, "Please remove the hack to ignore create-for-stream failures.\n");
|
||||
status = CAIRO_TEST_ERROR;
|
||||
}
|
||||
}
|
||||
|
|
@ -1045,48 +1032,20 @@ main (int argc, char **argv)
|
|||
status = CAIRO_TEST_ERROR;
|
||||
}
|
||||
}
|
||||
if (getenv ("CAIRO_TEST_UGLY_HACK_TO_IGNORE_SVG_ARGB32_SELF_COPIES")) {
|
||||
if ((strcmp (target->name, "svg11") == 0 || strcmp (target->name, "svg12") == 0) &&
|
||||
target->content == CAIRO_CONTENT_COLOR_ALPHA &&
|
||||
(strcmp (ctx.test_name, "self-copy") == 0 || strcmp (ctx.test_name, "self-copy-overlap") == 0)) {
|
||||
if (status == CAIRO_TEST_CRASHED) {
|
||||
cairo_test_log (&ctx, "Turning CRASH into XFAIL due to env\n");
|
||||
fprintf (stderr, "Turning CRASH into XFAIL due to env\n");
|
||||
runner.num_ignored_via_env++;
|
||||
status = CAIRO_TEST_XFAILURE;
|
||||
} else {
|
||||
fprintf (stderr, "Test was expected to crash due to an environment variable, but did not!\n");
|
||||
fprintf (stderr, "Please remove the hack to ignore self-copy* crashes for the svg backend.\n");
|
||||
status = CAIRO_TEST_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (getenv ("CAIRO_TEST_UGLY_HACK_TO_IGNORE_SCRIPT_XCB_HUGE_IMAGE_SHM")) {
|
||||
if (getenv ("CAIRO_TEST_UGLY_HACK_TO_SOMETIMES_IGNORE_SCRIPT_XCB_HUGE_IMAGE_SHM")) {
|
||||
if (strcmp (target->name, "script") == 0 && strcmp (ctx.test_name, "xcb-huge-image-shm") == 0) {
|
||||
if (status == CAIRO_TEST_FAILURE) {
|
||||
fprintf (stderr, "This time the xcb-huge-image-shm test on script surface failed.\n");
|
||||
cairo_test_log (&ctx, "Turning FAIL into XFAIL due to env\n");
|
||||
fprintf (stderr, "Turning FAIL into XFAIL due to env\n");
|
||||
runner.num_ignored_via_env++;
|
||||
status = CAIRO_TEST_XFAILURE;
|
||||
} else {
|
||||
fprintf (stderr, "Test was expected to fail due to an environment variable, but did not!\n");
|
||||
fprintf (stderr, "Please remove the hack to ignore xcb-huge-image-shm errors for the script backend.\n");
|
||||
status = CAIRO_TEST_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (getenv ("CAIRO_TEST_UGLY_HACK_TO_IGNORE_QUARTZ_COVERAGE_COLUMN_TRIANGLES")) {
|
||||
if (strcmp (target->name, "quartz") == 0 && target->content == CAIRO_CONTENT_COLOR_ALPHA && strcmp (ctx.test_name, "coverage-column-triangles") == 0) {
|
||||
if (status == CAIRO_TEST_FAILURE) {
|
||||
cairo_test_log (&ctx, "Turning FAIL into XFAIL due to env\n");
|
||||
fprintf (stderr, "Turning FAIL into XFAIL due to env\n");
|
||||
runner.num_ignored_via_env++;
|
||||
status = CAIRO_TEST_XFAILURE;
|
||||
} else {
|
||||
fprintf (stderr, "Test was expected to fail due to an environment variable, but did not!\n");
|
||||
fprintf (stderr, "Please remove the hack to ignore xcb-huge-image-shm errors for the script backend.\n");
|
||||
status = CAIRO_TEST_ERROR;
|
||||
fprintf (stderr, "This time the xcb-huge-image-shm test on script surface did not fail.\n");
|
||||
cairo_test_log (&ctx, "Turning the status into XFAIL due to env\n");
|
||||
fprintf (stderr, "Turning the status into XFAIL due to env\n");
|
||||
}
|
||||
status = CAIRO_TEST_XFAILURE;
|
||||
fprintf (stderr, "If you are were getting one of the outcomes for some time, please update this code.\n");
|
||||
}
|
||||
}
|
||||
switch (status) {
|
||||
|
|
|
|||
BIN
test/reference/bug-361.image16.rgb24.ref.png
Normal file
|
After Width: | Height: | Size: 537 B |
BIN
test/reference/bug-361.xcb-window&.rgb24.ref.png
Normal file
|
After Width: | Height: | Size: 532 B |
BIN
test/reference/bug-361.xcb-window.rgb24.ref.png
Normal file
|
After Width: | Height: | Size: 532 B |
BIN
test/reference/bug-361.xcb.argb32.ref.png
Normal file
|
After Width: | Height: | Size: 552 B |
BIN
test/reference/bug-361.xcb.rgb24.ref.png
Normal file
|
After Width: | Height: | Size: 532 B |
BIN
test/reference/bug-361.xlib-window.rgb24.ref.png
Normal file
|
After Width: | Height: | Size: 545 B |
BIN
test/reference/bug-361.xlib.argb32.ref.png
Normal file
|
After Width: | Height: | Size: 565 B |
BIN
test/reference/bug-361.xlib.rgb24.ref.png
Normal file
|
After Width: | Height: | Size: 545 B |
BIN
test/reference/bug-431.image16.rgb24.ref.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
test/reference/bug-431.pdf.ref.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
test/reference/bug-431.pdf.rgb24.ref.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
test/reference/bug-431.xlib-window.rgb24.ref.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
test/reference/bug-431.xlib.rgb24.ref.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
test/reference/fallback-resolution.ppi144x144.pdf.ref.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
test/reference/fallback-resolution.ppi144x144.svg.ref.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
test/reference/fallback-resolution.ppi144x72.pdf.ref.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
test/reference/fallback-resolution.ppi144x72.svg.ref.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
BIN
test/reference/fallback-resolution.ppi288x288.svg.ref.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
test/reference/fallback-resolution.ppi288x72.pdf.ref.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
test/reference/fallback-resolution.ppi288x72.svg.ref.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.4 KiB |
BIN
test/reference/fallback-resolution.ppi576x576.svg.ref.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
test/reference/fallback-resolution.ppi576x72.pdf.ref.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
test/reference/fallback-resolution.ppi576x72.svg.ref.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
test/reference/fallback-resolution.ppi72x144.pdf.ref.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
test/reference/fallback-resolution.ppi72x144.svg.ref.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
test/reference/fallback-resolution.ppi72x288.pdf.ref.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
test/reference/fallback-resolution.ppi72x288.svg.ref.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
test/reference/fallback-resolution.ppi72x576.pdf.ref.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
test/reference/fallback-resolution.ppi72x576.svg.ref.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
test/reference/fallback-resolution.ppi72x72.pdf.ref.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
test/reference/fallback-resolution.ppi72x72.svg.ref.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
test/reference/mime-data.svg.ref.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
test/reference/operator-www.image16.rgb24.ref.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
test/reference/operator-www.pdf.ref.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
test/reference/pixman-downscale-best-24.svg.ref.png
Normal file
|
After Width: | Height: | Size: 179 B |
BIN
test/reference/pthread-same-source.svg.ref.png
Normal file
|
After Width: | Height: | Size: 956 B |
BIN
test/reference/pthread-show-text.svg.ref.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
test/reference/pthread-similar.svg.ref.png
Normal file
|
After Width: | Height: | Size: 176 B |
BIN
test/reference/record-transform-paint.image16.rgb24.ref.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
test/reference/record-transform-paint.pdf.ref.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
test/reference/user-font-mask.svg.ref.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
|
|
@ -37,8 +37,10 @@ draw (cairo_t *cr, int width, int height)
|
|||
cairo_rectangle (cr2, 40, 30, 120, 90);
|
||||
cairo_set_source_rgba (cr2, 0, 0, 0.9, 0.4);
|
||||
cairo_fill (cr2);
|
||||
cairo_destroy (cr2);
|
||||
|
||||
cairo_pattern_t *pattern = cairo_pattern_create_for_surface (recording_surface);
|
||||
cairo_surface_destroy(recording_surface);
|
||||
cairo_matrix_t matrix;
|
||||
cairo_matrix_init_translate (&matrix, -30, -30);
|
||||
cairo_pattern_set_matrix (pattern, &matrix);
|
||||
|
|
|
|||