ps: Check earlier for a supported mask

Fixes crash in fill-and-stroke-alpha.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-09-15 14:50:11 +01:00
parent 13bd9592d8
commit 088d483043

View file

@ -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