[cairo-commit] src/cairo-pdf-surface.c test/cairo-test.c

Carl Worth cworth at kemper.freedesktop.org
Mon Jun 19 15:39:56 PDT 2006


 src/cairo-pdf-surface.c |   16 ++--------------
 test/cairo-test.c       |   15 ++++++++++++++-
 2 files changed, 16 insertions(+), 15 deletions(-)

New commits:
diff-tree a3f2d92f11a1ab4d30dd0e33a0cd5ee19495eeb1 (from 72e7667ed904b93475d7e4540778c498aa781cdf)
Author: Carl Worth <cworth at cworth.org>
Date:   Mon Jun 19 11:03:32 2006 -0700

    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.

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index d417c55..2c3fa4b 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -2440,14 +2440,8 @@ _cairo_pdf_surface_stroke (void			*abstr
     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			*abstrac
     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));
 
diff --git a/test/cairo-test.c b/test/cairo-test.c
index b990718..e784528 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -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;
+
+    for (i = 0; pdf_ignored_tests[i] != NULL; i++)
+	if (strcmp (test->name, pdf_ignored_tests[i]) == 0)
+	    return NULL;
 
-    /* Sanitizie back to a real cairo_content_t value. */
+    /* Sanitize back to a real cairo_content_t value. */
     if (content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED)
 	content = CAIRO_CONTENT_COLOR_ALPHA;
 


More information about the cairo-commit mailing list