[cairo-commit] xsvg/src xsvg.c,1.29,1.30
Keith Packard
commit at pdx.freedesktop.org
Thu May 12 11:35:57 PDT 2005
Committed by: keithp
Update of /cvs/cairo/xsvg/src
In directory gabe:/tmp/cvs-serv18807/src
Modified Files:
xsvg.c
Log Message:
2005-05-12 Keith Packard <keithp at keithp.com>
reviewed by: cworth
* src/xsvg.c: (main), (win_full), (win_init), (win_grow_pixmap):
Adapt to changes in the cairo API.
Clean up various valgrind-related issues.
Index: xsvg.c
===================================================================
RCS file: /cvs/cairo/xsvg/src/xsvg.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- xsvg.c 11 Apr 2005 19:24:44 -0000 1.29
+++ xsvg.c 12 May 2005 18:35:55 -0000 1.30
@@ -239,6 +239,8 @@
XCloseDisplay (dpy);
+ if (args.svg_files)
+ free (args.svg_files); /* make valgrind happy */
return 0;
}
@@ -412,6 +414,7 @@
hints->height = height;
XConfigureWindow (win->dpy, win->win, mask, &changes);
XSetWMNormalHints (win->dpy, win->win, hints);
+ XFree (hints);
}
static void
@@ -558,13 +561,13 @@
}
}
- win->cr = cairo_create ();
- surface = cairo_xlib_surface_create (dpy, win->pix, win->visual,
- CAIRO_FORMAT_ARGB32, win->cmap);
- cairo_set_target_surface (win->cr, surface);
+ surface = cairo_xlib_surface_create_for_pixmap_with_visual (dpy,
+ win->pix,
+ win->visual);
+ win->cr = cairo_create (surface);
cairo_surface_destroy (surface);
/* XXX: This probably doesn't need to be here (eventually) */
- cairo_set_rgb_color (win->cr, 1, 1, 1);
+ cairo_set_source_rgb (win->cr, 1, 1, 1);
svg_cairo_set_viewport_dimension (win->svgc, win->width, win->height);
@@ -634,9 +637,11 @@
XCopyArea(win->dpy, win->pix, new, win->gc, 0, 0, win->width, win->height, 0, 0);
XFreePixmap(win->dpy, win->pix);
win->pix = new;
- surface = cairo_xlib_surface_create (win->dpy, win->pix,
- win->visual, CAIRO_FORMAT_ARGB32, win->cmap);
- cairo_set_target_surface (win->cr, surface);
+ cairo_destroy (win->cr);
+ surface = cairo_xlib_surface_create_for_pixmap_with_visual (win->dpy,
+ win->pix,
+ win->visual);
+ win->cr = cairo_create (surface);
cairo_surface_destroy (surface);
win->needs_refresh = 1;
}
More information about the cairo-commit
mailing list