[cairo] patch: quartz - fallback when source/mask has CAIRO_EXTEND_PAD and they are surface type

Henry (Yu) Song - SISA hsong at sisa.samsung.com
Mon Jul 23 12:35:56 PDT 2012


commit 20d3005bc98d0f75606c67175ec73a9ce3827e31
Author: Henry Song <henry.song at samsung.com>
Date:   Mon Jul 23 12:33:45 2012 -0700

    quartz:  quartz does not handle CAIRO_EXTEND_PAD, let's fallback

diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index 28bdae6..471c95d 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -1139,6 +1139,15 @@ _cairo_quartz_setup_state (cairo_quartz_drawing_state_t *state,
     state->cgDrawContext = NULL;
     state->cgMaskContext = NULL;
 
+    /* FIXME: ideally, we should use CIImage's CIAffineClamp for 
+       CAIRO_EXTEND_PAD
+     */
+    if ((composite->source_pattern.base.type == CAIRO_PATTERN_TYPE_SURFACE &&
+	 composite->source_pattern.base.extend == CAIRO_EXTEND_PAD) ||
+	(composite->mask_pattern.base.type == CAIRO_PATTERN_TYPE_SURFACE &&
+	 composite->mask_pattern.base.extend == CAIRO_EXTEND_PAD))
+	return CAIRO_INT_STATUS_UNSUPPORTED;
+
     status = _cairo_surface_clipper_set_clip (&surface->clipper, clip);
     if (unlikely (status))
 	return status;


More information about the cairo mailing list