[cairo] destructor callback for image surfaces
sunmoon1997 at gmail.com
Thu Apr 27 04:44:53 PDT 2006
在 2006-04-27四的 11:43 +0200，Helge Bahmann写道：
> I would like to be able to attach a custom destructor callback function to
> Background: I am creating images within a library (from a video decoder,
> in case you are interested) and would like to expose the image data via
> cairo, both for drawing and as source patterns; the images within the
> library are reference counted themselves, and once I give out a cairo
> handle to the image data I cannot know how long the cairo surface will
> live, but I need to be notified once it is safe to dispose/reuse the image
cairo_surface_set_user_data (image, &key, image, your_destructor)?
> It is necessary to have a "closure" pointer to carry a reference to the
> containing data structure; the pointer to the raw memory area I have
> handed out is not sufficient (primarily because sometimes I hand out just
> a reference to a sub-image).
> How about the attached patch?
> Thanks and best regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 191 bytes
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060427/0c73f5a7/attachment-0001.pgp
More information about the cairo