[cairo-commit] cairo/src cairo-path-data-private.h, 1.4, 1.5 cairo-path-data.c, 1.3, 1.4 cairo.c, 1.93, 1.94

Owen Taylor commit at pdx.freedesktop.org
Tue May 10 20:45:57 PDT 2005


Committed by: otaylor

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv23547/src

Modified Files:
	cairo-path-data-private.h cairo-path-data.c cairo.c 
Log Message:
2005-05-10  Owen Taylor  <otaylor at redhat.com>

        * src/cairo.c src/cairo-path-data.c src/cairo-path-data-private.h:
        Pass the gstate to _cairo_path_data_create[_flat] and use
        _cairo_gstate_backend_to_user() so as to properly handle
        the surface device offset.


Index: cairo-path-data-private.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-path-data-private.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cairo-path-data-private.h	26 Apr 2005 19:38:06 -0000	1.4
+++ cairo-path-data-private.h	11 May 2005 03:45:55 -0000	1.5
@@ -42,13 +42,11 @@
 
 cairo_path_t *
 _cairo_path_data_create (cairo_path_fixed_t *path,
-			 cairo_matrix_t	    *ctm_inverse,
-			 double		     tolerance);
+			 cairo_gstate_t     *gstate);
 
 cairo_path_t *
 _cairo_path_data_create_flat (cairo_path_fixed_t *path,
-			      cairo_matrix_t	 *ctm_inverse,
-			      double		  tolerance);
+			      cairo_gstate_t     *gstate);
 
 cairo_status_t
 _cairo_path_data_append_to_context (cairo_path_t *path,

Index: cairo-path-data.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-path-data.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cairo-path-data.c	26 Apr 2005 19:38:06 -0000	1.3
+++ cairo-path-data.c	11 May 2005 03:45:55 -0000	1.4
@@ -157,8 +157,7 @@
 /* Closure for path interpretation. */
 typedef struct cairo_path_data_populate {
     cairo_path_data_t *data;
-    cairo_matrix_t    *ctm_inverse;
-    double	       tolerance;
+    cairo_gstate_t    *gstate;
     cairo_point_t      current_point;
 } cpdp_t;
 
@@ -172,7 +171,7 @@
     x = _cairo_fixed_to_double (point->x);
     y = _cairo_fixed_to_double (point->y);
 
-    cairo_matrix_transform_point (cpdp->ctm_inverse, &x, &y);
+    _cairo_gstate_backend_to_user (cpdp->gstate, &x, &y);
 
     data->header.type = CAIRO_PATH_MOVE_TO;
     data->header.length = 2;
@@ -198,7 +197,7 @@
     x = _cairo_fixed_to_double (point->x);
     y = _cairo_fixed_to_double (point->y);
 
-    cairo_matrix_transform_point (cpdp->ctm_inverse, &x, &y);
+    _cairo_gstate_backend_to_user (cpdp->gstate, &x, &y);
 
     data->header.type = CAIRO_PATH_LINE_TO;
     data->header.length = 2;
@@ -228,15 +227,15 @@
 
     x1 = _cairo_fixed_to_double (p1->x);
     y1 = _cairo_fixed_to_double (p1->y);
-    cairo_matrix_transform_point (cpdp->ctm_inverse, &x1, &y1);
+    _cairo_gstate_backend_to_user (cpdp->gstate, &x1, &y1);
 
     x2 = _cairo_fixed_to_double (p2->x);
     y2 = _cairo_fixed_to_double (p2->y);
-    cairo_matrix_transform_point (cpdp->ctm_inverse, &x2, &y2);
+    _cairo_gstate_backend_to_user (cpdp->gstate, &x2, &y2);
 
     x3 = _cairo_fixed_to_double (p3->x);
     y3 = _cairo_fixed_to_double (p3->y);
-    cairo_matrix_transform_point (cpdp->ctm_inverse, &x3, &y3);
+    _cairo_gstate_backend_to_user (cpdp->gstate, &x3, &y3);
 
     data->header.type = CAIRO_PATH_CURVE_TO;
     data->header.length = 4;
@@ -275,7 +274,7 @@
     if (status == CAIRO_INT_STATUS_DEGENERATE)
 	return CAIRO_STATUS_SUCCESS;
 
-    status = _cairo_spline_decompose (&spline, cpdp->tolerance);
+    status = _cairo_spline_decompose (&spline, cpdp->gstate->tolerance);
     if (status)
 	return status;
 
@@ -307,15 +306,13 @@
 static void
 _cairo_path_data_populate (cairo_path_t   *path,
 			   cairo_path_fixed_t *path_fixed,
-			   cairo_matrix_t *ctm_inverse,
-			   double	   tolerance,
+			   cairo_gstate_t *gstate,
 			   cairo_bool_t	   flatten)
 {
     cpdp_t cpdp;
 
     cpdp.data = path->data;
-    cpdp.ctm_inverse = ctm_inverse;
-    cpdp.tolerance = tolerance;
+    cpdp.gstate = gstate;
     cpdp.current_point.x = 0;
     cpdp.current_point.y = 0;
 
@@ -335,8 +332,7 @@
 
 static cairo_path_t *
 _cairo_path_data_create_real (cairo_path_fixed_t *path_fixed,
-			      cairo_matrix_t	 *ctm_inverse,
-			      double		  tolerance,
+			      cairo_gstate_t     *gstate,
 			      cairo_bool_t	  flatten)
 {
     cairo_path_t *path;
@@ -346,7 +342,7 @@
 	return &_cairo_path_nil;
 
     path->num_data = _cairo_path_data_count (path, path_fixed,
-					     tolerance, flatten);
+					     gstate->tolerance, flatten);
 
     path->data = malloc (path->num_data * sizeof (cairo_path_data_t));
     if (path->data == NULL) {
@@ -355,7 +351,7 @@
     }
 
     _cairo_path_data_populate (path, path_fixed,
-			       ctm_inverse, tolerance, flatten);
+			       gstate, flatten);
 
     return path;
 }
@@ -370,18 +366,16 @@
 
 cairo_path_t *
 _cairo_path_data_create (cairo_path_fixed_t *path,
-			 cairo_matrix_t	    *ctm_inverse,
-			 double		     tolerance)
+			 cairo_gstate_t     *gstate)
 {
-    return _cairo_path_data_create_real (path, ctm_inverse, tolerance, FALSE);
+    return _cairo_path_data_create_real (path, gstate, FALSE);
 }
 
 cairo_path_t *
 _cairo_path_data_create_flat (cairo_path_fixed_t *path,
-			      cairo_matrix_t	 *ctm_inverse,
-			      double		  tolerance)
+			      cairo_gstate_t     *gstate)
 {
-    return _cairo_path_data_create_real (path, ctm_inverse, tolerance, TRUE);
+    return _cairo_path_data_create_real (path, gstate, TRUE);
 }
 
 cairo_status_t

Index: cairo.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- cairo.c	10 May 2005 19:22:41 -0000	1.93
+++ cairo.c	11 May 2005 03:45:55 -0000	1.94
@@ -2061,9 +2061,7 @@
     if (cr->status)
 	return &_cairo_path_nil;
 
-    return _cairo_path_data_create (&cr->path,
-				    &cr->gstate->ctm_inverse,
-				    cr->gstate->tolerance);
+    return _cairo_path_data_create (&cr->path, cr->gstate);
 }
 
 /**
@@ -2092,9 +2090,7 @@
     if (cr->status)
 	return &_cairo_path_nil;
 
-    return _cairo_path_data_create_flat (&cr->path,
-					 &cr->gstate->ctm_inverse,
-					 cr->gstate->tolerance);
+    return _cairo_path_data_create_flat (&cr->path, cr->gstate);
 }
 
 /**




More information about the cairo-commit mailing list