summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog15
-rw-r--r--src/cairo-gstate.c18
-rw-r--r--src/cairo-matrix.c1
-rw-r--r--src/cairo.c27
-rw-r--r--src/cairo.h7
-rw-r--r--src/cairoint.h5
6 files changed, 28 insertions, 45 deletions
diff --git a/ChangeLog b/ChangeLog
index ac25e9e7..67ac19f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
2005-04-08 Carl Worth <cworth@cworth.org>
+ * 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.
+
+2005-04-08 Carl Worth <cworth@cworth.org>
+
* src/cairo-matrix.c (cairo_matrix_init_identity): Don't try to
return a value (even a void value) from a void function. Closes
bug #2931.
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index d35f643c..014294ae 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -561,16 +561,10 @@ _cairo_gstate_get_miter_limit (cairo_gstate_t *gstate)
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_transform (cairo_gstate_t *gstate, cairo_matrix_t *matrix)
_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_set_matrix (cairo_gstate_t *gstate,
_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 @@ _cairo_gstate_interpret_path (cairo_gstate_t *gstate,
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,
diff --git a/src/cairo-matrix.c b/src/cairo-matrix.c
index 838de309..f37c8905 100644
--- a/src/cairo-matrix.c
+++ b/src/cairo-matrix.c
@@ -106,7 +106,6 @@ cairo_matrix_copy (cairo_matrix_t *matrix, const cairo_matrix_t *other)
{
*matrix = *other;
}
-slim_hidden_def(cairo_matrix_copy);
/**
* cairo_matrix_init_identity:
diff --git a/src/cairo.c b/src/cairo.c
index f59a6276..f8062f57 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -2049,36 +2049,17 @@ DEPRECATE (cairo_current_miter_limit, cairo_get_miter_limit);
/**
* 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:
diff --git a/src/cairo.h b/src/cairo.h
index e0040e13..ea854cc4 100644
--- a/src/cairo.h
+++ b/src/cairo.h
@@ -699,12 +699,8 @@ cairo_get_miter_limit (cairo_t *cr);
/* 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 @@ typedef cairo_status_t (*cairo_write_func_t) (void *closure,
#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
diff --git a/src/cairoint.h b/src/cairoint.h
index 3625acba..8da9c8cd 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -966,11 +966,8 @@ _cairo_gstate_set_miter_limit (cairo_gstate_t *gstate, double limit);
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);