[cairo] Re-working cairo_current_path (was: New little cairo
demo)
Keith Packard
keithp at keithp.com
Mon Jan 24 10:14:08 PST 2005
Around 11 o'clock on Jan 24, Carl Worth wrote:
> Keith, what was your proposed data structure for the path? A list of
> double with magic values to specify each operator?
Perhaps:
typedef union {
struct {
enum { Move, Draw, Curve } Type;
uint16_t len;
} head;
double value;
} cairo_path_elt_t;
Or is that too complicated? It seems like a feature to encode the length
of each element right into the element; it might permit the kinds of
elements to be extended in the future (and exposed in some new call)
without completely wrecking all existing code.
But, I'd support the simpler
#define CAIRO_PATH_MOVE 0.0
#define CAIRO_PATH_DRAW 1.0
#define CAIRO_PATH_CURVE 2.0
if that seems nicer.
(oh, the names above are unconsidered and should be taken only as
representative of the structure of the objects)
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050124/ac356b52/attachment.pgp
More information about the cairo
mailing list