[cairo] cairo as an immediate base for retained API and
cworth at east.isi.edu
Wed Jul 21 18:50:58 PDT 2004
On Wed, 21 Jul 2004 21:06:55 -0400 (EDT), "viczh" wrote:
> I just wanted to understand logic behind this decision to keep
> implicit paths in graphic state and have gsave/grestore.
When you want to draw something in cairo, you provide the path data and
ask it to be drawn. We can certainly add something like explicit paths,
(or maybe just a way to hand cairo an array of vertices in a single
function call as has been proposed), but we plan to wait until the
performance demands of a real application prove it is necessary.
The motivation for avoiding this is semantic clarity. As soon as the
user has a "path object" the user might expect various bits of the
graphics state to belong to the path, (current transform, color, etc.),
which could lead to confusion.
I don't see how the existence of cairo_save/restore have any bearing on
the issue of explicit paths at all. The use of these functions are not
strictly necessary, and there will always be a way to copy the graphics
state from one cairo_t to another without using the implicit stack of
cairo_save/restore. (Today this is with cairo_copy but we may introduce
a separate cairo_gstate_t object to capture that instead.)
Does that help explain where we're at?
More information about the cairo