[cairo-commit] pycairo/cairo cairogtkmodule.c,1.8,1.9

Steve Chaplin commit at pdx.freedesktop.org
Sat Mar 12 02:28:20 PST 2005


Committed by: stevech1097

Update of /cvs/cairo/pycairo/cairo
In directory gabe:/tmp/cvs-serv18578/cairo

Modified Files:
	cairogtkmodule.c 
Log Message:
SC 2005/03/12

Index: cairogtkmodule.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/cairogtkmodule.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cairogtkmodule.c	2 Mar 2005 13:52:14 -0000	1.8
+++ cairogtkmodule.c	12 Mar 2005 10:28:18 -0000	1.9
@@ -128,16 +128,21 @@
 			"(ie. no alpha)");
 	return NULL;
     }
-
-    surface = cairo_surface_create_for_image(gdk_pixbuf_get_pixels(pixbuf),
+    surface = cairo_image_surface_create_for_data(
+					     gdk_pixbuf_get_pixels(pixbuf),
 					     CAIRO_FORMAT_RGB24,
 					     gdk_pixbuf_get_width(pixbuf),
 					     gdk_pixbuf_get_height(pixbuf),
 					     gdk_pixbuf_get_rowstride(pixbuf));
     if (!surface)
 	return PyErr_NoMemory();
-    /* should get surface to hold reference to pixbuf ... */
 
+    /* The output buffer (the pixbuf) must be kept around until the
+       cairo_surface_t is destroyed or cairo_surface_finish() is called on the
+       surface.  
+       TODO: surface should reference the pixbuf to keep it alive.
+             and unref when surface destroyed/finished
+     */
     return pycairo_surface_wrap(surface);
 }
 




More information about the cairo-commit mailing list