Changed cairo_copy to copy graphics state from one cairo_t to another rather than allocating a new cairo_t.

This commit is contained in:
Carl Worth 2003-09-30 11:39:07 +00:00
parent 6b582a836a
commit 0cd47881bd
4 changed files with 22 additions and 23 deletions

View file

@ -1,5 +1,12 @@
2003-09-30 Carl Worth <cworth@east.isi.edu>
* configure.in: Bumped version to 0.1.7 to indicate change in
cairo_copy.
* src/cairo.c (cairo_copy): Changed cairo_copy to copy graphics
state from one cairo_t to another rather than allocating a new
cairo_t.
* src/cairo_surface.c (cairo_surface_destroy):
(cairo_surface_create_similar_solid): Fix to delay XFreePixmap
until cairo_surface_destroy.

View file

@ -3,7 +3,7 @@ AC_INIT(src/cairo.h)
dnl ===========================================================================
# Package version number, (as distinct from shared library version)
CAIRO_VERSION=0.1.6
CAIRO_VERSION=0.1.7
# libtool shared library version

View file

@ -51,25 +51,6 @@ cairo_create (void)
return cr;
}
cairo_t *
cairo_copy (cairo_t *cr_other)
{
cairo_t *cr;
cr = malloc (sizeof (cairo_t));
if (cr == NULL)
return NULL;
*cr = *cr_other;
cr->ref_count = 0;
cr->gstate = _cairo_gstate_clone (cr_other->gstate);
if (cr->gstate == NULL)
cr->status = CAIRO_STATUS_NO_MEMORY;
return cr;
}
void
cairo_reference (cairo_t *cr)
{
@ -138,6 +119,17 @@ cairo_restore (cairo_t *cr)
}
slim_hidden_def(cairo_restore);
void
cairo_copy (cairo_t *dest, cairo_t *src)
{
*dest = *src;
dest->ref_count = 0;
dest->gstate = _cairo_gstate_clone (src->gstate);
if (dest->gstate == NULL)
dest->status = CAIRO_STATUS_NO_MEMORY;
}
/* XXX: I want to rethink this API
void
cairo_push_group (cairo_t *cr)

View file

@ -50,9 +50,6 @@ extern "C" {
extern cairo_t * __external_linkage
cairo_create (void);
extern cairo_t * __external_linkage
cairo_copy (cairo_t *cr_other);
extern void __external_linkage
cairo_reference (cairo_t *cr);
@ -65,6 +62,9 @@ cairo_save (cairo_t *cr);
extern void __external_linkage
cairo_restore (cairo_t *cr);
extern void __external_linkage
cairo_copy (cairo_t *dest, cairo_t *src);
/* XXX: I want to rethink this API
extern void __external_linkage
cairo_push_group (cairo_t *cr);