cairo_create_ naming (was Re: [cairo] API Shakeup: cairo_output_stream_t and cairo_surface_finish())

Carl Worth cworth at redhat.com
Wed May 4 13:09:00 PDT 2005


On Wed, 04 May 2005 14:02:14 -0400, Owen Taylor wrote:
> Is just not a natural one. Honestly, I think we should bite the bullet 
> and just have cairo_create().

Thanks for reminding me that this is an option. I'll start with this
approach and see if we don't miss the convenience much.

> After all, to actually make any use of your context, you'll
> have to extract the surface back out, and what you save in
> the example in elegance by not having a cairo_surface_t 
> variable is lost when you need to do:
> 
>  cairo_surface_write_png (cairo_get_target_surface (cr),
>                           ...);

There is an alternative approach to solving this problem. Øyvind made
the suggestion to completely eliminate the notion of a surface
separate from a context. In that view, write_png just becomes a
context function and the awkward construct above could simply become:

	cairo_write_png (cr);

I don't feel like I've fully grasped the implications of such an
approach. It strikes me that the distinction between using a surface
as source vs. target would get muddled. But, still, the idea may be
worth additional consideration.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050504/1a54d617/attachment.pgp


More information about the cairo mailing list