[Commit] cairo/src cairo.c, 1.12, 1.13 cairo.h, 1.13, 1.14 cairo_gstate.c, 1.12, 1.13 cairo_path.c, 1.4, 1.5 cairoint.h, 1.17, 1.18

Carl Worth commit at keithp.com
Thu Sep 25 09:01:41 PDT 2003


Committed by: cworth

Update of /local/src/CVS/cairo/src
In directory home.keithp.com:/tmp/cvs-serv9149/src

Modified Files:
	cairo.c cairo.h cairo_gstate.c cairo_path.c cairoint.h 
Log Message:
Expose a cairo_path_t object with related functions:
cairo_set_path, cairo_current_path, cairo_path_move_to, cairo_path_line_to, etc.

Index: cairo.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- cairo.c	16 Sep 2003 13:45:20 -0000	1.12
+++ cairo.c	25 Sep 2003 15:01:38 -0000	1.13
@@ -63,7 +63,7 @@
     *cr = *cr_other;
     cr->ref_count = 0;
 
-    cr->gstate = _cairo_gstate_clone (cr_other->gstate);
+    cr->gstate = _cairo_gstate_copy (cr_other->gstate);
     if (cr->gstate == NULL)
 	cr->status = CAIRO_STATUS_NO_MEMORY;
 
@@ -105,7 +105,7 @@
 	return;
 
     if (cr->gstate) {
-	top = _cairo_gstate_clone (cr->gstate);
+	top = _cairo_gstate_copy (cr->gstate);
     } else {
 	top = _cairo_gstate_create ();
     }
@@ -548,6 +548,16 @@
 slim_hidden_def(cairo_close_path);
 
 void
+cairo_set_path (cairo_t *cr, cairo_path_t *path)
+{
+    if (cr->status)
+	return;
+
+    cr->status = _cairo_gstate_set_path (cr->gstate, path);
+}
+slim_hidden_def(cairo_set_path);
+
+void
 cairo_stroke (cairo_t *cr)
 {
     if (cr->status)
@@ -724,6 +734,12 @@
 }
 DEPRECATE (cairo_get_target_surface, cairo_current_target_surface);
 
+cairo_path_t *
+cairo_current_path (cairo_t *cr)
+{
+    return _cairo_gstate_current_path (cr->gstate);
+}
+
 cairo_status_t
 cairo_status (cairo_t *cr)
 {

Index: cairo.h
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- cairo.h	16 Sep 2003 13:45:20 -0000	1.13
+++ cairo.h	25 Sep 2003 15:01:38 -0000	1.14
@@ -39,8 +39,9 @@
 #endif
 
 typedef struct cairo cairo_t;
-typedef struct cairo_surface cairo_surface_t;
 typedef struct cairo_matrix cairo_matrix_t;
+typedef struct cairo_path cairo_path_t;
+typedef struct cairo_surface cairo_surface_t;
 
 #ifdef __cplusplus
 extern "C" {
@@ -292,6 +293,9 @@
 extern void __external_linkage
 cairo_close_path (cairo_t *cr);
 
+extern void __external_linkage
+cairo_set_path (cairo_t *cr, cairo_path_t *path);
+
 /* Painting functions */
 extern void __external_linkage
 cairo_stroke (cairo_t *cr);
@@ -387,6 +391,9 @@
 extern cairo_surface_t * __external_linkage
 cairo_current_target_surface (cairo_t *cr);
 
+extern cairo_path_t * __external_linkage
+cairo_current_path (cairo_t *cr);
+
 /* Error status queries */
 
 typedef enum cairo_status {
@@ -531,6 +538,46 @@
 extern cairo_status_t __external_linkage
 cairo_matrix_transform_point (cairo_matrix_t *matrix, double *x, double *y);
 
+/* Path functions */
+
+extern cairo_path_t * __external_linkage
+cairo_path_create (void);
+
+extern void __external_linkage
+cairo_path_destroy (cairo_path_t *path);
+
+extern cairo_status_t __external_linkage
+cairo_path_move_to (cairo_path_t *path, double x, double y);
+
+extern cairo_status_t __external_linkage
+cairo_path_line_to (cairo_path_t *path, double x, double y);
+
+extern cairo_status_t __external_linkage
+cairo_path_curve_to (cairo_path_t *path,
+		     double x1, double y1,
+		     double x2, double y2,
+		     double x3, double y3);
+
+extern cairo_status_t __external_linkage
+cairo_path_rel_move_to (cairo_path_t *path,
+			double dx, double dy);
+
+extern cairo_status_t __external_linkage
+cairo_path_rel_line_to (cairo_path_t *path,
+			double dx, double dy);
+
+extern cairo_status_t __external_linkage
+cairo_path_rel_curve_to (cairo_path_t *path,
+			 double dx1, double dy1,
+			 double dx2, double dy2,
+			 double dx3, double dy3);
+
+extern cairo_status_t __external_linkage
+cairo_path_close_path (cairo_path_t *path);
+
+extern cairo_status_t __external_linkage
+cairo_path_current_point (cairo_path_t *path, double *x_ret, double *y_ret);
+
 /* Deprecated functions. We've made some effort to allow the
    deprecated functions to continue to work for now, (with useful
    warnings). But the deprecated functions will not appear in the next

Index: cairo_gstate.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo_gstate.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- cairo_gstate.c	16 Sep 2003 13:45:20 -0000	1.12
+++ cairo_gstate.c	25 Sep 2003 15:01:38 -0000	1.13
@@ -30,9 +30,6 @@
 
 #include "cairoint.h"
 
-static void
-_cairo_gstate_set_current_pt (cairo_gstate_t *gstate, double x, double y);
-
 static cairo_status_t
 _cairo_gstate_ensure_source (cairo_gstate_t *gstate);
 
@@ -93,10 +90,6 @@
 
     _cairo_path_init (&gstate->path);
 
-    gstate->current_pt.x = 0.0;
-    gstate->current_pt.y = 0.0;
-    gstate->has_current_pt = 0;
-
     _cairo_pen_init_empty (&gstate->pen_regular);
 
     gstate->next = NULL;
@@ -181,23 +174,23 @@
     free (gstate);
 }
 
-cairo_gstate_t*
-_cairo_gstate_clone (cairo_gstate_t *gstate)
+cairo_gstate_t *
+_cairo_gstate_copy (cairo_gstate_t *other)
 {
     cairo_status_t status;
-    cairo_gstate_t *clone;
+    cairo_gstate_t *gstate;
 
-    clone = malloc (sizeof (cairo_gstate_t));
-    if (clone) {
-	status = _cairo_gstate_init_copy (clone, gstate);
+    gstate = malloc (sizeof (cairo_gstate_t));
+    if (gstate) {
+	status = _cairo_gstate_init_copy (gstate, other);
 	if (status) {
-	    free (clone);
+	    free (gstate);
 	    return NULL;
 	}
     }
-    clone->next = NULL;
+    gstate->next = NULL;
 
-    return clone;
+    return gstate;
 }
 
 /* Push rendering off to an off-screen group. */
@@ -313,6 +306,23 @@
     return gstate->surface;
 }
 
+cairo_path_t *
+_cairo_gstate_current_path (cairo_gstate_t *gstate)
+{
+    cairo_path_t *path;
+
+    if (gstate == NULL)
+	return NULL;
+
+    path = _cairo_path_copy (&gstate->path);
+    if (path == NULL)
+	return NULL;
+
+    _cairo_path_set_ctm_inverse (path, &gstate->ctm_inverse);
+
+    return path;
+}
+
 cairo_status_t
 _cairo_gstate_set_pattern (cairo_gstate_t *gstate, cairo_surface_t *pattern)
 {
@@ -637,20 +647,10 @@
     return CAIRO_STATUS_SUCCESS;
 }
 
-static void
-_cairo_gstate_set_current_pt (cairo_gstate_t *gstate, double x, double y)
-{
-    gstate->current_pt.x = x;
-    gstate->current_pt.y = y;
-
-    gstate->has_current_pt = 1;
-}
-
 cairo_status_t
 _cairo_gstate_new_path (cairo_gstate_t *gstate)
 {
     _cairo_path_fini (&gstate->path);
-    gstate->has_current_pt = 0;
 
     return CAIRO_STATUS_SUCCESS;
 }
@@ -662,13 +662,11 @@
 
     cairo_matrix_transform_point (&gstate->ctm, &x, &y);
 
-    status = _cairo_path_move_to (&gstate->path, x, y);
-
-    _cairo_gstate_set_current_pt (gstate, x, y);
-
-    gstate->last_move_pt = gstate->current_pt;
+    status = cairo_path_move_to (&gstate->path, x, y);
+    if (status)
+	return status;
 
-    return status;
+    return CAIRO_STATUS_SUCCESS;
 }
 
 cairo_status_t
@@ -678,11 +676,11 @@
 
     cairo_matrix_transform_point (&gstate->ctm, &x, &y);
 
-    status = _cairo_path_line_to (&gstate->path, x, y);
-
-    _cairo_gstate_set_current_pt (gstate, x, y);
+    status = cairo_path_line_to (&gstate->path, x, y);
+    if (status)
+	return status;
 
-    return status;
+    return CAIRO_STATUS_SUCCESS;
 }
 
 cairo_status_t
@@ -697,52 +695,30 @@
     cairo_matrix_transform_point (&gstate->ctm, &x2, &y2);
     cairo_matrix_transform_point (&gstate->ctm, &x3, &y3);
 
-    status = _cairo_path_curve_to (&gstate->path,
-				   x1, y1,
-				   x2, y2,
-				   x3, y3);
-
-    _cairo_gstate_set_current_pt (gstate, x3, y3);
+    status = cairo_path_curve_to (&gstate->path,
+				  x1, y1,
+				  x2, y2,
+				  x3, y3);
+    if (status)
+	return status;
 
-    return status;
+    return CAIRO_STATUS_SUCCESS;
 }
 
 cairo_status_t
 _cairo_gstate_rel_move_to (cairo_gstate_t *gstate, double dx, double dy)
 {
-    cairo_status_t status;
-    double x, y;
-
     cairo_matrix_transform_distance (&gstate->ctm, &dx, &dy);
 
-    x = gstate->current_pt.x + dx;
-    y = gstate->current_pt.y + dy;
-
-    status = _cairo_path_move_to (&gstate->path, x, y);
-
-    _cairo_gstate_set_current_pt (gstate, x, y);
-
-    gstate->last_move_pt = gstate->current_pt;
-
-    return status;
+    return cairo_path_rel_move_to (&gstate->path, dx, dy);
 }
 
 cairo_status_t
 _cairo_gstate_rel_line_to (cairo_gstate_t *gstate, double dx, double dy)
 {
-    cairo_status_t status;
-    double x, y;
-
     cairo_matrix_transform_distance (&gstate->ctm, &dx, &dy);
 
-    x = gstate->current_pt.x + dx;
-    y = gstate->current_pt.y + dy;
-
-    status = _cairo_path_line_to (&gstate->path, x, y);
-
-    _cairo_gstate_set_current_pt (gstate, x, y);
-
-    return status;
+    return cairo_path_rel_line_to (&gstate->path, dx, dy);
 }
 
 cairo_status_t
@@ -751,22 +727,14 @@
 			    double dx2, double dy2,
 			    double dx3, double dy3)
 {
-    cairo_status_t status;
-
     cairo_matrix_transform_distance (&gstate->ctm, &dx1, &dy1);
     cairo_matrix_transform_distance (&gstate->ctm, &dx2, &dy2);
     cairo_matrix_transform_distance (&gstate->ctm, &dx3, &dy3);
-
-    status = _cairo_path_curve_to (&gstate->path,
-				   gstate->current_pt.x + dx1, gstate->current_pt.y + dy1,
-				   gstate->current_pt.x + dx2, gstate->current_pt.y + dy2,
-				   gstate->current_pt.x + dx3, gstate->current_pt.y + dy3);
-
-    _cairo_gstate_set_current_pt (gstate,
-			  gstate->current_pt.x + dx3,
-			  gstate->current_pt.y + dy3);
-
-    return status;
+    
+    return cairo_path_rel_curve_to (&gstate->path,
+				    dx1, dy1,
+				    dx2, dy2,
+				    dx3, dy3);
 }
 
 /* XXX: NYI 
@@ -775,7 +743,6 @@
 {
     cairo_status_t status;
 
-    _cairo_pen_init (&gstate
     return CAIRO_STATUS_SUCCESS;
 }
 */
@@ -783,33 +750,52 @@
 cairo_status_t
 _cairo_gstate_close_path (cairo_gstate_t *gstate)
 {
+    return cairo_path_close_path (&gstate->path);
+}
+
+cairo_status_t
+_cairo_gstate_set_path (cairo_gstate_t *gstate, cairo_path_t *path)
+{
     cairo_status_t status;
 
-    status = _cairo_path_close_path (&gstate->path);
+    _cairo_path_fini (&gstate->path);
 
-    _cairo_gstate_set_current_pt (gstate,
-				  gstate->last_move_pt.x, 
-				  gstate->last_move_pt.y);
+    status = _cairo_path_init_copy (&gstate->path, path);
+    if (status)
+	return status;
 
-    return status;
+    _cairo_path_transform (&gstate->path, &gstate->ctm);
+
+    return CAIRO_STATUS_SUCCESS;
 }
 
 cairo_status_t
 _cairo_gstate_current_point (cairo_gstate_t *gstate, double *x_ret, double *y_ret)
 {
-    double x, y;
+    cairo_status_t status;
 
-    if (gstate->has_current_pt) {
-	x = gstate->current_pt.x;
-	y = gstate->current_pt.y;
-	cairo_matrix_transform_point (&gstate->ctm_inverse, &x, &y);
-    } else {
-	x = 0.0;
-	y = 0.0;
+    status = cairo_path_current_point (&gstate->path, x_ret, y_ret);
+    if (status == CAIRO_STATUS_NO_CURRENT_POINT) {
+	*x_ret = 0.0;
+	*y_ret = 0.0;
+	return CAIRO_STATUS_SUCCESS;
     }
 
-    *x_ret = x;
-    *y_ret = y;
+    cairo_matrix_transform_point (&gstate->ctm_inverse, x_ret, y_ret);
+
+    return CAIRO_STATUS_SUCCESS;
+}
+
+cairo_status_t
+_cairo_gstate_current_point_device (cairo_gstate_t *gstate, double *x_ret, double *y_ret)
+{
+    cairo_status_t status;
+
+    status = cairo_path_current_point (&gstate->path, x_ret, y_ret);
+    if (status == CAIRO_STATUS_NO_CURRENT_POINT) {
+	*x_ret = 0.0;
+	*y_ret = 0.0;
+    }
 
     return CAIRO_STATUS_SUCCESS;
 }
@@ -1130,17 +1116,7 @@
     if (gstate->surface->dpy == 0)
 	return CAIRO_STATUS_SUCCESS;
 
-    /* XXX: I believe this is correct, but it would be much more clear
-       to have some explicit current_point accesor functions, (one for
-       user- and one for device-space). */
-    if (gstate->has_current_pt) {
-	x = gstate->current_pt.x;
-	y = gstate->current_pt.y;
-    } else {
-	x = 0;
-	y = 0;
-	cairo_matrix_transform_point (&gstate->ctm, &x, &y);
-    }
+    _cairo_gstate_current_point_device (gstate, &x, &y);
 
     _cairo_font_resolve_xft_font (&gstate->font, gstate, &xft_font);
 

Index: cairo_path.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo_path.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cairo_path.c	1 Aug 2003 05:49:10 -0000	1.4
+++ cairo_path.c	25 Sep 2003 15:01:39 -0000	1.5
@@ -62,9 +62,43 @@
 static void
 _cairo_path_arg_buf_add (cairo_path_arg_buf_t *arg, cairo_point_t *pts, int num_pts);
 
+cairo_path_t *
+cairo_path_create (void)
+{
+    cairo_path_t *path;
+
+    path = malloc (sizeof (cairo_path_t));
+    if (path == NULL)
+	return NULL;
+
+    _cairo_path_init (path);
+
+    return path;
+}
+
+cairo_path_t *
+_cairo_path_copy (cairo_path_t *other)
+{
+    cairo_path_t *path;
+
+    path = malloc (sizeof (cairo_path_t));
+    if (path == NULL)
+	return NULL;
+
+    _cairo_path_init_copy (path, other);
+
+    return path;
+}
+
 void
 _cairo_path_init (cairo_path_t *path)
 {
+    path->current_pt.x = 0.0;
+    path->current_pt.y = 0.0;
+    path->has_current_pt = 0;
+
+    cairo_matrix_set_identity (&path->ctm_inverse);
+
     path->op_head = NULL;
     path->op_tail = NULL;
 
@@ -80,6 +114,11 @@
 
     _cairo_path_init (path);
 
+    path->current_pt = other->current_pt;
+    path->has_current_pt = other->has_current_pt;
+
+    cairo_matrix_copy (&path->ctm_inverse, &other->ctm_inverse);
+
     for (other_op = other->op_head; other_op; other_op = other_op->next) {
 	op = _cairo_path_op_buf_create ();
 	if (op == NULL) {
@@ -120,36 +159,74 @@
 	_cairo_path_arg_buf_destroy (arg);
     }
     path->arg_tail = NULL;
+
+    path->current_pt.x = 0.0;
+    path->current_pt.y = 0.0;
+    path->has_current_pt = 0;
+}
+
+void
+cairo_path_destroy (cairo_path_t *path)
+{
+    _cairo_path_fini (path);
+
+    free (path);
+}
+
+static void
+_cairo_path_set_current_pt (cairo_path_t *path, double x, double y)
+{
+    path->current_pt.x = x;
+    path->current_pt.y = y;
+
+    path->has_current_pt = 1;
 }
 
 cairo_status_t
-_cairo_path_move_to (cairo_path_t *path, double x, double y)
+cairo_path_move_to (cairo_path_t *path, double x, double y)
 {
+    cairo_status_t status;
     cairo_point_t pt;
 
     pt.x = XDoubleToFixed (x);
     pt.y = XDoubleToFixed (y);
 
-    return _cairo_path_add (path, cairo_path_op_move_to, &pt, 1);
+    status = _cairo_path_add (path, cairo_path_op_move_to, &pt, 1);
+    if (status)
+	return status;
+
+    _cairo_path_set_current_pt (path, x, y);
+
+    path->last_move_pt = path->current_pt;
+
+    return CAIRO_STATUS_SUCCESS;
 }
 
 cairo_status_t
-_cairo_path_line_to (cairo_path_t *path, double x, double y)
+cairo_path_line_to (cairo_path_t *path, double x, double y)
 {
+    cairo_status_t status;
     cairo_point_t pt;
 
     pt.x = XDoubleToFixed (x);
     pt.y = XDoubleToFixed (y);
 
-    return _cairo_path_add (path, cairo_path_op_line_to, &pt, 1);
+    status = _cairo_path_add (path, cairo_path_op_line_to, &pt, 1);
+    if (status)
+	return status;
+
+    _cairo_path_set_current_pt (path, x, y);
+
+    return CAIRO_STATUS_SUCCESS;
 }
 
 cairo_status_t
-_cairo_path_curve_to (cairo_path_t *path,
-		      double x1, double y1,
-		      double x2, double y2,
-		      double x3, double y3)
+cairo_path_curve_to (cairo_path_t *path,
+		     double x1, double y1,
+		     double x2, double y2,
+		     double x3, double y3)
 {
+    cairo_status_t status;
     cairo_point_t pt[3];
 
     pt[0].x = XDoubleToFixed (x1);
@@ -161,13 +238,102 @@
     pt[2].x = XDoubleToFixed (x3);
     pt[2].y = XDoubleToFixed (y3);
 
-    return _cairo_path_add (path, cairo_path_op_curve_to, pt, 3);
+    status = _cairo_path_add (path, cairo_path_op_curve_to, pt, 3);
+    if (status)
+	return status;
+
+    _cairo_path_set_current_pt (path, x3, y3);
+
+    return CAIRO_STATUS_SUCCESS;
 }
 
 cairo_status_t
-_cairo_path_close_path (cairo_path_t *path)
+cairo_path_rel_move_to (cairo_path_t *path,
+			 double dx, double dy)
 {
-    return _cairo_path_add (path, cairo_path_op_close_path, NULL, 0);
+    return cairo_path_move_to (path,
+			       path->current_pt.x + dx,
+			       path->current_pt.y + dy);
+}
+
+cairo_status_t
+cairo_path_rel_line_to (cairo_path_t *path,
+			 double dx, double dy)
+{
+    return cairo_path_line_to (path,
+			       path->current_pt.x + dx,
+			       path->current_pt.y + dy);
+}
+
+cairo_status_t
+cairo_path_rel_curve_to (cairo_path_t *path,
+			 double dx1, double dy1,
+			 double dx2, double dy2,
+			 double dx3, double dy3)
+{
+    return cairo_path_curve_to (path,
+				path->current_pt.x + dx1, path->current_pt.y + dy1,
+				path->current_pt.x + dx2, path->current_pt.y + dy2,
+				path->current_pt.x + dx3, path->current_pt.y + dy3);
+}
+
+cairo_status_t
+cairo_path_close_path (cairo_path_t *path)
+{
+    cairo_status_t status;
+
+    status = _cairo_path_add (path, cairo_path_op_close_path, NULL, 0);
+    if (status)
+	return status;
+
+    _cairo_path_set_current_pt (path,
+				path->last_move_pt.x, 
+				path->last_move_pt.y);
+
+    return CAIRO_STATUS_SUCCESS;
+}
+
+cairo_status_t
+cairo_path_current_point (cairo_path_t *path, double *x_ret, double *y_ret)
+{
+    if (! path->has_current_pt)
+	return CAIRO_STATUS_NO_CURRENT_POINT;
+
+    *x_ret = path->current_pt.x;
+    *y_ret = path->current_pt.y;
+
+    return CAIRO_STATUS_SUCCESS;
+}
+
+cairo_status_t
+_cairo_path_set_ctm_inverse (cairo_path_t *path, cairo_matrix_t *ctm_inverse)
+{
+    cairo_matrix_copy (&path->ctm_inverse, ctm_inverse);
+
+    return CAIRO_STATUS_SUCCESS;
+}
+
+cairo_status_t
+_cairo_path_transform (cairo_path_t *path, cairo_matrix_t *matrix)
+{
+    cairo_matrix_t transform;
+    cairo_path_arg_buf_t *arg_buf;
+    int i;
+
+    cairo_matrix_multiply (&transform, matrix, &path->ctm_inverse);
+
+    for (arg_buf = path->arg_head; arg_buf; arg_buf = arg_buf->next) {
+	for (i = 0; i < arg_buf->num_pts; i++) {
+	    double x, y;
+	    x = _cairo_fixed_to_double (arg_buf->pt[i].x);
+	    y = _cairo_fixed_to_double (arg_buf->pt[i].y);
+	    cairo_matrix_transform_point (matrix, &x, &y);
+	    arg_buf->pt[i].x = _cairo_fixed_from_double (x);
+	    arg_buf->pt[i].y = _cairo_fixed_from_double (y);
+	}
+    }
+
+    return CAIRO_STATUS_SUCCESS;
 }
 
 static cairo_status_t

Index: cairoint.h
===================================================================
RCS file: /local/src/CVS/cairo/src/cairoint.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- cairoint.h	16 Sep 2003 13:45:20 -0000	1.17
+++ cairoint.h	25 Sep 2003 15:01:39 -0000	1.18
@@ -132,6 +132,10 @@
     cairo_int_status_degenerate = 1000
 } cairo_int_status_t;
 
+struct cairo_matrix {
+    double m[3][2];
+};
+
 typedef enum cairo_path_op {
     cairo_path_op_move_to = 0,
     cairo_path_op_line_to = 1,
@@ -172,13 +176,19 @@
     struct cairo_path_arg_buf *next, *prev;
 } cairo_path_arg_buf_t;
 
-typedef struct cairo_path {
+struct cairo_path {
+    cairo_point_double_t last_move_pt;
+    cairo_point_double_t current_pt;
+    int has_current_pt;
+
+    cairo_matrix_t ctm_inverse;
+
     cairo_path_op_buf_t *op_head;
     cairo_path_op_buf_t *op_tail;
 
     cairo_path_arg_buf_t *arg_head;
     cairo_path_arg_buf_t *arg_tail;
-} cairo_path_t;
+};
 
 typedef struct cairo_edge {
     cairo_line_t edge;
@@ -285,10 +295,6 @@
     unsigned short alpha_short;
 } cairo_color_t;
 
-struct cairo_matrix {
-    double m[3][2];
-};
-
 typedef struct cairo_traps {
     cairo_trapezoid_t *traps;
     int num_traps;
@@ -360,10 +366,6 @@
 
     cairo_path_t path;
 
-    cairo_point_double_t last_move_pt;
-    cairo_point_double_t current_pt;
-    int has_current_pt;
-
     cairo_pen_t pen_regular;
 
     struct cairo_gstate *next;
@@ -410,7 +412,7 @@
 _cairo_gstate_destroy (cairo_gstate_t *gstate);
 
 extern cairo_gstate_t * __internal_linkage
-_cairo_gstate_clone (cairo_gstate_t *gstate);
+_cairo_gstate_copy (cairo_gstate_t *other);
 
 extern cairo_status_t __internal_linkage
 _cairo_gstate_begin_group (cairo_gstate_t *gstate);
@@ -433,6 +435,9 @@
 extern cairo_surface_t * __internal_linkage
 _cairo_gstate_current_target_surface (cairo_gstate_t *gstate);
 
+extern cairo_path_t * __internal_linkage
+_cairo_gstate_current_path (cairo_gstate_t *gstate);
+
 extern cairo_status_t __internal_linkage
 _cairo_gstate_set_pattern (cairo_gstate_t *gstate, cairo_surface_t *pattern);
 
@@ -569,9 +574,15 @@
 extern cairo_status_t __internal_linkage
 _cairo_gstate_close_path (cairo_gstate_t *gstate);
 
+cairo_status_t
+_cairo_gstate_set_path (cairo_gstate_t *gstate, cairo_path_t *path);
+
 extern cairo_status_t __internal_linkage
 _cairo_gstate_current_point (cairo_gstate_t *gstate, double *x, double *y);
 
+cairo_status_t
+_cairo_gstate_current_point_device (cairo_gstate_t *gstate, double *x_ret, double *y_ret);
+
 extern cairo_status_t __internal_linkage
 _cairo_gstate_stroke (cairo_gstate_t *gstate);
 
@@ -649,6 +660,9 @@
 _cairo_font_resolve_xft_font (cairo_font_t *font, cairo_gstate_t *gstate, XftFont **xft_font);
 
 /* cairo_path.c */
+extern cairo_path_t * __internal_linkage
+_cairo_path_copy (cairo_path_t *other);
+
 extern void __internal_linkage
 _cairo_path_init (cairo_path_t *path);
 
@@ -659,21 +673,6 @@
 _cairo_path_fini (cairo_path_t *path);
 
 extern cairo_status_t __internal_linkage
-_cairo_path_move_to (cairo_path_t *path, double x, double y);
-
-extern cairo_status_t __internal_linkage
-_cairo_path_line_to (cairo_path_t *path, double x, double y);
-
-extern cairo_status_t __internal_linkage
-_cairo_path_curve_to (cairo_path_t *path,
-		      double x1, double y1,
-		      double x2, double y2,
-		      double x3, double y3);
-
-extern cairo_status_t __internal_linkage
-_cairo_path_close_path (cairo_path_t *path);
-
-extern cairo_status_t __internal_linkage
 _cairo_path_interpret (cairo_path_t *path,
 		       cairo_path_direction_t dir,
 		       const cairo_path_callbacks_t *cb,
@@ -682,6 +681,12 @@
 extern cairo_status_t __internal_linkage
 _cairo_path_bounds (cairo_path_t *path, double *x1, double *y1, double *x2, double *y2);
 
+cairo_status_t
+_cairo_path_set_ctm_inverse (cairo_path_t *path, cairo_matrix_t *ctm_inverse);
+
+cairo_status_t
+_cairo_path_transform (cairo_path_t *path, cairo_matrix_t *matrix);
+
 /* cairo_path_fill.c */
 extern cairo_status_t __internal_linkage
 _cairo_path_fill_to_traps (cairo_path_t *path, cairo_gstate_t *gstate, cairo_traps_t *traps);
@@ -866,6 +871,7 @@
 /* Avoid unnecessary PLT entries.  */
 
 slim_hidden_proto(cairo_close_path)
+slim_hidden_proto(cairo_set_path)
 slim_hidden_proto(cairo_matrix_copy)
 slim_hidden_proto(cairo_matrix_invert)
 slim_hidden_proto(cairo_matrix_multiply)




More information about the Commit mailing list