[cairo-commit] cairo/src cairo-ps-surface.c, 1.60, 1.61 cairoint.h, 1.228, 1.229

Carl Worth commit at pdx.freedesktop.org
Tue Nov 8 17:43:16 PST 2005


Committed by: cworth

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv4179/src

Modified Files:
	cairo-ps-surface.c cairoint.h 
Log Message:

2005-11-08  Carl Worth  <cworth at cworth.org>

        * ROADMAP: Note that PS is now passing all tests except for
        self-copy.

        * src/cairo-ps-surface.c: (_cairo_ps_surface_paint),
        (_cairo_ps_surface_mask), (_cairo_ps_surface_stroke),
        (_cairo_ps_surface_fill), (_cairo_ps_surface_show_glyphs),
        (_ps_output_paint), (_ps_output_mask), (_ps_output_stroke),
        (_ps_output_fill), (_ps_output_show_glyphs): Add missing glue to
        hook up PS backend with new meta-surface support for the 5 basic
        drawing operations. Currently, this forces image fallbacks for all
        operations.

        * test/cairo-test.c: (ps_surface_write_to_png): Switch from gs
        device of pngalpha to png16m which for some reason gives the
        correct result for nil-surface now, while pngalpha does not.

        * test/clip-operator.c: (draw): Key off of N_OPERATORS as the loop
        control for easier trimming down of this test case when debugging.

        * src/cairoint.h: Rename stroke_style parameter to style in
        backend->stroke parameter list.

        * test/caps-joins-ps-rgb24-ref.png:
        * test/caps-sub-paths-ps-rgb24-ref.png:
        * test/clip-fill-rule-ps-rgb24-ref.png:
        * test/clip-nesting-ps-rgb24-ref.png:
        * test/clip-twice-ps-rgb24-ref.png:
        * test/dash-caps-joins-ps-rgb24-ref.png:
        * test/dash-offset-negative-ps-rgb24-ref.png:
        * test/fill-and-stroke-ps-rgb24-ref.png:
        * test/fill-rule-ps-rgb24-ref.png:
        * test/leaky-polygon-ps-rgb24-ref.png:
        * test/line-width-ps-rgb24-ref.png:
        * test/path-data-ps-rgb24-ref.png:
        * test/rectangle-rounding-error-ps-rgb24-ref.png:
        * test/show-text-current-point-ps-rgb24-ref.png:
        * test/text-antialias-gray-ps-rgb24-ref.png:
        * test/text-antialias-none-ps-rgb24-ref.png:
        * test/text-antialias-subpixel-ps-rgb24-ref.png:
        * test/transforms-ps-rgb24-ref.png:
        * test/unantialiased-shapes-ps-rgb24-ref.png: Remove PS-specific
        reference images for many tests which are now using more fallback
        paths than before.


Index: cairo-ps-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ps-surface.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- cairo-ps-surface.c	9 Nov 2005 01:16:21 -0000	1.60
+++ cairo-ps-surface.c	9 Nov 2005 01:43:14 -0000	1.61
@@ -468,9 +468,56 @@
 }
 
 static cairo_int_status_t
+_cairo_ps_surface_paint (void			*abstract_surface,
+			 cairo_operator_t	 operator,
+			 cairo_pattern_t	*source)
+{
+    cairo_ps_surface_t *surface = abstract_surface;
+
+    assert (_cairo_surface_is_meta (surface->current_page));
+
+    return _cairo_surface_paint (surface->current_page, operator, source);
+}
+
+static cairo_int_status_t
+_cairo_ps_surface_mask (void			*abstract_surface,
+			cairo_operator_t	 operator,
+			cairo_pattern_t		*source,
+			cairo_pattern_t		*mask)
+{
+    cairo_ps_surface_t *surface = abstract_surface;
+
+    assert (_cairo_surface_is_meta (surface->current_page));
+
+    return _cairo_surface_mask (surface->current_page, operator, source,
+				mask);
+}
+
+static cairo_int_status_t
+_cairo_ps_surface_stroke (void			*abstract_surface,
+			  cairo_operator_t	 operator,
+			  cairo_pattern_t	*source,
+			  cairo_path_fixed_t	*path,
+			  cairo_stroke_style_t	*style,
+			  cairo_matrix_t	*ctm,
+			  cairo_matrix_t	*ctm_inverse,
+			  double		 tolerance,
+			  cairo_antialias_t	 antialias)
+{
+    cairo_ps_surface_t *surface = abstract_surface;
+
+    assert (_cairo_surface_is_meta (surface->current_page));
+
+    return _cairo_surface_stroke (surface->current_page, operator, source,
+				  path, style,
+				  ctm, ctm_inverse,
+				  tolerance, antialias);
+}
+
+static cairo_int_status_t
 _cairo_ps_surface_fill (void			*abstract_surface,
 			cairo_operator_t	 operator,
-			cairo_pattern_t		*pattern,
+			cairo_pattern_t		*source,
 			cairo_path_fixed_t	*path,
 			cairo_fill_rule_t	 fill_rule,
 			double			 tolerance,
@@ -480,13 +527,26 @@
 
     assert (_cairo_surface_is_meta (surface->current_page));
 
-    return _cairo_surface_fill (surface->current_page,
-				operator,
-				pattern,
-				path,
-				fill_rule,
-				tolerance,
-				antialias);
+    return _cairo_surface_fill (surface->current_page, operator, source,
+				path, fill_rule,
+				tolerance, antialias);
+}
+
+static cairo_int_status_t
+_cairo_ps_surface_show_glyphs (void			*abstract_surface,
+			       cairo_operator_t		 operator,
+			       cairo_pattern_t		*source,
+			       const cairo_glyph_t	*glyphs,
+			       int			 num_glyphs,
+			       cairo_scaled_font_t	*scaled_font)
+{
+    cairo_ps_surface_t *surface = abstract_surface;
+
+    assert (_cairo_surface_is_meta (surface->current_page));
+
+    return _cairo_surface_show_glyphs (surface->current_page, operator, source,
+				       glyphs, num_glyphs,
+				       scaled_font);
 }
 
 static const cairo_surface_backend_t cairo_ps_surface_backend = {
@@ -514,11 +574,11 @@
 
     /* Here are the drawing functions */
     
-    NULL, /* paint */
-    NULL, /* mask */
-    NULL, /* stroke */
+    _cairo_ps_surface_paint,
+    _cairo_ps_surface_mask,
+    _cairo_ps_surface_stroke,
     _cairo_ps_surface_fill,
-    NULL  /* show_glyphs */
+    _cairo_ps_surface_show_glyphs
 };
 
 static cairo_int_status_t
@@ -1379,10 +1439,83 @@
     return CAIRO_STATUS_SUCCESS;
 }
 
+/* XXX: Just stubbing this out for now. Should be able to do much
+ * better here. */
+static cairo_int_status_t
+_ps_output_paint (void			*abstract_surface,
+		  cairo_operator_t	 operator,
+		  cairo_pattern_t	*source)
+{
+    ps_output_surface_t *surface = abstract_surface;
+
+    if (pattern_operation_needs_fallback (operator, source))
+	return _ps_output_add_fallback_area (surface,
+					     0, 0,
+					     surface->parent->width,
+					     surface->parent->height);
+    
+    /* XXX: Should be able to do much better here. */
+    return _ps_output_add_fallback_area (surface,
+					 0, 0,
+					 surface->parent->width,
+					 surface->parent->height);
+}
+
+/* XXX: Just stubbing this out for now. Should be able to do much
+ * better here. */
+static cairo_int_status_t
+_ps_output_mask (void			*abstract_surface,
+		 cairo_operator_t	 operator,
+		 cairo_pattern_t	*source,
+		 cairo_pattern_t	*mask)
+{
+    ps_output_surface_t *surface = abstract_surface;
+
+    if (pattern_operation_needs_fallback (operator, source))
+	return _ps_output_add_fallback_area (surface,
+					     0, 0,
+					     surface->parent->width,
+					     surface->parent->height);
+    
+    /* XXX: Should be able to do much better here. */
+    return _ps_output_add_fallback_area (surface,
+					 0, 0,
+					 surface->parent->width,
+					 surface->parent->height);
+}
+
+/* XXX: Just stubbing this out for now. Should be able to do much
+ * better here. */
+static cairo_int_status_t
+_ps_output_stroke (void			*abstract_surface,
+		   cairo_operator_t	 operator,
+		   cairo_pattern_t	*source,
+		   cairo_path_fixed_t	*path,
+		   cairo_stroke_style_t	*style,
+		   cairo_matrix_t	*ctm,
+		   cairo_matrix_t	*ctm_inverse,
+		   double		 tolerance,
+		   cairo_antialias_t	 antialias)
+{
+    ps_output_surface_t *surface = abstract_surface;
+
+    if (pattern_operation_needs_fallback (operator, source))
+	return _ps_output_add_fallback_area (surface,
+					     0, 0,
+					     surface->parent->width,
+					     surface->parent->height);
+    
+    /* XXX: Should be able to do much better here. */
+    return _ps_output_add_fallback_area (surface,
+					 0, 0,
+					 surface->parent->width,
+					 surface->parent->height);
+}
+
 static cairo_int_status_t
 _ps_output_fill (void			*abstract_surface,
 		 cairo_operator_t	 operator,
-		 cairo_pattern_t	*pattern,
+		 cairo_pattern_t	*source,
 		 cairo_path_fixed_t	*path,
 		 cairo_fill_rule_t	 fill_rule,
 		 double			 tolerance,
@@ -1394,7 +1527,7 @@
     ps_output_path_info_t info;
     const char *ps_operator;
 
-    if (pattern_operation_needs_fallback (operator, pattern))
+    if (pattern_operation_needs_fallback (operator, source))
 	return _ps_output_add_fallback_area (surface,
 					     0, 0,
 					     surface->parent->width,
@@ -1402,7 +1535,7 @@
     _cairo_output_stream_printf (stream,
 				 "%% _ps_output_fill\n");
 
-    emit_pattern (surface->parent, pattern);
+    emit_pattern (surface->parent, source);
 
     info.output_stream = stream;
     info.has_current_point = FALSE;
@@ -1432,6 +1565,31 @@
     return status;
 }
 
+/* XXX: Just stubbing this out for now. Should be able to do much
+ * better here. */
+static cairo_int_status_t
+_ps_output_show_glyphs (void			*abstract_surface,
+			cairo_operator_t	 operator,
+			cairo_pattern_t		*source,
+			const cairo_glyph_t	*glyphs,
+			int			 num_glyphs,
+			cairo_scaled_font_t	*scaled_font)
+{
+    ps_output_surface_t *surface = abstract_surface;
+
+    if (pattern_operation_needs_fallback (operator, source))
+	return _ps_output_add_fallback_area (surface,
+					     0, 0,
+					     surface->parent->width,
+					     surface->parent->height);
+    
+    /* XXX: Should be able to do much better here. */
+    return _ps_output_add_fallback_area (surface,
+					 0, 0,
+					 surface->parent->width,
+					 surface->parent->height);
+}
+
 static const cairo_surface_backend_t ps_output_backend = {
     NULL, /* create_similar */
     _ps_output_finish,
@@ -1457,11 +1615,11 @@
 
     /* Here are the drawing functions */
     
-    NULL, /* paint */
-    NULL, /* mask */
-    NULL, /* stroke */
+    _ps_output_paint,
+    _ps_output_mask,
+    _ps_output_stroke,
     _ps_output_fill,
-    NULL  /* show_glyphs */
+    _ps_output_show_glyphs
 };
 
 static cairo_int_status_t

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.228
retrieving revision 1.229
diff -u -d -r1.228 -r1.229
--- cairoint.h	9 Nov 2005 01:16:21 -0000	1.228
+++ cairoint.h	9 Nov 2005 01:43:14 -0000	1.229
@@ -768,7 +768,7 @@
 				 cairo_operator_t	 operator,
 				 cairo_pattern_t	*source,
 				 cairo_path_fixed_t	*path,
-				 cairo_stroke_style_t	*stroke_style,
+				 cairo_stroke_style_t	*style,
 				 cairo_matrix_t		*ctm,
 				 cairo_matrix_t		*ctm_inverse,
 				 double			 tolerance,



More information about the cairo-commit mailing list