[cairo] reference counting vs garbage collection

Kristian Høgsberg krh at bitplanet.net
Mon Jan 3 12:58:52 PST 2005


Keith Packard wrote:
> Around 13 o'clock on Jan 3, 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()
> 
> 
> cairo provides 'cairo_show_page' and 'cairo_copy_page' entry points which
> perform this task for png files.  The problem here is that when a png file
> is closed without the application having first called copy_page or
> show_page, cairo automatically calls copy_page to dump the image to the
> file.  

Are you saying that for the PNG surface you must call show_page to have 
the drawing show up on the surface?  Is that the sematics we want?  My 
impression was that, conceptually, the drawing show up as you paint and 
no further action is required to make it appear.  That is the case with 
the Xlib surface anyway.  Also, I don't think its a good idea to 
"overload" show_page in this way - show_page should introduce a new 
blank page in a paginated backend and be a no-op for single-page media.

cheers,
Kristian



More information about the cairo mailing list