[cairo] destructor callback for image surfaces

sunmoon1997 sunmoon1997 at gmail.com
Thu Apr 27 04:44:53 PDT 2006


在 2006-04-27四的 11:43 +0200,Helge Bahmann写道:
> Hello,
> 
> I would like to be able to attach a custom destructor callback function to
> cairo_image_surface_create_for_data
> 
> 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
> data.
 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
Type: application/pgp-signature
Size: 191 bytes
Desc: =?UTF-8?Q?=E8=BF=99=E6=98=AF=E4=BF=A1=E4=BB=B6=E7=9A=84=E6=95=B0?=
	=?UTF-8?Q?=E5=AD=97=E7=AD=BE=E5=90=8D=E9=83=A8=E5=88=86?=
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060427/0c73f5a7/attachment-0001.pgp


More information about the cairo mailing list