[Commit] cairo/src cairo_surface.c,1.6,1.7

Carl Worth commit at keithp.com
Mon Sep 15 08:29:47 PDT 2003


Committed by: cworth

Update of /local/src/CVS/cairo/src
In directory home.keithp.com:/tmp/cvs-serv4714/src

Modified Files:
	cairo_surface.c 
Log Message:
Don't try to create depth-32 pixmaps on non-Render servers.
Fix massive memory leask in _cairo_surface_push_image.

Index: cairo_surface.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo_surface.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cairo_surface.c	10 Sep 2003 00:38:10 -0000	1.6
+++ cairo_surface.c	15 Sep 2003 14:29:45 -0000	1.7
@@ -256,7 +256,14 @@
     cairo_surface_t *surface = NULL;
     cairo_color_t color;
 
-    if (other->dpy) {
+    /* XXX: There's a pretty lame heuristic here. This assumes that
+     * all non-Render X servers do not support depth-32 pixmaps, (and
+     * that they do support depths 1, 8, and 24). Obviously, it would
+     * be much better to check the depths that are actually
+     * supported. */
+    if (other->dpy
+	&& (CAIRO_SURFACE_RENDER_HAS_COMPOSITE (other)
+	    || format != CAIRO_FORMAT_ARGB32)) {
 	Display *dpy = other->dpy;
 	int scr = DefaultScreen (dpy);
 
@@ -458,9 +465,6 @@
 	       surface->width,
 	       surface->height);
 
-    /* Foolish XDestroyImage thinks it can free my data, but I won't
-       stand for it. */
-    surface->ximage->data = NULL;
     XDestroyImage(surface->ximage);
     surface->ximage = NULL;
 }




More information about the Commit mailing list