[Cairo] New function: cairo_copy
Carl Worth
cworth at east.isi.edu
Fri Sep 5 08:41:29 PDT 2003
Some eons ago, and two mailing lists in the past,
On Nov 21, Owen Taylor wrote:
> * Does the stack nature of XrSave/Restore really make sense
> outside the context of the Postscript language environment?
> Conceptually they are equivalent to a copy operation,
> and:
>
> XrState *local = XrStateCopy (xrs);
> /* Do stuff with local */
> XrStateDestroy (locale);
>
> is not significantly harder to type than the Save/Restore operation,
> and considerably easier to map onto a a "graphics context"
> concept.
I've just added a new cairo_copy function that allows the coding style
described by Owen above, (which is quite useful in many situations).
I did not remove cairo_save/restore however. I think these functions
are still useful for a different coding style. (And perhaps more
concretely, I want the internal stack to be around for the purpose of
the proposed push/pop_group functionality).
I think sanity still prevails. A cairo_t still maintains a stack of
graphics state objects. However, cairo_copy does not copy the stack,
but only the current graphics state.
Does anybody see any potential for problems or confusion here?
-Carl
More information about the cairo
mailing list