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

Chris Wilson ickle at kemper.freedesktop.org
Thu Sep 15 06:51:54 PDT 2011


 src/cairo-ps-surface.c |   14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

New commits:
commit 088d483043c67f0ee7795749f40a32015f4838b4
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Sep 15 14:50:11 2011 +0100

    ps: Check earlier for a supported mask
    
    Fixes crash in fill-and-stroke-alpha.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index c19a774..36d555d 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -1812,13 +1812,15 @@ _cairo_ps_surface_analyze_operation (cairo_ps_surface_t    *surface,
     }
 
     if (! pattern_supported (surface, pattern))
-    {
 	return CAIRO_INT_STATUS_UNSUPPORTED;
-    }
 
     if (! (op == CAIRO_OPERATOR_SOURCE || op == CAIRO_OPERATOR_OVER))
 	return CAIRO_INT_STATUS_UNSUPPORTED;
 
+    /* Mask is only supported when the mask is an image with opaque or bilevel alpha. */
+    if (mask && !mask_supported (surface, mask))
+	return CAIRO_INT_STATUS_UNSUPPORTED;
+
     if (pattern->type == CAIRO_PATTERN_TYPE_SURFACE) {
 	cairo_surface_pattern_t *surface_pattern = (cairo_surface_pattern_t *) pattern;
 
@@ -1837,10 +1839,6 @@ _cairo_ps_surface_analyze_operation (cairo_ps_surface_t    *surface,
 	    return CAIRO_STATUS_SUCCESS;
     }
 
-    /* Mask is only supported when the mask is an image with opaque or bilevel alpha. */
-    if (mask && !mask_supported (surface, mask))
-	return CAIRO_INT_STATUS_UNSUPPORTED;
-
     /* CAIRO_OPERATOR_OVER is only supported for opaque patterns. If
      * the pattern contains transparency, we return
      * CAIRO_INT_STATUS_FLATTEN_TRANSPARENCY to the analysis
commit 13bd9592d8d22fd1ad6fd2b8c6ef1e8f4c810845
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Sep 15 14:28:53 2011 +0100

    ps: Fix return value for mask_supported and ps2
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 781da67..c19a774 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -1780,7 +1780,7 @@ static cairo_bool_t
 mask_supported (cairo_ps_surface_t *surface, const cairo_pattern_t *mask)
 {
     if (surface->ps_level == CAIRO_PS_LEVEL_2)
-	return CAIRO_INT_STATUS_UNSUPPORTED;
+	return FALSE;
 
     if (mask->type == CAIRO_PATTERN_TYPE_SURFACE) {
 	cairo_surface_pattern_t *surface_pattern = (cairo_surface_pattern_t *) mask;
@@ -1839,7 +1839,7 @@ _cairo_ps_surface_analyze_operation (cairo_ps_surface_t    *surface,
 
     /* Mask is only supported when the mask is an image with opaque or bilevel alpha. */
     if (mask && !mask_supported (surface, mask))
-	    return CAIRO_INT_STATUS_UNSUPPORTED;
+	return CAIRO_INT_STATUS_UNSUPPORTED;
 
     /* CAIRO_OPERATOR_OVER is only supported for opaque patterns. If
      * the pattern contains transparency, we return
@@ -3846,7 +3846,7 @@ _cairo_ps_surface_mask (void			*abstract_surface,
     cairo_status_t status;
 
     status = _cairo_composite_rectangles_init_for_mask (&extents,
-						       	&surface->base,
+							&surface->base,
 							op, source, mask, clip);
     if (unlikely (status))
 	return status;


More information about the cairo-commit mailing list