[Cairo] Suggestion for replacing cairo_copy with set_gstate.
cworth at east.isi.edu
Fri Sep 26 11:40:18 PDT 2003
On Sep 26, Bill Spitzak wrote:
> My recomendation:
The first 4 points in your recommendation match the status quo
The issue is that there is no way to replace en masse the contents of
the current graphics state inside a cairo_t. This deficiency has
already forced one user to ignore the stack inside cairo_t and
resort to maintaining a private stack of cairo_t objects created via
cairo_copy. That doesn't seem ideal.
The latest proposal eliminates cairo_copy, but if we look at its
cairo_t *copy = cairo_create ();
cairo_gstate_t *gstate = cairo_get_gstate (cr);
cairo_set_gstate (copy, gstate);
we see that there's a memory management issue with the cairo_gstate_t
object. We could add:
But I don't like that as this would be the sole cairo_gstate function,
and I also don't want to require any of the object-based APIs to be
used for any core functionality, (and this seems like a core
Perhaps instead we just want a single function to copy the graphics
state from one cairo_t to another. Perhaps drop cairo_copy and add
cairo_set_graphics_state (cr, copy);
And then if the user wants to hold on to just the graphics state, they
can just use a proxy cairo_t for that.
Does that make any sense? Hopefully I'm not talking in circles.
> cairo_pop (or whatever it is called) will do nothing if the pop pointer is
This goes to the issue of error handling. See my future email. ;-)
More information about the cairo