[cairo] API Shakeup: cairo_current_path -> cairo_copy_path_data

Carl Worth cworth at cworth.org
Fri Mar 11 14:33:27 PST 2005


On Tue, 22 Feb 2005 16:32:55 -0500, Carl Worth wrote:
> 	typedef union {
> 	    struct {
> 	        enum {
> 	            CAIRO_PATH_MOVE_TO,
> 	            CAIRO_PATH_LINE_TO,
> 	            CAIRO_PATH_CURVE_TO,
> 	            CAIRO_PATH_CLOSE_PATH,
> 	            CAIRO_PATH_END
> 	        } type;
> 	        int length;
> 	    } header;
> 	    struct {
> 	        double x, y;
> 	    } point;
> 	} cairo_path_data_t;
>
> 	cairo_path_data_t *
> 	cairo_copy_path_data (cairo_t *cr);
>
> 	cairo_path_data_t *
> 	cairo_copy_path_data_flat (cairo_t *cr);
> 
> 	void
> 	cairo_append_path_data (cairo_t *cr,
> 				cairo_path_data_t *path_data);

I've just committed an implementation of the above along with fairly
complete documentation and a test case.

There's still a bit of cleanup that could be done here. All the code
in _cairo_gstate_interpret_path should probably be moved into
cairo_path_data.c instead. This would be easier after we drop the old
cairo_get_path calls, (though it wouldn't be hard to port them to call
cairo_copy_path_data in order to do the cleanup in the meantime).

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050311/baf392da/attachment.pgp


More information about the cairo mailing list