[cairo] reference counting vs garbage collection

Carl Worth cworth at redhat.com
Mon Jan 3 13:49:19 PST 2005


On Mon, 03 Jan 2005 15:48:09 -0500, Owen Taylor wrote:
> > > Maybe the interface to these functions is just wrong? Why don't we
> > > just have:
> > > 
> > >  cairo_image_surface_create()
> > >  [...]
> > >  cairo_image_surface_save_png()
> 
> What I'm saying is that the whole fact of having a "PNG surface" with
> a persistant FILE * is an artifact of doing the API in a weird way
> and that if we simply take advantage of being pre-1.0 and rework the API 
> to avoid that then we avoid the problem.

That sounds quite reasonable to me.

It felt a bit "wrong" to add the PNG backend code when it is really
just a single convenience function on the tail end of the image
backend. But I do think providing built-in PNG writing code is helpful,
so exporting that convenience function directly does seem reasonable
to me.

Note, however, that we would still have the FILE * problem with the
PS/PDF backends.

-Carl




More information about the cairo mailing list