[cairo-commit] cairo/src cairo-gstate.c, 1.106, 1.107 cairo-matrix.c, 1.23, 1.24 cairo.c, 1.74, 1.75 cairo.h, 1.94, 1.95 cairoint.h, 1.122, 1.123

Carl Worth commit at pdx.freedesktop.org
Fri Apr 8 10:03:19 PDT 2005


Committed by: cworth

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

Modified Files:
	cairo-gstate.c cairo-matrix.c cairo.c cairo.h cairoint.h 
Log Message:

        * src/cairo-gstate.c:
        (_cairo_gstate_transform), (_cairo_gstate_set_matrix),
        (_cairo_gstate_interpret_path): Eliminate internal use of
        deprecated cairo_matrix_copy.

        * src/cairo-gstate.c: (_cairo_gstate_get_matrix),
        * src/cairo-matrix.c: (cairo_matrix_copy):
        * src/cairo.c: (cairo_get_matrix):
        * src/cairo.h:
        * src/cairoint.h: Change cairo_get_matrix to accept a pointer to
        the return value cairo_matrix_t rather than returning the value
        directly.


Index: cairo-gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-gstate.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- cairo-gstate.c	7 Apr 2005 20:29:32 -0000	1.106
+++ cairo-gstate.c	8 Apr 2005 17:03:17 -0000	1.107
@@ -561,16 +561,10 @@
     return gstate->miter_limit;
 }
 
-cairo_matrix_t
-_cairo_gstate_get_matrix (cairo_gstate_t *gstate)
-{
-    return gstate->ctm;
-}
-
 void
-_cairo_gstate_current_matrix (cairo_gstate_t *gstate, cairo_matrix_t *matrix)
+_cairo_gstate_get_matrix (cairo_gstate_t *gstate, cairo_matrix_t *matrix)
 {
-    cairo_matrix_copy (matrix, &gstate->ctm);
+    *matrix = gstate->ctm;
 }
 
 cairo_status_t
@@ -631,7 +625,7 @@
 
     _cairo_gstate_unset_font (gstate);
     
-    cairo_matrix_copy (&tmp, matrix);
+    tmp = *matrix;
     cairo_matrix_multiply (&gstate->ctm, &tmp, &gstate->ctm);
 
     cairo_matrix_invert (&tmp);
@@ -648,9 +642,9 @@
 
     _cairo_gstate_unset_font (gstate);
     
-    cairo_matrix_copy (&gstate->ctm, matrix);
+    gstate->ctm = *matrix;
 
-    cairo_matrix_copy (&gstate->ctm_inverse, matrix);
+    gstate->ctm_inverse = *matrix;
     status = cairo_matrix_invert (&gstate->ctm_inverse);
     if (status)
 	return status;
@@ -1280,7 +1274,7 @@
        pointers into gstate. */
     _cairo_path_fixed_init_copy (&path, &gstate->path);
 
-    cairo_matrix_copy (&gpi.ctm_inverse, &gstate->ctm_inverse);
+    gpi.ctm_inverse = gstate->ctm_inverse;
     if (gstate->surface)
 	cairo_matrix_translate (&gpi.ctm_inverse,
 				- gstate->surface->device_x_offset,

Index: cairo-matrix.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-matrix.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- cairo-matrix.c	8 Apr 2005 11:43:06 -0000	1.23
+++ cairo-matrix.c	8 Apr 2005 17:03:17 -0000	1.24
@@ -106,7 +106,6 @@
 {
     *matrix = *other;
 }
-slim_hidden_def(cairo_matrix_copy);
 
 /**
  * cairo_matrix_init_identity:

Index: cairo.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- cairo.c	7 Apr 2005 20:29:32 -0000	1.74
+++ cairo.c	8 Apr 2005 17:03:17 -0000	1.75
@@ -2049,36 +2049,17 @@
 /**
  * cairo_get_matrix:
  * @cr: a cairo context
- *
- * Gets the current transformation matrix (CTM), a matrix which
- * transforms from user space to device space.
- *
- * Return value: the current transformation matrix.
- **/
-cairo_matrix_t
-cairo_get_matrix (cairo_t *cr)
-{
-    CAIRO_CHECK_SANITY (cr);
-    return _cairo_gstate_get_matrix (cr->gstate);
-}
-
-/**
- * cairo_get_matrix:
- * @cr: a cairo context
  * @matrix: return value for the matrix
- * 
- * Stores the current transformation matrix (CTM) into @matrix.
  *
- * WARNING: This function is deprecated and will be disappearing
- * shortly.
+ * Stores the current transformation matrix (CTM) into @matrix.
  **/
 void
-cairo_current_matrix (cairo_t *cr, cairo_matrix_t *matrix)
+cairo_get_matrix (cairo_t *cr, cairo_matrix_t *matrix)
 {
     CAIRO_CHECK_SANITY (cr);
-    _cairo_gstate_current_matrix (cr->gstate, matrix);
-    CAIRO_CHECK_SANITY (cr);
+    _cairo_gstate_get_matrix (cr->gstate, matrix);
 }
+DEPRECATE(cairo_current_matrix, cairo_get_matrix);
 
 /**
  * cairo_get_target_surface:

Index: cairo.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.h,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -d -r1.94 -r1.95
--- cairo.h	7 Apr 2005 20:29:32 -0000	1.94
+++ cairo.h	8 Apr 2005 17:03:17 -0000	1.95
@@ -699,12 +699,8 @@
 
 /* XXX: How to do cairo_get_dash??? Do we want to switch to a cairo_dash object? */
 
-cairo_matrix_t
-cairo_get_matrix (cairo_t *cr);
-
-/* XXX: cairo_current_matrix is deprecated in favor of cairo_get_matrix. */
 void
-cairo_current_matrix (cairo_t *cr, cairo_matrix_t *matrix);
+cairo_get_matrix (cairo_t *cr, cairo_matrix_t *matrix);
 
 /* XXX: Need to decide the memory management semantics of this
    function. Should it reference the surface again? */
@@ -1141,6 +1137,7 @@
 #define cairo_current_line_cap       cairo_get_line_cap
 #define cairo_current_line_join      cairo_get_line_join
 #define cairo_current_miter_limit    cairo_get_miter_limit
+#define cairo_current_matrix	     cairo_get_matrix
 #define cairo_current_target_surface cairo_get_target_surface
 #define cairo_get_font_extents       cairo_font_extents
 #define cairo_get_status             cairo_status

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -d -r1.122 -r1.123
--- cairoint.h	7 Apr 2005 20:29:32 -0000	1.122
+++ cairoint.h	8 Apr 2005 17:03:17 -0000	1.123
@@ -966,11 +966,8 @@
 cairo_private double
 _cairo_gstate_get_miter_limit (cairo_gstate_t *gstate);
 
-cairo_private cairo_matrix_t
-_cairo_gstate_get_matrix (cairo_gstate_t *gstate);
-
 cairo_private void
-_cairo_gstate_current_matrix (cairo_gstate_t *gstate, cairo_matrix_t *matrix);
+_cairo_gstate_get_matrix (cairo_gstate_t *gstate, cairo_matrix_t *matrix);
 
 cairo_private cairo_status_t
 _cairo_gstate_translate (cairo_gstate_t *gstate, double tx, double ty);




More information about the cairo-commit mailing list