[cairo] [patch] subsurface: fix memory leak

Henry (Yu) Song - SISA hsong at sisa.samsung.com
Thu Jun 14 13:57:19 PDT 2012

Hi, Chris

Better idea to break cyclic referencing?



-----Original Message-----
From: Chris Wilson [mailto:chris at chris-wilson.co.uk] 
Sent: Thursday, June 14, 2012 1:50 PM
To: Henry (Yu) Song - SISA; cairo at cairographics.org
Subject: Re: [cairo] [patch] subsurface: fix memory leak

On Thu, 14 Jun 2012 20:33:35 +0000, "Henry (Yu) Song - SISA" <hsong at sisa.samsung.com> wrote:
> My question is why we need to set a subsurface is a snapshot of its target?  Theoretically, it is correct.  But no backends call _cairo_surface_subsurface_set_snapshot() except GL and XCB backends.  in GL, we do need get snapshot of a subsurface.  So this call is needed, but I don't see why we need to set the subsurface as its target's snapshot.  No backends grab its snapshot when tries to extract the source pattern.  Better ideas on preserving subsurface as snapshot of its target and break cyclic referencing?

Attaching the snaphot of the subsurface to the target is in order to tie it into the modification notification. That is if you then render to the target (possibly via the subsurface), the snapshot is detached and no longer used as the source. That mechanism needs to be preserved if the functionality is to be kept.

In the xlib backend, it is used to cache subsurfaces that require extraction from the parent surface as required to fixup extend modes.

Chris Wilson, Intel Open Source Technology Centre

More information about the cairo mailing list