[cairo] semantics of cairo_copy()

Bill Spitzak spitzak at d2.com
Tue Jan 18 16:48:43 PST 2005



Carl Worth wrote:

> This is another area I want to clean up in the API. Currently, setting
> a new target device is a poorly specified operation. Does it reset the
> current transformation matrix? Does it reset everything in the
> graphics state?

Yes, please reset the default matrix and no clip! Do this even if the 
new target device is the same one as before.

> There was a recent proposal to pull the path out of the graphics
> state. If we do that, we might also pull the target device out. And at
> that point it may make sense to distinct save/restore, (for
> everything) and gsave/grestore (for just the graphics state), like
> PostScript has.

Yes, please leave the path unchanged by gsave/grestore. This will allow 
the transformation to be changed, more of the path built, and then 
restored. This will allow many programs to use the Cairo transformation 
for their drawing, currently they are forced to do their own 
transformations because they don't want the line thickness to change. (a 
better idea would be to keep the line thickness in the CTM that was in 
existence when it was set, but I think your problem with that is that it 
is incompatable with PostScript and PDF?)

The fill+stroke problem can be solved by not actually clearing the path 
after a fill until the next path-construction operator. Ie you can build 
a path and fill and stroke it as many times as you want.



More information about the cairo mailing list