[cairo] Cairo is non-deterministic?

Dirk Schönberger dirk.schoenberger at sz-online.de
Tue Jan 3 11:30:16 PST 2006


> Early versions of cairo (pre 1.0) did have the path as part of the
> gstate, but we changed this to make it easier to write path-creating
> functions that can locally modify the CTM within a save/restore block.

Does this means that the CTM is evaluated only when rendering a path?
This seems to be a change to the Postscript sehmantic (don't know about
PDF), which should allow things like (sorry for the Pseudocode ;))

moveto (0, 1)
for (int i=0; i<10; i++)
{
  rotate(360/10)
  lineto (0, 1)
}

closepath()
fill()

to draw a ten-pointed star

> Not having the path as part of the gstate also reduces the amount of
> data copying needed for cairo_save quite a lot.

Agreed, but IMHO this may lead to some confusion to people which may
expect similar semantics for similar APIs. Cairo has (or had?) a
sufficiently similar API to things like Postscript, PDF or (Apple)
Coregraphics, so I think this matters.

Regards
Dirk



More information about the cairo mailing list