[cairo-commit] 2 commits - src/cairo.c src/cairo-pdf-surface.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Sep 24 09:05:25 PDT 2008


 src/cairo-pdf-surface.c |    9 +++++++--
 src/cairo.c             |    2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 8c0ff8b5856a8a7cb61dffaad7d72ed2dcdb5cf3
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Sep 24 17:03:49 2008 +0100

    [cairo] Define min-tolerance in terms of cairo_fixed_t
    
    By using the cairo_fixed_t macros we can compute the correct minimum
    tolerance for any configuration.

diff --git a/src/cairo.c b/src/cairo.c
index 525d1f9..cdfefa0 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -42,7 +42,7 @@
 #include "cairo-arc-private.h"
 #include "cairo-path-private.h"
 
-#define CAIRO_TOLERANCE_MINIMUM	0.0002 /* We're limited by 16 bits of sub-pixel precision */
+#define CAIRO_TOLERANCE_MINIMUM	_cairo_fixed_to_double(1)
 
 static const cairo_t _cairo_nil = {
   CAIRO_REFERENCE_COUNT_INVALID,	/* ref_count */
commit c9ec82f3a89cdd57277be6a9a6cb3e05d82fb206
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Sep 24 15:01:25 2008 +0100

    [pdf] Tweak the mask analysis to avoid an assertion failure.
    
    Both the source and mask need to be analyzed and checked for an
    UNSUPPORTED operation before determining the best course of action.
    As before this is simply decided based on the requirements of the
    source.

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index f6f8679..3ac392c 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -4471,13 +4471,18 @@ _cairo_pdf_surface_mask	(void			*abstract_surface,
     if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE) {
 	status = _cairo_pdf_surface_analyze_operation (surface, op, source);
 	if (status != CAIRO_STATUS_SUCCESS &&
-	    status != CAIRO_INT_STATUS_ANALYZE_META_SURFACE_PATTERN)
+	    status <= CAIRO_INT_STATUS_UNSUPPORTED)
 	    return status;
 
 	status2 = _cairo_pdf_surface_analyze_operation (surface, op, mask);
-	if (status2 != CAIRO_STATUS_SUCCESS)
+	if (status2 == CAIRO_STATUS_SUCCESS)
+	    return status;
+	if (status2 <= CAIRO_INT_STATUS_UNSUPPORTED)
 	    return status2;
 
+	/* XXX At this point, both status and status2 indicate that the
+	 * patterns require further analysis. */
+
 	return status;
     } else if (surface->paginated_mode == CAIRO_PAGINATED_MODE_FALLBACK) {
 	status = _cairo_pdf_surface_start_fallback (surface);


More information about the cairo-commit mailing list