Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>.
  • Loading branch information
Carl Worth committed Aug 14, 2004
1 parent adabb18 commit 31d0ddb
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
2 changes: 2 additions & 0 deletions AUTHORS
@@ -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
Expand All @@ -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

Expand Down
6 changes: 6 additions & 0 deletions ChangeLog
@@ -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.
Expand Down
15 changes: 14 additions & 1 deletion src/cairo-image-surface.c
Expand Up @@ -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;
}
Expand Down
15 changes: 14 additions & 1 deletion src/cairo_image_surface.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 31d0ddb

Please sign in to comment.