[cairo] API Shakeup: cairo_current_matrix

Robert O'Callahan rocallahan at novell.com
Thu Jun 16 10:51:11 PDT 2005


On Thu, 2005-06-16 at 13:43 -0700, Bill Spitzak wrote:
> It is probably best to document that *all* Cairo calls may change the 
> matrix. It is only good until the next call to the same cairo_t. I'm 
> pretty certain the users of Cairo will be smart enough to copy the 
> matrix and not just store the pointer.
> 
> I much prefer the pointer design. I don't care how fast the processor 
> can do it or how proper the design is, copying is slower than passing 
> the pointer around by an amount that is not zero. A slower 
> implementation is fine if it makes the API easier and cleaner to use, 
> but this is not the case here.

Well, it's Carl's call, just keep in mind the burden this places on
users to avoid things like

draw_some_cairo_stuff(cr, cairo_get_matrix(cr));

A syntactically simpler API is not always the easiest.

Rob




More information about the cairo mailing list