From ab2546009ff246bd0e7bbc07437330cf307e00f7 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Tue, 18 Apr 2006 23:31:16 -0700 Subject: [PATCH] Use fallbacks in PDF backend for CAIRO_ANTIALIAS_NONE. Perhaps there's a way to preserve that hint in PDF output, but until we have code that actually does that, the correct thing to do is to call it unsupported and let the fallbacks do their thing. With this commit, the two regressions that were recently introduced now pass again. Specifically: rectangle-rounding-error unantialiased-shapes --- src/cairo-pdf-surface.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index 027e2cb17..64b564180 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -2232,8 +2232,14 @@ _cairo_pdf_surface_stroke (void *abstract_surface, cairo_pdf_document_t *document = surface->document; cairo_status_t status; - if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE) + 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; + return _analyze_operation (surface, op, source); + } assert (_operation_supported (surface, op, source)); @@ -2280,8 +2286,14 @@ _cairo_pdf_surface_fill (void *abstract_surface, const char *pdf_operator; cairo_status_t status; - if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE) + 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; + return _analyze_operation (surface, op, source); + } assert (_operation_supported (surface, op, source));