[cairo-commit] cairo/src cairo_color.c, 1.10, 1.11 cairo_gstate.c, 1.71, 1.72 cairo_matrix.c, 1.14, 1.15

Carl Worth commit at pdx.freedesktop.org
Wed Jan 19 12:12:45 PST 2005


Committed by: cworth

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

Modified Files:
	cairo_color.c cairo_gstate.c cairo_matrix.c 
Log Message:

        * src/cairo_matrix.c (cairo_matrix_get_affine):
        * src/cairo_gstate.c (_cairo_gstate_current_point):
        * src/cairo_color.c (_cairo_color_get_rgb): Allow NULL values for
        return pointers so that the user can easily get partial results
        from cairo_matrix_get_affine, cairo_current_point, and
        cairo_current_color_rgb as needed.


Index: cairo_color.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_color.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cairo_color.c	11 Jan 2005 21:50:13 -0000	1.10
+++ cairo_color.c	19 Jan 2005 20:12:42 -0000	1.11
@@ -69,9 +69,12 @@
 void
 _cairo_color_get_rgb (cairo_color_t *color, double *red, double *green, double *blue)
 {
-    *red   = color->red;
-    *green = color->green;
-    *blue  = color->blue;
+    if (red)
+	*red   = color->red;
+    if (green)
+	*green = color->green;
+    if (blue)
+	*blue  = color->blue;
 }
 
 void

Index: cairo_gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_gstate.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- cairo_gstate.c	15 Jan 2005 18:53:13 -0000	1.71
+++ cairo_gstate.c	19 Jan 2005 20:12:42 -0000	1.72
@@ -1096,8 +1096,10 @@
 	cairo_matrix_transform_point (&gstate->ctm_inverse, &x, &y);
     }
 
-    *x_ret = x;
-    *y_ret = y;
+    if (x_ret)
+	*x_ret = x;
+    if (y_ret)
+	*y_ret = y;
 
     return CAIRO_STATUS_SUCCESS;
 }

Index: cairo_matrix.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_matrix.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- cairo_matrix.c	11 Jan 2005 22:52:16 -0000	1.14
+++ cairo_matrix.c	19 Jan 2005 20:12:42 -0000	1.15
@@ -125,9 +125,20 @@
 			 double *c, double *d,
 			 double *tx, double *ty)
 {
-    *a  = matrix->m[0][0]; *b  = matrix->m[0][1];
-    *c  = matrix->m[1][0]; *d  = matrix->m[1][1];
-    *tx = matrix->m[2][0]; *ty = matrix->m[2][1];
+    if (a)
+	*a  = matrix->m[0][0];
+    if (b)
+	*b  = matrix->m[0][1];
+
+    if (c)
+	*c  = matrix->m[1][0];
+    if (d)
+	*d  = matrix->m[1][1];
+
+    if (tx)
+	*tx = matrix->m[2][0];
+    if (ty)
+	*ty = matrix->m[2][1];
 
     return CAIRO_STATUS_SUCCESS;
 }




More information about the cairo-commit mailing list