Make a copy of the region since pixman is currently taking ownership of it (ugh). Thanks to Vladimir Vukicevic <vladimir@pobox.com> and Peter Dennis Bartok <peter@novonyx.com>.

This commit is contained in:
Carl Worth 2004-08-14 07:21:52 +00:00
parent adabb18408
commit 31d0ddbf2a
4 changed files with 36 additions and 2 deletions

View file

@ -1,4 +1,5 @@
Olivier Andrieu <oliv__a@users.sourceforge.net> PNG backend
Peter Dennis Bartok <peter@novonyx.com> Bug fix for clipping
Dave Beckett <dave.beckett@bristol.ac.uk> Track rename of libpixman, build fixes
Andrew Chant <andrew.chant@utoronto.ca> Adding const where needed
John Ellson <ellson@research.att.com> First font/glyph extents functions
@ -13,6 +14,7 @@ David Reveman <davidr@freedesktop.org> New pattern API, OpenGL backend
Jamey Sharp <jamey@minilop.net> Surface/font backend virtualization, XCB backend
Bill Spitzak <spitzak@d2.com> Build fix to find Xrender.h without xrender.pc
Sasha Vasko <sasha@aftercode.net> Build fix to compile without xlib backend
Vladimir Vukicevic <vladimir@pobox.com> Bug fix for clipping
Carl Worth <cworth@isi.edu> Original library, support for paths, images
Richard D. Worth <richard@theworths.org> Build fixes for cygwin

View file

@ -1,5 +1,11 @@
2004-08-14 Carl Worth <cworth@isi.edu>
* src/cairo_image_surface.c
(_cairo_image_surface_set_clip_region): Make a copy of the region
since pixman is currently taking ownership of it (ugh). Thanks to
Vladimir Vukicevic <vladimir@pobox.com> and Peter Dennis Bartok
<peter@novonyx.com>.
* autogen.sh (LANG): Explicitly set LANG=C to fix the awk
string->number conversion for user with locales that don't match
ASCII digit conventions.

View file

@ -455,7 +455,20 @@ cairo_int_status_t
_cairo_image_surface_set_clip_region (cairo_image_surface_t *surface,
pixman_region16_t *region)
{
pixman_image_set_clip_region (surface->pixman_image, region);
if (region) {
pixman_region16_t *rcopy;
rcopy = pixman_region_create();
/* pixman_image_set_clip_region expects to take ownership of the
* passed-in region, so we create a copy to give it. */
/* XXX: I think that's probably a bug in pixman. But its
* memory management issues need auditing anyway, so a
* workaround like this is fine for now. */
pixman_region_copy (rcopy, region);
pixman_image_set_clip_region (surface->pixman_image, rcopy);
} else {
pixman_image_set_clip_region (surface->pixman_image, region);
}
return CAIRO_STATUS_SUCCESS;
}

View file

@ -455,7 +455,20 @@ cairo_int_status_t
_cairo_image_surface_set_clip_region (cairo_image_surface_t *surface,
pixman_region16_t *region)
{
pixman_image_set_clip_region (surface->pixman_image, region);
if (region) {
pixman_region16_t *rcopy;
rcopy = pixman_region_create();
/* pixman_image_set_clip_region expects to take ownership of the
* passed-in region, so we create a copy to give it. */
/* XXX: I think that's probably a bug in pixman. But its
* memory management issues need auditing anyway, so a
* workaround like this is fine for now. */
pixman_region_copy (rcopy, region);
pixman_image_set_clip_region (surface->pixman_image, rcopy);
} else {
pixman_image_set_clip_region (surface->pixman_image, region);
}
return CAIRO_STATUS_SUCCESS;
}