[cairo-commit] cairo/src cairo-pdf-surface.c, 1.75, 1.76 cairo-pdf.h, 1.14, 1.15 cairo-ps-surface.c, 1.70, 1.71 cairo-ps.h, 1.10, 1.11

Carl Worth commit at pdx.freedesktop.org
Thu Jan 19 17:48:25 PST 2006


Committed by: cworth

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

Modified Files:
	cairo-pdf-surface.c cairo-pdf.h cairo-ps-surface.c cairo-ps.h 
Log Message:
2006-01-19  Carl Worth  <cworth at cworth.org>

        * src/cairo-pdf.h:
        * src/cairo-pdf-surface.c:
        (_cairo_pdf_surface_create_for_stream_internal),
        (cairo_pdf_surface_create_for_stream), (cairo_pdf_surface_create):
        * src/cairo-ps.h:
        * src/cairo-ps-surface.c:
        (_cairo_ps_surface_create_for_stream_internal),
        (cairo_ps_surface_create), (cairo_ps_surface_create_for_stream):

        Rip the cairo_content_t argument out of ps/pdf_surface_create as
        per discussion on cairo mailing list. Instead these surface will
        behave as if CONTENT_COLOR_ALPHA had been passed (that is,
        compositing operators will behave as if destination alpha were
        available).

        This also has the benefit of preserving the API that has been in
        place for PS/PDF surface since the (experimental) stuff in 1.0.0.

        * test/cairo-test.c: (create_ps_surface), (create_pdf_surface):
        * test/multi-page.c: (main): Track API change.

        * test/cairo-test.c: (ps_surface_write_to_png),
        (pdf_surface_write_to_png): Continue testing PS/PDF surfaces in
        the CAIRO_CONTENT_COLOR mode but do it by rendering to an
        intermediate similar surface rather than constructing the target
        surface differently.


Index: cairo-pdf-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pdf-surface.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- cairo-pdf-surface.c	19 Jan 2006 00:44:19 -0000	1.75
+++ cairo-pdf-surface.c	20 Jan 2006 01:48:22 -0000	1.76
@@ -287,7 +287,6 @@
 
 static cairo_surface_t *
 _cairo_pdf_surface_create_for_stream_internal (cairo_output_stream_t	*stream,
-					       cairo_content_t		 content,
 					       double			 width,
 					       double			 height)
 {
@@ -305,27 +304,21 @@
     document->owner = target;
     _cairo_pdf_document_destroy (document);
 
-    return _cairo_paginated_surface_create (target, content, width, height);
+    return _cairo_paginated_surface_create (target,
+					    CAIRO_CONTENT_COLOR_ALPHA,
+					    width, height);
 }
 
 /**
  * cairo_pdf_surface_create_for_stream:
  * @write: a #cairo_write_func_t to accept the output data
  * @closure: the closure argument for @write
- * @content: CAIRO_CONTENT_COLOR_ALPHA or CAIRO_CONTENT_COLOR
  * @width_in_points: width of the surface, in points (1 point == 1/72.0 inch)
  * @height_in_points: height of the surface, in points (1 point == 1/72.0 inch)
  * 
  * Creates a PDF surface of the specified size in points to be written
  * incrementally to the stream represented by @write and @closure.
  *
- * The @content argument is used to specify whether the rendering
- * semantics should behave as if destination alpha is available. The
- * expectation is that the value for @content will be selected to
- * achieve consistent results with a display surface that either has
- * or does not have destination alpha (for example,
- * CAIRO_FORMAT_ARGB32 vs. CAIRO_FORMAT_RGB24).
- * 
  * Return value: a pointer to the newly created surface. The caller
  * owns the surface and should call cairo_surface_destroy when done
  * with it.
@@ -337,7 +330,6 @@
 cairo_surface_t *
 cairo_pdf_surface_create_for_stream (cairo_write_func_t		 write,
 				     void			*closure,
-				     cairo_content_t		 content,
 				     double			 width_in_points,
 				     double			 height_in_points)
 {
@@ -349,7 +341,7 @@
 	return (cairo_surface_t*) &_cairo_surface_nil;
     }
 
-    return _cairo_pdf_surface_create_for_stream_internal (stream, content,
+    return _cairo_pdf_surface_create_for_stream_internal (stream,
 							  width_in_points,
 							  height_in_points);
 }
@@ -357,19 +349,11 @@
 /**
  * cairo_pdf_surface_create:
  * @filename: a filename for the PDF output (must be writable)
- * @content: CAIRO_CONTENT_COLOR_ALPHA or CAIRO_CONTENT_COLOR
  * @width_in_points: width of the surface, in points (1 point == 1/72.0 inch)
  * @height_in_points: height of the surface, in points (1 point == 1/72.0 inch)
  * 
  * Creates a PDF surface of the specified size in points to be written
  * to @filename.
- *
- * The @content argument is used to specify whether the rendering
- * semantics should behave as if destination alpha is available. The
- * expectation is that the value for @content will be selected to
- * achieve consistent results with a display surface that either has
- * or does not have destination alpha (for example,
- * CAIRO_FORMAT_ARGB32 vs. CAIRO_FORMAT_RGB24).
  * 
  * Return value: a pointer to the newly created surface. The caller
  * owns the surface and should call cairo_surface_destroy when done
@@ -381,7 +365,6 @@
  **/
 cairo_surface_t *
 cairo_pdf_surface_create (const char		*filename,
-			  cairo_content_t	 content,
 			  double		 width_in_points,
 			  double		 height_in_points)
 {
@@ -393,7 +376,7 @@
 	return (cairo_surface_t*) &_cairo_surface_nil;
     }
 
-    return _cairo_pdf_surface_create_for_stream_internal (stream, content,
+    return _cairo_pdf_surface_create_for_stream_internal (stream,
 							  width_in_points,
 							  height_in_points);
 }

Index: cairo-pdf.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pdf.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- cairo-pdf.h	19 Jan 2006 00:40:17 -0000	1.14
+++ cairo-pdf.h	20 Jan 2006 01:48:22 -0000	1.15
@@ -45,14 +45,12 @@
 
 cairo_public cairo_surface_t *
 cairo_pdf_surface_create (const char		*filename,
-			  cairo_content_t	 content,
 			  double		 width_in_points,
 			  double		 height_in_points);
 
 cairo_public cairo_surface_t *
 cairo_pdf_surface_create_for_stream (cairo_write_func_t	write_func,
 				     void	       *closure,
-				     cairo_content_t	content,
 				     double		width_in_points,
 				     double		height_in_points);
 

Index: cairo-ps-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ps-surface.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- cairo-ps-surface.c	19 Jan 2006 00:40:17 -0000	1.70
+++ cairo-ps-surface.c	20 Jan 2006 01:48:23 -0000	1.71
@@ -122,7 +122,6 @@
 
 static cairo_surface_t *
 _cairo_ps_surface_create_for_stream_internal (cairo_output_stream_t *stream,
-					      cairo_content_t	     content,
 					      double		     width,
 					      double		     height)
 {
@@ -157,26 +156,19 @@
     _cairo_ps_surface_emit_header (surface);
 
     return _cairo_paginated_surface_create (&surface->base,
-					    content, width, height);
+					    CAIRO_CONTENT_COLOR_ALPHA,
+					    width, height);
 }
 
 /**
  * cairo_ps_surface_create:
  * @filename: a filename for the PS output (must be writable)
- * @content: CAIRO_CONTENT_COLOR_ALPHA or CAIRO_CONTENT_COLOR
  * @width_in_points: width of the surface, in points (1 point == 1/72.0 inch)
  * @height_in_points: height of the surface, in points (1 point == 1/72.0 inch)
  * 
  * Creates a PostScript surface of the specified size in points to be
  * written to @filename.
  *
- * The @content argument is used to specify whether the rendering
- * semantics should behave as if destination alpha is available. The
- * expectation is that the value for @content will be selected to
- * achieve consistent results with a display surface that either has
- * or does not have destination alpha (for example,
- * CAIRO_FORMAT_ARGB32 vs. CAIRO_FORMAT_RGB24).
- * 
  * Return value: a pointer to the newly created surface. The caller
  * owns the surface and should call cairo_surface_destroy when done
  * with it.
@@ -187,7 +179,6 @@
  **/
 cairo_surface_t *
 cairo_ps_surface_create (const char		*filename,
-			 cairo_content_t	 content,
 			 double			 width_in_points,
 			 double			 height_in_points)
 {
@@ -200,7 +191,6 @@
     }
 
     return _cairo_ps_surface_create_for_stream_internal (stream,
-							 content,
 							 width_in_points,
 							 height_in_points);
 }
@@ -209,7 +199,6 @@
  * cairo_ps_surface_create_for_stream:
  * @write: a #cairo_write_func_t to accept the output data
  * @closure: the closure argument for @write
- * @content: CAIRO_CONTENT_COLOR_ALPHA or CAIRO_CONTENT_COLOR
  * @width_in_points: width of the surface, in points (1 point == 1/72.0 inch)
  * @height_in_points: height of the surface, in points (1 point == 1/72.0 inch)
  * 
@@ -217,13 +206,6 @@
  * written incrementally to the stream represented by @write and
  * @closure.
  *
- * The @content argument is used to specify whether the rendering
- * semantics should behave as if destination alpha is available. The
- * expectation is that the value for @content will be selected to
- * achieve consistent results with a display surface that either has
- * or does not have destination alpha (for example,
- * CAIRO_FORMAT_ARGB32 vs. CAIRO_FORMAT_RGB24).
- * 
  * Return value: a pointer to the newly created surface. The caller
  * owns the surface and should call cairo_surface_destroy when done
  * with it.
@@ -235,7 +217,6 @@
 cairo_surface_t *
 cairo_ps_surface_create_for_stream (cairo_write_func_t	write_func,
 				    void	       *closure,
-				    cairo_content_t	content,
 				    double		width_in_points,
 				    double		height_in_points)
 {
@@ -248,7 +229,6 @@
     }
 
     return _cairo_ps_surface_create_for_stream_internal (stream,
-							 content,
 							 width_in_points,
 							 height_in_points);
 }

Index: cairo-ps.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ps.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cairo-ps.h	19 Jan 2006 00:40:17 -0000	1.10
+++ cairo-ps.h	20 Jan 2006 01:48:23 -0000	1.11
@@ -49,14 +49,12 @@
 
 cairo_public cairo_surface_t *
 cairo_ps_surface_create (const char		*filename,
-			 cairo_content_t	 content,
 			 double			 width_in_points,
 			 double			 height_in_points);
 
 cairo_public cairo_surface_t *
 cairo_ps_surface_create_for_stream (cairo_write_func_t	write_func,
 				    void	       *closure,
-				    cairo_content_t	content,
 				    double		width_in_points,
 				    double		height_in_points);
 



More information about the cairo-commit mailing list