[cairo] Cairo API is all shook up (was: API Shakeup: cairo_create and eliminating cairo_set_target_surface)

Carl Worth cworth at redhat.com
Mon May 9 10:57:13 PDT 2005


On Mon, 09 May 2005 14:41:41 +1200, Robert O'Callahan wrote:
> On Sat, 2005-05-07 at 15:22 -0400, Owen Taylor wrote:
> > The only potential problem I found was that in a couple of places
> > I was using cairo_create() without a target surface as a no-op 
> > drawing target, and had to switch to creating a 1x1 image instead.

I hit the same thing in cairo/test in one spot. I didn't think much of
that usage, since the code was just setting up various incorrect usage
scenarios and testing that they in fact did trigger errors. So I
switched it to use a 1x1 image surface as well.

> > It wasn't clear if cairo_create(NULL) was meant to be legal or
> > not, and even if it is legal, it wasn't really what I wanted, 
> > since I needed to be able to read back the CTM normally.
> 
> I'm updating our code too. We create contexts with no surface to do
> measurement and hit-testing on paths, so I'd vote for some API for this.

Similarly, someone in IRC said they wanted to create an intermediate
surface for some text, which requires the size of the text first,
which requires a cairo_t, but which then requires a cairo_surface,
(which is what the user is still trying to create). So that resulted
in some user frustration as well.

Together, these two experiences suggest to me that the API is missing
something after the recent change of cairo_create. But it's not clear
to me what the right answer is.

-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/20050509/83fa9a35/attachment.pgp


More information about the cairo mailing list