[cairo-commit] cairo/src cairo-image-surface.c, 1.49,
1.50 cairo-pattern.c, 1.48, 1.49 cairo-xlib-surface.c, 1.86,
1.87 cairoint.h, 1.163, 1.164
Carl Worth
commit at pdx.freedesktop.org
Thu Jul 14 15:10:51 PDT 2005
Committed by: cworth
Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv436/src
Modified Files:
cairo-image-surface.c cairo-pattern.c cairo-xlib-surface.c
cairoint.h
Log Message:
* src/cairoint.h:
* src/cairo-pattern.c: (_cairo_pattern_release_surface): Fix to
accept a cairo_pattern_t rather than a cairo_surface_t as the
primary argument.
* src/cairo-image-surface.c: (_cairo_image_surface_composite),
(_cairo_image_surface_composite_trapezoids): Track change in
_cairo_pattern_release_surface and also pass the appropriate
pattern for each acquired surface. The previous backend mismatch
was causing memory leaks.
* src/cairo-xlib-surface.c: (_get_image_surface): Remove stale
comment.
* test/xlib-surface.c: (main): Add missing fclose to keep valgrind
happy about memory leaks.
Index: cairo-image-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-image-surface.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- cairo-image-surface.c 14 Jul 2005 18:45:39 -0000 1.49
+++ cairo-image-surface.c 14 Jul 2005 22:10:48 -0000 1.50
@@ -595,9 +595,9 @@
}
if (mask)
- _cairo_pattern_release_surface (&dst->base, &mask->base, &mask_attr);
+ _cairo_pattern_release_surface (mask_pattern, &mask->base, &mask_attr);
- _cairo_pattern_release_surface (&dst->base, &src->base, &src_attr);
+ _cairo_pattern_release_surface (src_pattern, &src->base, &src_attr);
return status;
}
@@ -674,7 +674,7 @@
render_src_y + attributes.y_offset,
(pixman_trapezoid_t *) traps, num_traps);
- _cairo_pattern_release_surface (&dst->base, &src->base, &attributes);
+ _cairo_pattern_release_surface (pattern, &src->base, &attributes);
return status;
}
Index: cairo-pattern.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pattern.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- cairo-pattern.c 8 Jul 2005 17:12:29 -0000 1.48
+++ cairo-pattern.c 14 Jul 2005 22:10:48 -0000 1.49
@@ -1409,19 +1409,24 @@
/**
* _cairo_pattern_release_surface:
* @pattern: a #cairo_pattern_t
- * @info: pointer to #cairo_surface_attributes_t filled in by
- * _cairo_pattern_acquire_surface
+ * @surface: a surface obtained by _cairo_pattern_acquire_surface
+ * @attributes: attributes obtained by _cairo_pattern_acquire_surface
*
* Releases resources obtained by _cairo_pattern_acquire_surface.
**/
void
-_cairo_pattern_release_surface (cairo_surface_t *dst,
+_cairo_pattern_release_surface (cairo_pattern_t *pattern,
cairo_surface_t *surface,
cairo_surface_attributes_t *attributes)
{
if (attributes->acquired)
{
- _cairo_surface_release_source_image (dst,
+ cairo_surface_pattern_t *surface_pattern;
+
+ assert (pattern->type == CAIRO_PATTERN_SURFACE);
+ surface_pattern = (cairo_surface_pattern_t *) pattern;
+
+ _cairo_surface_release_source_image (surface_pattern->surface,
(cairo_image_surface_t *) surface,
attributes->extra);
}
Index: cairo-xlib-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-xlib-surface.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- cairo-xlib-surface.c 8 Jul 2005 17:12:29 -0000 1.86
+++ cairo-xlib-surface.c 14 Jul 2005 22:10:48 -0000 1.87
@@ -450,7 +450,6 @@
}
/* Let the surface take ownership of the data */
- /* XXX: Can probably come up with a cleaner API here. */
_cairo_image_surface_assume_ownership_of_data (image);
ximage->data = NULL;
XDestroyImage (ximage);
Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -d -r1.163 -r1.164
--- cairoint.h 13 Jul 2005 18:34:37 -0000 1.163
+++ cairoint.h 14 Jul 2005 22:10:48 -0000 1.164
@@ -1817,7 +1817,7 @@
cairo_surface_attributes_t *attributes);
cairo_private void
-_cairo_pattern_release_surface (cairo_surface_t *dst,
+_cairo_pattern_release_surface (cairo_pattern_t *pattern,
cairo_surface_t *surface,
cairo_surface_attributes_t *attributes);
More information about the cairo-commit
mailing list