[cairo] Disabling antialiased shape drawing

Billy Biggs vektor at dumbterm.net
Thu Aug 4 20:07:29 PDT 2005


  Wow, I suck.  Here's the patch.

  -Billy

-------------- next part --------------
Index: doc/public/cairo-sections.txt
===================================================================
RCS file: /cvs/cairo/cairo/doc/public/cairo-sections.txt,v
retrieving revision 1.26
diff -p -u -r1.26 cairo-sections.txt
--- doc/public/cairo-sections.txt	25 Jul 2005 19:29:23 -0000	1.26
+++ doc/public/cairo-sections.txt	5 Aug 2005 02:48:51 -0000
@@ -162,7 +162,6 @@ cairo_font_options_status
 cairo_font_options_merge
 cairo_font_options_hash
 cairo_font_options_equal
-cairo_antialias_t
 cairo_font_options_set_antialias
 cairo_font_options_get_antialias
 cairo_subpixel_order_t
@@ -196,6 +195,8 @@ cairo_set_source_rgba
 cairo_set_source
 cairo_set_source_surface
 cairo_set_tolerance
+cairo_antialias_t
+cairo_set_shape_antialias
 cairo_fill_rule_t
 cairo_set_fill_rule
 cairo_set_line_width
@@ -265,6 +266,7 @@ cairo_glyph_path
 cairo_get_operator
 cairo_get_source
 cairo_get_tolerance
+cairo_get_shape_antialias
 cairo_get_current_point
 cairo_get_fill_rule
 cairo_get_line_width
Index: doc/public/tmpl/cairo-font.sgml
===================================================================
RCS file: /cvs/cairo/cairo/doc/public/tmpl/cairo-font.sgml,v
retrieving revision 1.8
diff -p -u -r1.8 cairo-font.sgml
--- doc/public/tmpl/cairo-font.sgml	28 Jul 2005 16:46:38 -0000	1.8
+++ doc/public/tmpl/cairo-font.sgml	5 Aug 2005 02:48:51 -0000
@@ -208,16 +208,6 @@ Font Handling
 @Returns: 
 
 
-<!-- ##### ENUM cairo_antialias_t ##### -->
-<para>
-
-</para>
-
- at CAIRO_ANTIALIAS_DEFAULT: 
- at CAIRO_ANTIALIAS_NONE: 
- at CAIRO_ANTIALIAS_GRAY: 
- at CAIRO_ANTIALIAS_SUBPIXEL: 
-
 <!-- ##### FUNCTION cairo_font_options_set_antialias ##### -->
 <para>
 
Index: doc/public/tmpl/cairo.sgml
===================================================================
RCS file: /cvs/cairo/cairo/doc/public/tmpl/cairo.sgml,v
retrieving revision 1.26
diff -p -u -r1.26 cairo.sgml
--- doc/public/tmpl/cairo.sgml	28 Jul 2005 18:34:47 -0000	1.26
+++ doc/public/tmpl/cairo.sgml	5 Aug 2005 02:48:51 -0000
@@ -190,6 +190,25 @@ Drawing contexts.
 @tolerance: 
 
 
+<!-- ##### ENUM cairo_antialias_t ##### -->
+<para>
+
+</para>
+
+ at CAIRO_ANTIALIAS_DEFAULT: 
+ at CAIRO_ANTIALIAS_NONE: 
+ at CAIRO_ANTIALIAS_GRAY: 
+ at CAIRO_ANTIALIAS_SUBPIXEL: 
+
+<!-- ##### FUNCTION cairo_set_shape_antialias ##### -->
+<para>
+
+</para>
+
+ at cr: 
+ at antialias: 
+
+
 <!-- ##### ENUM cairo_fill_rule_t ##### -->
 <para>
 
@@ -845,6 +864,15 @@ Drawing contexts.
 @Returns: 
 
 
+<!-- ##### FUNCTION cairo_get_shape_antialias ##### -->
+<para>
+
+</para>
+
+ at cr: 
+ at Returns: 
+
+
 <!-- ##### FUNCTION cairo_get_current_point ##### -->
 <para>
 
Index: src/cairo-glitz-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-glitz-surface.c,v
retrieving revision 1.54
diff -p -u -r1.54 cairo-glitz-surface.c
--- src/cairo-glitz-surface.c	28 Jul 2005 16:46:38 -0000	1.54
+++ src/cairo-glitz-surface.c	5 Aug 2005 02:48:52 -0000
@@ -937,6 +937,7 @@ static cairo_int_status_t
 _cairo_glitz_surface_composite_trapezoids (cairo_operator_t  op,
 					   cairo_pattern_t   *pattern,
 					   void		     *abstract_dst,
+					   cairo_antialias_t shape_antialias,
 					   int		     src_x,
 					   int		     src_y,
 					   int		     dst_x,
Index: src/cairo-gstate-private.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-gstate-private.h,v
retrieving revision 1.13
diff -p -u -r1.13 cairo-gstate-private.h
--- src/cairo-gstate-private.h	25 Jul 2005 19:29:24 -0000	1.13
+++ src/cairo-gstate-private.h	5 Aug 2005 02:48:52 -0000
@@ -81,6 +81,7 @@ struct _cairo_gstate {
     cairo_operator_t operator;
     
     double tolerance;
+    cairo_antialias_t shape_antialias;
 
     /* stroke style */
     double line_width;
Index: src/cairo-gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-gstate.c,v
retrieving revision 1.152
diff -p -u -r1.152 cairo-gstate.c
--- src/cairo-gstate.c	28 Jul 2005 22:58:09 -0000	1.152
+++ src/cairo-gstate.c	5 Aug 2005 02:48:52 -0000
@@ -103,6 +103,7 @@ _cairo_gstate_init (cairo_gstate_t  *gst
     gstate->operator = CAIRO_GSTATE_OPERATOR_DEFAULT;
 
     gstate->tolerance = CAIRO_GSTATE_TOLERANCE_DEFAULT;
+    gstate->shape_antialias = CAIRO_GSTATE_SHAPE_ANTIALIAS_DEFAULT;
 
     gstate->line_width = CAIRO_GSTATE_LINE_WIDTH_DEFAULT;
     gstate->line_cap = CAIRO_GSTATE_LINE_CAP_DEFAULT;
@@ -1258,6 +1259,7 @@ _composite_traps_intermediate_surface (c
     status = _cairo_surface_composite_trapezoids (CAIRO_OPERATOR_ADD,
 						  &pattern.base,
 						  intermediate,
+						  gstate->shape_antialias,
 						  extents->x, extents->y,
 						  0, 0,
 						  extents->width,
@@ -1353,6 +1355,7 @@ _composite_traps (cairo_gstate_t    *gst
     
     status = _cairo_surface_composite_trapezoids (gstate->operator,
 						  &pattern.base, dst,
+						  gstate->shape_antialias,
 						  extents->x, extents->y,
 						  extents->x, extents->y,
 						  extents->width,
@@ -1737,6 +1740,7 @@ _cairo_gstate_intersect_clip_mask (cairo
     status = _cairo_surface_composite_trapezoids (CAIRO_OPERATOR_IN,
 						  &pattern.base,
 						  surface,
+						  gstate->shape_antialias,
 						  0, 0,
 						  0, 0,
 						  surface_rect.width,
@@ -2291,3 +2295,19 @@ _cairo_gstate_glyph_path (cairo_gstate_t
     free (transformed_glyphs);
     return status;
 }
+
+cairo_private cairo_status_t
+_cairo_gstate_set_shape_antialias (cairo_gstate_t *gstate,
+				   cairo_antialias_t antialias)
+{
+    gstate->shape_antialias = antialias;
+
+    return CAIRO_STATUS_SUCCESS;
+}
+
+cairo_private cairo_antialias_t
+_cairo_gstate_get_shape_antialias (cairo_gstate_t *gstate)
+{
+    return gstate->shape_antialias;
+}
+
Index: src/cairo-image-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-image-surface.c,v
retrieving revision 1.54
diff -p -u -r1.54 cairo-image-surface.c
--- src/cairo-image-surface.c	28 Jul 2005 17:47:40 -0000	1.54
+++ src/cairo-image-surface.c	5 Aug 2005 02:48:53 -0000
@@ -649,6 +649,7 @@ static cairo_int_status_t
 _cairo_image_surface_composite_trapezoids (cairo_operator_t	operator,
 					   cairo_pattern_t	*pattern,
 					   void			*abstract_dst,
+					   cairo_antialias_t	shape_antialias,
 					   int			src_x,
 					   int			src_y,
 					   int			dst_x,
@@ -664,6 +665,18 @@ _cairo_image_surface_composite_trapezoid
     cairo_int_status_t		status;
     int				render_reference_x, render_reference_y;
     int				render_src_x, render_src_y;
+    pixman_format_t		*image_format;
+
+    switch (shape_antialias) {
+    case CAIRO_ANTIALIAS_NONE:
+	image_format = pixman_format_create (PIXMAN_FORMAT_NAME_A1);
+	break;
+    default:
+	image_format = pixman_format_create (PIXMAN_FORMAT_NAME_A8);
+	break;
+    }
+    if (!image_format)
+        return CAIRO_STATUS_NO_MEMORY;
 
     status = _cairo_pattern_acquire_surface (pattern, &dst->base,
 					     src_x, src_y, width, height,
@@ -690,12 +703,15 @@ _cairo_image_surface_composite_trapezoid
 	pixman_composite_trapezoids (_pixman_operator (operator),
 				     src->pixman_image,
 				     dst->pixman_image,
+				     image_format,
 				     render_src_x + attributes.x_offset,
 				     render_src_y + attributes.y_offset,
 				     (pixman_trapezoid_t *) traps, num_traps);
 
     _cairo_pattern_release_surface (pattern, &src->base, &attributes);
 
+    pixman_format_destroy (image_format);
+
     return status;
 }
 
Index: src/cairo-meta-surface-private.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-meta-surface-private.h,v
retrieving revision 1.2
diff -p -u -r1.2 cairo-meta-surface-private.h
--- src/cairo-meta-surface-private.h	13 Jul 2005 19:32:51 -0000	1.2
+++ src/cairo-meta-surface-private.h	5 Aug 2005 02:48:53 -0000
@@ -77,6 +77,7 @@ typedef struct _cairo_command_composite_
     cairo_command_type_t	type;
     cairo_operator_t		operator;
     cairo_pattern_union_t	pattern;
+    cairo_antialias_t		shape_antialias;
     int				x_src;
     int				y_src;
     int				x_dst;
Index: src/cairo-meta-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-meta-surface.c,v
retrieving revision 1.5
diff -p -u -r1.5 cairo-meta-surface.c
--- src/cairo-meta-surface.c	27 Jul 2005 22:39:35 -0000	1.5
+++ src/cairo-meta-surface.c	5 Aug 2005 02:48:53 -0000
@@ -229,6 +229,7 @@ static cairo_int_status_t
 _cairo_meta_surface_composite_trapezoids (cairo_operator_t	operator,
 					  cairo_pattern_t	*pattern,
 					  void			*abstract_surface,
+					  cairo_antialias_t	shape_antialias,
 					  int			x_src,
 					  int			y_src,
 					  int			x_dst,
@@ -248,6 +249,7 @@ _cairo_meta_surface_composite_trapezoids
     command->type = CAIRO_COMMAND_COMPOSITE_TRAPEZOIDS;
     command->operator = operator;
     _cairo_pattern_init_copy (&command->pattern.base, pattern);
+    command->shape_antialias = shape_antialias;
     command->x_src = x_src;
     command->y_src = y_src;
     command->x_dst = x_dst;
@@ -523,6 +525,7 @@ _cairo_meta_surface_replay (cairo_surfac
 		(command->composite_trapezoids.operator,
 		 &command->composite_trapezoids.pattern.base,
 		 target,
+		 command->composite_trapezoids.shape_antialias,
 		 command->composite_trapezoids.x_src,
 		 command->composite_trapezoids.y_src,
 		 command->composite_trapezoids.x_dst,
Index: src/cairo-pdf-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pdf-surface.c,v
retrieving revision 1.54
diff -p -u -r1.54 cairo-pdf-surface.c
--- src/cairo-pdf-surface.c	27 Jul 2005 22:39:35 -0000	1.54
+++ src/cairo-pdf-surface.c	5 Aug 2005 02:48:54 -0000
@@ -1152,6 +1152,7 @@ static cairo_int_status_t
 _cairo_pdf_surface_composite_trapezoids (cairo_operator_t	operator,
 					 cairo_pattern_t	*pattern,
 					 void			*abstract_dst,
+					 cairo_antialias_t	shape_antialias,
 					 int			x_src,
 					 int			y_src,
 					 int			x_dst,
Index: src/cairo-ps-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ps-surface.c,v
retrieving revision 1.45
diff -p -u -r1.45 cairo-ps-surface.c
--- src/cairo-ps-surface.c	28 Jul 2005 16:46:38 -0000	1.45
+++ src/cairo-ps-surface.c	5 Aug 2005 02:48:54 -0000
@@ -272,6 +272,7 @@ static cairo_int_status_t
 _cairo_ps_surface_composite_trapezoids (cairo_operator_t	operator,
 					cairo_pattern_t		*pattern,
 					void			*abstract_dst,
+					cairo_antialias_t	shape_antialias,
 					int			x_src,
 					int			y_src,
 					int			x_dst,
@@ -286,6 +287,7 @@ _cairo_ps_surface_composite_trapezoids (
     return _cairo_surface_composite_trapezoids (operator,
 						pattern,
 						surface->current_page,
+						shape_antialias,
 						x_src,
 						y_src,
 						x_dst,
Index: src/cairo-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-surface.c,v
retrieving revision 1.85
diff -p -u -r1.85 cairo-surface.c
--- src/cairo-surface.c	28 Jul 2005 17:41:08 -0000	1.85
+++ src/cairo-surface.c	5 Aug 2005 02:48:55 -0000
@@ -876,6 +876,7 @@ static cairo_status_t
 _fallback_composite_trapezoids (cairo_operator_t	operator,
 				cairo_pattern_t		*pattern,
 				cairo_surface_t		*dst,
+				cairo_antialias_t	shape_antialias,
 				int			src_x,
 				int			src_y,
 				int			dst_x,
@@ -928,6 +929,7 @@ _fallback_composite_trapezoids (cairo_op
 
     state.image->base.backend->composite_trapezoids (operator, pattern,
 						     &state.image->base,
+						     shape_antialias,
 						     src_x, src_y,
 						     dst_x - state.image_rect.x,
 						     dst_y - state.image_rect.y,
@@ -945,6 +947,7 @@ cairo_status_t
 _cairo_surface_composite_trapezoids (cairo_operator_t		operator,
 				     cairo_pattern_t		*pattern,
 				     cairo_surface_t		*dst,
+				     cairo_antialias_t		shape_antialias,
 				     int			src_x,
 				     int			src_y,
 				     int			dst_x,
@@ -965,6 +968,7 @@ _cairo_surface_composite_trapezoids (cai
     if (dst->backend->composite_trapezoids) {
 	status = dst->backend->composite_trapezoids (operator,
 						     pattern, dst,
+						     shape_antialias,
 						     src_x, src_y,
 						     dst_x, dst_y,
 						     width, height,
@@ -974,6 +978,7 @@ _cairo_surface_composite_trapezoids (cai
     }
 
     return  _fallback_composite_trapezoids (operator, pattern, dst,
+					    shape_antialias,
 					    src_x, src_y,
 					    dst_x, dst_y,
 					    width, height,
Index: src/cairo-xcb-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-xcb-surface.c,v
retrieving revision 1.44
diff -p -u -r1.44 cairo-xcb-surface.c
--- src/cairo-xcb-surface.c	28 Jul 2005 17:02:54 -0000	1.44
+++ src/cairo-xcb-surface.c	5 Aug 2005 02:48:55 -0000
@@ -943,6 +943,7 @@ static cairo_int_status_t
 _cairo_xcb_surface_composite_trapezoids (cairo_operator_t	operator,
 					 cairo_pattern_t	*pattern,
 					 void			*abstract_dst,
+					 cairo_antialias_t	shape_antialias,
 					 int			src_x,
 					 int			src_y,
 					 int			dst_x,
@@ -981,9 +982,17 @@ _cairo_xcb_surface_composite_trapezoids 
     render_src_x = src_x + render_reference_x - dst_x;
     render_src_y = src_y + render_reference_y - dst_y;
 
+    switch (shape_antialias) {
+    case CAIRO_ANTIALIAS_NONE:
+	render_format = _format_from_cairo (dst->dpy, CAIRO_FORMAT_A1),
+	break;
+    default:
+	render_format = _format_from_cairo (dst->dpy, CAIRO_FORMAT_A8),
+	break;
+    }
+
     /* XXX: The XTrapezoid cast is evil and needs to go away somehow. */
     /* XXX: _format_from_cairo is slow. should cache something. */
-    render_format = _format_from_cairo (dst->dpy, CAIRO_FORMAT_A8),
     status = _cairo_xcb_surface_set_attributes (src, &attributes);
     if (status == CAIRO_STATUS_SUCCESS)
 	XCBRenderTrapezoids (dst->dpy,
Index: src/cairo-xlib-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-xlib-surface.c,v
retrieving revision 1.101
diff -p -u -r1.101 cairo-xlib-surface.c
--- src/cairo-xlib-surface.c	28 Jul 2005 17:02:54 -0000	1.101
+++ src/cairo-xlib-surface.c	5 Aug 2005 02:48:56 -0000
@@ -1199,6 +1199,7 @@ static cairo_int_status_t
 _cairo_xlib_surface_composite_trapezoids (cairo_operator_t	operator,
 					  cairo_pattern_t	*pattern,
 					  void			*abstract_dst,
+					  cairo_antialias_t	shape_antialias,
 					  int			src_x,
 					  int			src_y,
 					  int			dst_x,
@@ -1215,6 +1216,7 @@ _cairo_xlib_surface_composite_trapezoids
     composite_operation_t       operation;
     int				render_reference_x, render_reference_y;
     int				render_src_x, render_src_y;
+    XRenderPictFormat		*pict_format;
 
     if (!CAIRO_SURFACE_RENDER_HAS_TRAPEZOIDS (dst))
 	return CAIRO_INT_STATUS_UNSUPPORTED;
@@ -1235,6 +1237,15 @@ _cairo_xlib_surface_composite_trapezoids
 	status = CAIRO_INT_STATUS_UNSUPPORTED;
 	goto FAIL;
     }
+
+    switch (shape_antialias) {
+    case CAIRO_ANTIALIAS_NONE:
+	pict_format = XRenderFindStandardFormat (dst->dpy, PictStandardA1);
+	break;
+    default:
+	pict_format = XRenderFindStandardFormat (dst->dpy, PictStandardA8);
+	break;
+    }
 	
     if (traps[0].left.p1.y < traps[0].left.p2.y) {
 	render_reference_x = _cairo_fixed_integer_floor (traps[0].left.p1.x);
@@ -1254,7 +1265,7 @@ _cairo_xlib_surface_composite_trapezoids
 	XRenderCompositeTrapezoids (dst->dpy,
 				    _render_operator (operator),
 				    src->src_picture, dst->dst_picture,
-				    XRenderFindStandardFormat (dst->dpy, PictStandardA8),
+				    pict_format,
 				    render_src_x + attributes.x_offset, 
 				    render_src_y + attributes.y_offset,
 				    (XTrapezoid *) traps, num_traps);
Index: src/cairo.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.c,v
retrieving revision 1.117
diff -p -u -r1.117 cairo.c
--- src/cairo.c	28 Jul 2005 17:41:08 -0000	1.117
+++ src/cairo.c	5 Aug 2005 02:48:57 -0000
@@ -532,6 +532,27 @@ cairo_set_tolerance (cairo_t *cr, double
 }
 
 /**
+ * cairo_set_shape_antialias:
+ * @cr: a #cairo_t
+ * @antialias: the new antialiasing mode
+ * 
+ * Set the antialiasing mode of the rasterizer used for drawing shapes.
+ * This value is a hint and may not be supported by all backends.
+ **/
+void
+cairo_set_shape_antialias (cairo_t *cr, cairo_antialias_t antialias)
+{
+    if (cr->status) {
+	_cairo_set_error (cr, cr->status);
+	return;
+    }
+
+    cr->status = _cairo_gstate_set_shape_antialias (cr->gstate, antialias);
+    if (cr->status)
+	_cairo_set_error (cr, cr->status);
+}
+
+/**
  * cairo_set_fill_rule:
  * @cr: a #cairo_t
  * @fill_rule: a fill rule, specified as a #cairo_fill_rule_t
@@ -2079,6 +2100,20 @@ cairo_get_tolerance (cairo_t *cr)
 }
 
 /**
+ * cairo_get_shape_antialias:
+ * @cr: a cairo context
+ * 
+ * Gets the antialising mode set, as set by cairo_set_shape_antialias().
+ * 
+ * Return value: the requested shape antialiasing mode.
+ **/
+cairo_antialias_t
+cairo_get_shape_antialias (cairo_t *cr)
+{
+    return _cairo_gstate_get_shape_antialias (cr->gstate);
+}
+
+/**
  * cairo_get_current_point:
  * @cr: a cairo context
  * @x: return value for X coordinate of the current point
Index: src/cairo.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.h,v
retrieving revision 1.142
diff -p -u -r1.142 cairo.h
--- src/cairo.h	28 Jul 2005 17:41:08 -0000	1.142
+++ src/cairo.h	5 Aug 2005 02:48:57 -0000
@@ -296,6 +296,29 @@ void
 cairo_set_tolerance (cairo_t *cr, double tolerance);
 
 /**
+ * cairo_antialias_t:
+ * @CAIRO_ANTIALIAS_DEFAULT: Use the default antialiasing for
+ *   the subsystem and target device
+ * @CAIRO_ANTIALIAS_NONE: Do no antialiasing; use a bilevel alpha channel
+ * @CAIRO_ANTIALIAS_GRAY: Perform single-color antialiasing (using
+ *  shades of gray for black text on a white background, for example).
+ * @CAIRO_ANTIALIAS_SUBPIXEL: Perform antialiasing by taking
+ *  advantage of the order of subpixel elements on devices
+ *  such as LCD panels
+ * 
+ * Specifies the type of antialiasing to do when rendering text or shapes.
+ **/
+typedef enum _cairo_antialias {
+    CAIRO_ANTIALIAS_DEFAULT,
+    CAIRO_ANTIALIAS_NONE,
+    CAIRO_ANTIALIAS_GRAY,
+    CAIRO_ANTIALIAS_SUBPIXEL
+} cairo_antialias_t;
+
+void
+cairo_set_shape_antialias (cairo_t *cr, cairo_antialias_t antialias);
+
+/**
  * cairo_fill_rule_t
  * @CAIRO_FILL_RULE_WINDING: If the path crosses the ray from
  * left-to-right, counts +1. If the path crosses the ray
@@ -668,26 +691,6 @@ typedef enum _cairo_font_weight {
 } cairo_font_weight_t;
 
 /**
- * cairo_antialias_t:
- * @CAIRO_ANTIALIAS_DEFAULT: Use the default antialiasing for
- *   the font subsystem and target device
- * @CAIRO_ANTIALIAS_NONE: Do no antialiasing of fonts; use bilevel text
- * @CAIRO_ANTIALIAS_GRAY: Perform single-color antialiasing (using
- *  shades of gray for black text on a white background, for example).
- * @CAIRO_ANTIALIAS_SUBPIXEL: Perform antialiasing by taking
- *  advantage of the order of subpixel elements on devices
- *  such as LCD panels
- * 
- * Specifies the type of antialiasing to do when rendering text.
- **/
-typedef enum _cairo_antialias {
-    CAIRO_ANTIALIAS_DEFAULT,
-    CAIRO_ANTIALIAS_NONE,
-    CAIRO_ANTIALIAS_GRAY,
-    CAIRO_ANTIALIAS_SUBPIXEL
-} cairo_antialias_t;
-
-/**
  * cairo_subpixel_order_t:
  * @CAIRO_SUBPIXEL_ORDER_DEFAULT: Use the default subpixel order for
  *   for the target device
@@ -928,6 +931,9 @@ cairo_get_source (cairo_t *cr);
 double
 cairo_get_tolerance (cairo_t *cr);
 
+cairo_antialias_t
+cairo_get_shape_antialias (cairo_t *cr);
+
 void
 cairo_get_current_point (cairo_t *cr, double *x, double *y);
 
Index: src/cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.175
diff -p -u -r1.175 cairoint.h
--- src/cairoint.h	29 Jul 2005 19:45:01 -0000	1.175
+++ src/cairoint.h	5 Aug 2005 02:48:58 -0000
@@ -683,6 +683,7 @@ typedef struct _cairo_surface_backend {
     (*composite_trapezoids)	(cairo_operator_t	 operator,
 				 cairo_pattern_t	*pattern,
 				 void			*dst,
+				 cairo_antialias_t	 shape_antialias,
 				 int			 src_x,
 				 int			 src_y,
 				 int			 dst_x,
@@ -983,6 +984,7 @@ typedef struct _cairo_traps {
 
 #define CAIRO_GSTATE_OPERATOR_DEFAULT	CAIRO_OPERATOR_OVER
 #define CAIRO_GSTATE_TOLERANCE_DEFAULT	0.1
+#define CAIRO_GSTATE_SHAPE_ANTIALIAS_DEFAULT	CAIRO_ANTIALIAS_DEFAULT
 #define CAIRO_GSTATE_FILL_RULE_DEFAULT	CAIRO_FILL_RULE_WINDING
 #define CAIRO_GSTATE_LINE_WIDTH_DEFAULT	2.0
 #define CAIRO_GSTATE_LINE_CAP_DEFAULT	CAIRO_LINE_CAP_BUTT
@@ -1262,6 +1264,13 @@ _cairo_gstate_glyph_path (cairo_gstate_t
 			  int		      num_glyphs,
 			  cairo_path_fixed_t *path);
 
+cairo_private cairo_status_t
+_cairo_gstate_set_shape_antialias (cairo_gstate_t *gstate,
+				   cairo_antialias_t antialias);
+
+cairo_private cairo_antialias_t
+_cairo_gstate_get_shape_antialias (cairo_gstate_t *gstate);
+
 
 /* cairo_color.c */
 cairo_private const cairo_color_t *
@@ -1552,6 +1561,7 @@ cairo_private cairo_status_t
 _cairo_surface_composite_trapezoids (cairo_operator_t	operator,
 				     cairo_pattern_t	*pattern,
 				     cairo_surface_t	*dst,
+				     cairo_antialias_t	shape_antialias,
 				     int		src_x,
 				     int		src_y,
 				     int		dst_x,


More information about the cairo mailing list