[cairo-commit] 4 commits - src/cairo-clip.c src/cairo-recording-surface.c src/cairo-surface-snapshot.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Mar 24 04:39:41 PDT 2010


 src/cairo-clip.c              |    4 +++-
 src/cairo-recording-surface.c |    1 +
 src/cairo-surface-snapshot.c  |    1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit e356e5d18b923d9b0ff83e9460582710f9e515d9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Mar 24 11:38:19 2010 +0000

    recording: Fix leak of clip from snapshots of recording surfaces.

diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c
index 973b15c..a744634 100644
--- a/src/cairo-recording-surface.c
+++ b/src/cairo-recording-surface.c
@@ -184,6 +184,7 @@ _cairo_recording_surface_finish (void *abstract_surface)
 
     if (recording_surface->commands_owner) {
 	cairo_surface_destroy (recording_surface->commands_owner);
+	_cairo_clip_fini (&recording_surface->clip);
 	return CAIRO_STATUS_SUCCESS;
     }
 
commit 5b4885f693c0d800da7160770b341166e3bdea61
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Mar 24 11:25:29 2010 +0000

    clip: propagate the no-clip through the copy.

diff --git a/src/cairo-clip.c b/src/cairo-clip.c
index 8be196e..6cdb710 100644
--- a/src/cairo-clip.c
+++ b/src/cairo-clip.c
@@ -197,6 +197,7 @@ _cairo_clip_init_copy (cairo_clip_t *clip, cairo_clip_t *other)
 	}
     } else {
 	_cairo_clip_init (clip);
+	clip = NULL;
     }
 
     return clip;
commit b3e0393161904c2fea62b0198dea551a77201c19
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Mar 24 11:21:36 2010 +0000

    clip: Don't reduce all-clip to no-clip.

diff --git a/src/cairo-clip.c b/src/cairo-clip.c
index 19be812..8be196e 100644
--- a/src/cairo-clip.c
+++ b/src/cairo-clip.c
@@ -190,7 +190,8 @@ _cairo_clip_init_copy (cairo_clip_t *clip, cairo_clip_t *other)
 	clip->all_clipped = other->all_clipped;
 	if (other->path == NULL) {
 	    clip->path = NULL;
-	    clip = NULL;
+	    if (! clip->all_clipped)
+		clip = NULL;
 	} else {
 	    clip->path = _cairo_clip_path_reference (other->path);
 	}
commit b12114f296e4e8db3207ab593a431fd0ca2ee67c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Mar 24 11:08:38 2010 +0000

    snapshot: Finish the clone.
    
    Kill ref cycles from snapshots patterns by explicitly calling finish on
    the cloned surface.

diff --git a/src/cairo-surface-snapshot.c b/src/cairo-surface-snapshot.c
index cbb6aa3..629b800 100644
--- a/src/cairo-surface-snapshot.c
+++ b/src/cairo-surface-snapshot.c
@@ -47,6 +47,7 @@ _cairo_surface_snapshot_finish (void *abstract_surface)
 {
     cairo_surface_snapshot_t *surface = abstract_surface;
 
+    cairo_surface_finish (surface->clone);
     cairo_surface_destroy (surface->clone);
 
     return CAIRO_STATUS_SUCCESS;


More information about the cairo-commit mailing list