mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-06-03 19:48:29 +02:00
PDF: Don't fallback due to CAIRO_ANTIALIAS_NONE
This was a gratuitous thing that was causing excessive fallbacks in mozilla printing to PDF. The only reason it was ever there was to get some of the tests that rely on CAIRO_ANTIALIAS_NONE to pass. Instead we now simply don't run those tests against the PDF backend.
This commit is contained in:
parent
72e7667ed9
commit
a3f2d92f11
2 changed files with 16 additions and 15 deletions
|
|
@ -2440,14 +2440,8 @@ _cairo_pdf_surface_stroke (void *abstract_surface,
|
|||
pdf_path_info_t info;
|
||||
cairo_status_t status;
|
||||
|
||||
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE) {
|
||||
/* XXX: Does PDF provide a way we can preserve this hint? For now,
|
||||
* this will trigger a fallback. */
|
||||
if (antialias == CAIRO_ANTIALIAS_NONE)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
|
||||
return _analyze_operation (surface, op, source);
|
||||
}
|
||||
|
||||
assert (_operation_supported (surface, op, source));
|
||||
|
||||
|
|
@ -2495,14 +2489,8 @@ _cairo_pdf_surface_fill (void *abstract_surface,
|
|||
cairo_status_t status;
|
||||
pdf_path_info_t info;
|
||||
|
||||
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE) {
|
||||
/* XXX: Does PDF provide a way we can preserve this hint? For now,
|
||||
* this will trigger a fallback. */
|
||||
if (antialias == CAIRO_ANTIALIAS_NONE)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
|
||||
return _analyze_operation (surface, op, source);
|
||||
}
|
||||
|
||||
assert (_operation_supported (surface, op, source));
|
||||
|
||||
|
|
|
|||
|
|
@ -1222,6 +1222,14 @@ cleanup_ps (void *closure)
|
|||
#if CAIRO_HAS_PDF_SURFACE && CAIRO_CAN_TEST_PDF_SURFACE
|
||||
#include "cairo-pdf.h"
|
||||
|
||||
static const char *pdf_ignored_tests[] = {
|
||||
/* We can't match the results of tests that depend on
|
||||
* CAIRO_ANTIALIAS_NONE, (nor do we care). */
|
||||
"rectangle-rounding-error",
|
||||
"unantialiased-shapes",
|
||||
NULL
|
||||
};
|
||||
|
||||
cairo_user_data_key_t pdf_closure_key;
|
||||
|
||||
typedef struct _pdf_target_closure
|
||||
|
|
@ -1241,8 +1249,13 @@ create_pdf_surface (cairo_test_t *test,
|
|||
int height = test->height;
|
||||
pdf_target_closure_t *ptc;
|
||||
cairo_surface_t *surface;
|
||||
int i;
|
||||
|
||||
/* Sanitizie back to a real cairo_content_t value. */
|
||||
for (i = 0; pdf_ignored_tests[i] != NULL; i++)
|
||||
if (strcmp (test->name, pdf_ignored_tests[i]) == 0)
|
||||
return NULL;
|
||||
|
||||
/* Sanitize back to a real cairo_content_t value. */
|
||||
if (content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED)
|
||||
content = CAIRO_CONTENT_COLOR_ALPHA;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue