[cairo-commit] cairo-demo/kapow ChangeLog,1.2,1.3 kapow.c,1.3,1.4

Carl Worth commit at pdx.freedesktop.org
Fri Apr 1 18:06:39 PST 2005


Committed by: cworth

Update of /cvs/cairo/cairo-demo/kapow
In directory gabe:/tmp/cvs-serv22633

Modified Files:
	ChangeLog kapow.c 
Log Message:

        * kapow.c: (main): Track removal of cairo_set_target_png.


Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/cairo-demo/kapow/ChangeLog,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ChangeLog	24 Jan 2005 20:02:25 -0000	1.2
+++ ChangeLog	2 Apr 2005 02:06:37 -0000	1.3
@@ -1,3 +1,7 @@
+2005-04-01  Carl Worth  <cworth at cworth.org>
+
+	* kapow.c: (main): Track removal of cairo_set_target_png.
+
 2005-01-24  Kristian Høgsberg  <krh at redhat.com>
 
 	* kapow.c (main): Add support for runing as a CGI script.

Index: kapow.c
===================================================================
RCS file: /cvs/cairo/cairo-demo/kapow/kapow.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- kapow.c	30 Jan 2005 15:29:30 -0000	1.3
+++ kapow.c	2 Apr 2005 02:06:37 -0000	1.4
@@ -3,10 +3,10 @@
 #include <string.h>
 #include <libgen.h>
 #include <cairo.h>
-#ifdef CAIRO_HAS_PNG_SURFACE
+#ifdef CAIRO_HAS_PNG_FUNCTIONS
 #include <cairo-png.h>
 #else
-#error This program requires the PNG backend
+#error This program requires cairo with PNG support
 #endif
 #include <math.h>
 
@@ -168,8 +168,8 @@
 
     cr = cairo_create ();
 
-    cairo_set_target_png (cr, fp, CAIRO_FORMAT_ARGB32,
-			  IMAGE_WIDTH, IMAGE_HEIGHT);
+    cairo_set_target_image_no_data (cr, CAIRO_FORMAT_ARGB32,
+				    IMAGE_WIDTH, IMAGE_HEIGHT);
 
     cairo_set_line_width (cr, 2);
 
@@ -222,7 +222,7 @@
     if (query_string != NULL)
 	printf ("Content-Type: image/png\n\n");
 
-    cairo_show_page (cr);
+    cairo_surface_write_png (cairo_get_target_surface (cr), fp);
 
     cairo_destroy (cr);
     fclose (fp);




More information about the cairo-commit mailing list