mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-09 18:10:25 +01:00
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:
parent
adabb18408
commit
31d0ddbf2a
4 changed files with 36 additions and 2 deletions
2
AUTHORS
2
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
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue