[cairo-commit] cairo/src cairo-atsui-font.c, 1.6,
1.7 cairo-ft-font.c, 1.52, 1.53 cairo-gstate.c, 1.102,
1.103 cairo-image-surface.c, 1.33, 1.34 cairo-matrix.c, 1.21,
1.22 cairo-pattern.c, 1.28, 1.29 cairo-pdf-surface.c, 1.24,
1.25 cairo-pen.c, 1.22, 1.23 cairo-surface.c, 1.51,
1.52 cairo-win32-font.c, 1.11, 1.12 cairo-xlib-surface.c, 1.55,
1.56 cairo.c, 1.71, 1.72 cairo.h, 1.91, 1.92 cairoint.h, 1.117,
1.118
Carl Worth
commit at pdx.freedesktop.org
Thu Apr 7 10:01:52 PDT 2005
- Previous message: [cairo-commit] cairo/test .cvsignore, 1.12, 1.13 Makefile.am, 1.26,
1.27 transforms-ref.png, NONE, 1.1 transforms.c, NONE, 1.1
- Next message: [cairo-commit] cairo ChangeLog,1.474,1.475
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: cworth
Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv1819/src
Modified Files:
cairo-atsui-font.c cairo-ft-font.c cairo-gstate.c
cairo-image-surface.c cairo-matrix.c cairo-pattern.c
cairo-pdf-surface.c cairo-pen.c cairo-surface.c
cairo-win32-font.c cairo-xlib-surface.c cairo.c cairo.h
cairoint.h
Log Message:
* src/cairo.h: Rework the cairo_matrix_t interface in several ways.
Expose a struct for cairo_matrix_t.
Add new function to return current matrix:
cairo_get_matrix
Deprecate the following functions (in documentation):
cairo_matrix_create
cairo_matrix_destroy
cairo_matrix_get_affine
Rename:
cairo_matrix_set_affine -> cairo_matrix_init
cairo_matrix_set_identity -> cairo_matrix_init_identity
Add other new matrix initialization functions:
cairo_matrix_init_translate
cairo_matrix_init_scale
cairo_matrix_init_rotate
Change return type of almost all cairo_matrix functions from
cairo_status_t to void.
* src/cairo-atsui-font.c:
* src/cairo-ft-font.c:
* src/cairo-gstate.c:
* src/cairo-image-surface.c:
* src/cairo-matrix.c:
* src/cairo-pattern.c:
* src/cairo-pdf-surface.c:
* src/cairo-pen.c:
* src/cairo-surface.c:
* src/cairo-win32-font.c:
* src/cairo-xlib-surface.c:
* src/cairo.c:
* src/cairoint.h: Track changes to cairo_matrix_t interface.
* test/.cvsignore:
* test/Makefile.am:
* test/transforms-ref.png:
* test/transforms.c: Add a test case showing the same path drawn
under various transforms, (including skews set directly by
initializing a cairo_matrix_t).
Index: cairo-atsui-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-atsui-font.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cairo-atsui-font.c 6 Apr 2005 20:01:13 -0000 1.6
+++ cairo-atsui-font.c 7 Apr 2005 17:01:49 -0000 1.7
@@ -667,9 +667,9 @@
GlyphID theGlyph = glyphs[i].index;
- cairo_matrix_set_affine(&info.scale,
- 1.0, 0.0,
- 0.0, 1.0, glyphs[i].x, glyphs[i].y);
+ cairo_matrix_init(&info.scale,
+ 1.0, 0.0,
+ 0.0, 1.0, glyphs[i].x, glyphs[i].y);
err = ATSUGlyphGetCubicPaths(font->style,
Index: cairo-ft-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ft-font.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- cairo-ft-font.c 6 Apr 2005 20:01:13 -0000 1.52
+++ cairo-ft-font.c 7 Apr 2005 17:01:49 -0000 1.53
@@ -418,12 +418,12 @@
* freetype's transformation.
*/
- cairo_matrix_set_affine (&normalized,
- sc->matrix[0][0],
- sc->matrix[0][1],
- sc->matrix[1][0],
- sc->matrix[1][1],
- 0, 0);
+ cairo_matrix_init (&normalized,
+ sc->matrix[0][0],
+ sc->matrix[0][1],
+ sc->matrix[1][0],
+ sc->matrix[1][1],
+ 0, 0);
_cairo_matrix_compute_scale_factors (&normalized,
&sf->x_scale, &sf->y_scale,
Index: cairo-gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-gstate.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- cairo-gstate.c 6 Apr 2005 20:01:13 -0000 1.102
+++ cairo-gstate.c 7 Apr 2005 17:01:49 -0000 1.103
@@ -213,11 +213,6 @@
cairo_pattern_destroy (gstate->pattern);
- _cairo_matrix_fini (&gstate->font_matrix);
-
- _cairo_matrix_fini (&gstate->ctm);
- _cairo_matrix_fini (&gstate->ctm_inverse);
-
_cairo_path_fixed_fini (&gstate->path);
_cairo_pen_fini (&gstate->pen_regular);
@@ -574,8 +569,14 @@
return gstate->miter_limit;
}
+cairo_matrix_t
+_cairo_gstate_get_matrix (cairo_gstate_t *gstate)
+{
+ return gstate->ctm;
+}
+
void
-_cairo_gstate_get_matrix (cairo_gstate_t *gstate, cairo_matrix_t *matrix)
+_cairo_gstate_current_matrix (cairo_gstate_t *gstate, cairo_matrix_t *matrix)
{
cairo_matrix_copy (matrix, &gstate->ctm);
}
@@ -587,10 +588,10 @@
_cairo_gstate_unset_font (gstate);
- _cairo_matrix_set_translate (&tmp, tx, ty);
+ cairo_matrix_init_translate (&tmp, tx, ty);
cairo_matrix_multiply (&gstate->ctm, &tmp, &gstate->ctm);
- _cairo_matrix_set_translate (&tmp, -tx, -ty);
+ cairo_matrix_init_translate (&tmp, -tx, -ty);
cairo_matrix_multiply (&gstate->ctm_inverse, &gstate->ctm_inverse, &tmp);
return CAIRO_STATUS_SUCCESS;
@@ -606,10 +607,10 @@
_cairo_gstate_unset_font (gstate);
- _cairo_matrix_set_scale (&tmp, sx, sy);
+ cairo_matrix_init_scale (&tmp, sx, sy);
cairo_matrix_multiply (&gstate->ctm, &tmp, &gstate->ctm);
- _cairo_matrix_set_scale (&tmp, 1/sx, 1/sy);
+ cairo_matrix_init_scale (&tmp, 1/sx, 1/sy);
cairo_matrix_multiply (&gstate->ctm_inverse, &gstate->ctm_inverse, &tmp);
return CAIRO_STATUS_SUCCESS;
@@ -622,10 +623,10 @@
_cairo_gstate_unset_font (gstate);
- _cairo_matrix_set_rotate (&tmp, angle);
+ cairo_matrix_init_rotate (&tmp, angle);
cairo_matrix_multiply (&gstate->ctm, &tmp, &gstate->ctm);
- _cairo_matrix_set_rotate (&tmp, -angle);
+ cairo_matrix_init_rotate (&tmp, -angle);
cairo_matrix_multiply (&gstate->ctm_inverse, &gstate->ctm_inverse, &tmp);
return CAIRO_STATUS_SUCCESS;
@@ -670,8 +671,8 @@
{
_cairo_gstate_unset_font (gstate);
- cairo_matrix_set_identity (&gstate->ctm);
- cairo_matrix_set_identity (&gstate->ctm_inverse);
+ cairo_matrix_init_identity (&gstate->ctm);
+ cairo_matrix_init_identity (&gstate->ctm_inverse);
return CAIRO_STATUS_SUCCESS;
}
@@ -1800,10 +1801,9 @@
pixman_box16_t *box)
{
double a, b, c, d, tx, ty;
- cairo_status_t st;
- st = cairo_matrix_get_affine (mat, &a, &b, &c, &d, &tx, &ty);
- if (!(st == CAIRO_STATUS_SUCCESS && b == 0. && c == 0.))
+ cairo_matrix_get_affine (mat, &a, &b, &c, &d, &tx, &ty);
+ if (!(b == 0. && c == 0.))
return 0;
if (tr->num_traps == 1
@@ -2037,7 +2037,7 @@
if (gstate->surface) {
cairo_matrix_t device_to_backend;
- _cairo_matrix_set_translate (&device_to_backend,
+ cairo_matrix_init_translate (&device_to_backend,
gstate->surface->device_x_offset,
gstate->surface->device_y_offset);
cairo_matrix_multiply (&image_to_backend, &image_to_device, &device_to_backend);
@@ -2147,7 +2147,7 @@
gstate->font_slant = slant;
gstate->font_weight = weight;
- cairo_matrix_set_identity (&gstate->font_matrix);
+ cairo_matrix_init_identity (&gstate->font_matrix);
return CAIRO_STATUS_SUCCESS;
}
@@ -2158,7 +2158,9 @@
{
_cairo_gstate_unset_font (gstate);
- return cairo_matrix_scale (&gstate->font_matrix, scale, scale);
+ cairo_matrix_scale (&gstate->font_matrix, scale, scale);
+
+ return CAIRO_STATUS_SUCCESS;
}
cairo_status_t
@@ -2171,8 +2173,10 @@
_cairo_gstate_unset_font (gstate);
cairo_matrix_get_affine (matrix, &a, &b, &c, &d, &tx, &ty);
- cairo_matrix_set_affine (&tmp, a, b, c, d, 0, 0);
- return cairo_matrix_multiply (&gstate->font_matrix, &gstate->font_matrix, &tmp);
+ cairo_matrix_init (&tmp, a, b, c, d, 0, 0);
+ cairo_matrix_multiply (&gstate->font_matrix, &gstate->font_matrix, &tmp);
+
+ return CAIRO_STATUS_SUCCESS;
}
Index: cairo-image-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-image-surface.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- cairo-image-surface.c 4 Apr 2005 16:47:12 -0000 1.33
+++ cairo-image-surface.c 7 Apr 2005 17:01:49 -0000 1.34
@@ -325,13 +325,13 @@
{
pixman_transform_t pixman_transform;
- pixman_transform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]);
- pixman_transform.matrix[0][1] = _cairo_fixed_from_double (matrix->m[1][0]);
- pixman_transform.matrix[0][2] = _cairo_fixed_from_double (matrix->m[2][0]);
+ pixman_transform.matrix[0][0] = _cairo_fixed_from_double (matrix->xx);
+ pixman_transform.matrix[0][1] = _cairo_fixed_from_double (matrix->xy);
+ pixman_transform.matrix[0][2] = _cairo_fixed_from_double (matrix->x0);
- pixman_transform.matrix[1][0] = _cairo_fixed_from_double (matrix->m[0][1]);
- pixman_transform.matrix[1][1] = _cairo_fixed_from_double (matrix->m[1][1]);
- pixman_transform.matrix[1][2] = _cairo_fixed_from_double (matrix->m[2][1]);
+ pixman_transform.matrix[1][0] = _cairo_fixed_from_double (matrix->yx);
+ pixman_transform.matrix[1][1] = _cairo_fixed_from_double (matrix->yy);
+ pixman_transform.matrix[1][2] = _cairo_fixed_from_double (matrix->y0);
pixman_transform.matrix[2][0] = 0;
pixman_transform.matrix[2][1] = 0;
Index: cairo-matrix.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-matrix.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- cairo-matrix.c 21 Mar 2005 07:23:19 -0000 1.21
+++ cairo-matrix.c 7 Apr 2005 17:01:49 -0000 1.22
@@ -40,14 +40,6 @@
#include "cairoint.h"
-static cairo_matrix_t const CAIRO_MATRIX_IDENTITY = {
- {
- {1, 0},
- {0, 1},
- {0, 0}
- }
-};
-
static void
_cairo_matrix_scalar_multiply (cairo_matrix_t *matrix, double scalar);
@@ -61,6 +53,11 @@
*
* Return value: a newly created matrix; free with cairo_matrix_destroy(),
* or %NULL if memory couldn't be allocated.
+ *
+ * WARNING: This function is deprecated and will be disappearing
+ * shortly. Now that the structure of #cairo_matrix_t is exposed,
+ * users can manage the memory on their own, (in particular by putting
+ * a cairo_matrix_t on the stack).
**/
cairo_matrix_t *
cairo_matrix_create (void)
@@ -71,33 +68,25 @@
if (matrix == NULL)
return NULL;
- _cairo_matrix_init (matrix);
+ cairo_matrix_init_identity (matrix);
return matrix;
}
-void
-_cairo_matrix_init (cairo_matrix_t *matrix)
-{
- cairo_matrix_set_identity (matrix);
-}
-
-void
-_cairo_matrix_fini (cairo_matrix_t *matrix)
-{
- /* nothing to do here */
-}
-
/**
* cairo_matrix_destroy:
* @matrix: a #cairo_matrix_t
*
* Frees a matrix created with cairo_matrix_create.
+ *
+ * WARNING: This function is deprecated and will be disappearing
+ * shortly. Now that the structure of #cairo_matrix_t is exposed,
+ * users can manage the memory on their own, (in particular by putting
+ * a cairo_matrix_t on the stack).
**/
void
cairo_matrix_destroy (cairo_matrix_t *matrix)
{
- _cairo_matrix_fini (matrix);
free (matrix);
}
@@ -108,67 +97,64 @@
*
* Modifies @matrix to be identical to @other.
*
- * Return value: %CAIRO_STATUS_SUCCESS, always.
+ * WARNING: This function is deprecated and will be disappearing
+ * shortly. Now that the structure of #cairo_matrix_t is exposed,
+ * users can copy a matrix by direct assignment.
**/
-cairo_status_t
+void
cairo_matrix_copy (cairo_matrix_t *matrix, const cairo_matrix_t *other)
{
*matrix = *other;
-
- return CAIRO_STATUS_SUCCESS;
}
slim_hidden_def(cairo_matrix_copy);
/**
- * cairo_matrix_set_identity:
+ * cairo_matrix_init_identity:
* @matrix: a #cairo_matrix_t
*
* Modifies @matrix to be an identity transformation.
- *
- * Return value: %CAIRO_STATUS_SUCCESS, always.
**/
-cairo_status_t
-cairo_matrix_set_identity (cairo_matrix_t *matrix)
+void
+cairo_matrix_init_identity (cairo_matrix_t *matrix)
{
- *matrix = CAIRO_MATRIX_IDENTITY;
-
- return CAIRO_STATUS_SUCCESS;
+ return cairo_matrix_init (matrix,
+ 1, 0,
+ 0, 1,
+ 0, 0);
}
-slim_hidden_def(cairo_matrix_set_identity);
+slim_hidden_def(cairo_matrix_init_identity);
+DEPRECATE(cairo_matrix_set_identity, cairo_matrix_init_identity);
/**
- * cairo_matrix_set_affine:
+ * cairo_matrix_init:
* @matrix: a cairo_matrix_t
- * @a: a component of the affine transformation
- * @b: b component of the affine transformation
- * @c: c component of the affine transformation
- * @d: d component of the affine transformation
- * @tx: X translation component of the affine transformation
- * @ty: Y translation component of the affine transformation
+ * @xx: xx component of the affine transformation
+ * @yx: yx component of the affine transformation
+ * @xy: xy component of the affine transformation
+ * @yy: yy component of the affine transformation
+ * @x0: X translation component of the affine transformation
+ * @y0: Y translation component of the affine transformation
*
* Sets @matrix to be the affine transformation given by
- * @a, b, @c, @d, @tx, @ty. The transformation is given
+ * @xx, @yx, @xy, @yy, @x0, @y0. The transformation is given
* by:
* <programlisting>
- * x_new = x * a + y * c + tx;
- * y_new = x * b + y * d + ty;
+ * x_new = xx * x + xy * y + x0;
+ * y_new = yx * x + yy * y + y0;
* </programlisting>
- *
- * Return value: %CAIRO_STATUS_SUCCESS, always.
**/
-cairo_status_t
-cairo_matrix_set_affine (cairo_matrix_t *matrix,
- double a, double b,
- double c, double d,
- double tx, double ty)
+void
+cairo_matrix_init (cairo_matrix_t *matrix,
+ double xx, double yx,
+ double xy, double yy,
+ double x0, double y0)
{
- matrix->m[0][0] = a; matrix->m[0][1] = b;
- matrix->m[1][0] = c; matrix->m[1][1] = d;
- matrix->m[2][0] = tx; matrix->m[2][1] = ty;
-
- return CAIRO_STATUS_SUCCESS;
+ matrix->xx = xx; matrix->yx = yx;
+ matrix->xy = xy; matrix->yy = yy;
+ matrix->x0 = x0; matrix->y0 = y0;
}
-slim_hidden_def(cairo_matrix_set_affine);
+slim_hidden_def(cairo_matrix_init);
+DEPRECATE(cairo_matrix_set_affine, cairo_matrix_init);
/**
* cairo_matrix_get_affine:
@@ -181,43 +167,53 @@
* @ty: location to store Y-translation component of affine transformation, or %NULL
*
* Gets the matrix values for the affine tranformation that @matrix represents.
- * See cairo_matrix_set_affine().
- *
- * Return value: %CAIRO_STATUS_SUCCESS, always.
+ * See cairo_matrix_init().
+ *
+ * WARNING: This function is deprecated and will be disappearing
+ * shortly. Now that the structure of #cairo_matrix_t is exposed,
+ * users can just examine the matrix values directly.
**/
-cairo_status_t
+void
cairo_matrix_get_affine (cairo_matrix_t *matrix,
- double *a, double *b,
- double *c, double *d,
- double *tx, double *ty)
+ double *xx, double *yx,
+ double *xy, double *yy,
+ double *x0, double *y0)
{
- 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 (xx)
+ *xx = matrix->xx;
+ if (yx)
+ *yx = matrix->yx;
- if (tx)
- *tx = matrix->m[2][0];
- if (ty)
- *ty = matrix->m[2][1];
+ if (xy)
+ *xy = matrix->xy;
+ if (yy)
+ *yy = matrix->yy;
- return CAIRO_STATUS_SUCCESS;
+ if (x0)
+ *x0 = matrix->x0;
+ if (y0)
+ *y0 = matrix->y0;
}
-cairo_status_t
-_cairo_matrix_set_translate (cairo_matrix_t *matrix,
+/**
+ * cairo_matrix_init_translate:
+ * @matrix: a cairo_matrix_t
+ * @tx: amount to translate in the X direction
+ * @ty: amount to translate in the Y direction
+ *
+ * Initializes @matrix to a transformation that translates by @tx and
+ * @ty in the X and Y dimensions, respectively.
+ **/
+void
+cairo_matrix_init_translate (cairo_matrix_t *matrix,
double tx, double ty)
{
- return cairo_matrix_set_affine (matrix,
- 1, 0,
- 0, 1,
- tx, ty);
+ cairo_matrix_init (matrix,
+ 1, 0,
+ 0, 1,
+ tx, ty);
}
+slim_hidden_def(cairo_matrix_init_translate);
/**
* cairo_matrix_translate:
@@ -229,34 +225,42 @@
* @matrix. The effect of the new transformation is to first translate
* the coordinates by @tx and @ty, then apply the original transformation
* to the coordinates.
- *
- * Return value: %CAIRO_STATUS_SUCCESS, always.
**/
-cairo_status_t
+void
cairo_matrix_translate (cairo_matrix_t *matrix, double tx, double ty)
{
cairo_matrix_t tmp;
- _cairo_matrix_set_translate (&tmp, tx, ty);
+ cairo_matrix_init_translate (&tmp, tx, ty);
- return cairo_matrix_multiply (matrix, &tmp, matrix);
+ cairo_matrix_multiply (matrix, &tmp, matrix);
}
-cairo_status_t
-_cairo_matrix_set_scale (cairo_matrix_t *matrix,
+/**
+ * cairo_matrix_init_scale:
+ * @matrix: a cairo_matrix_t
+ * @sx: scale factor in the X direction
+ * @sy: scale factor in the Y direction
+ *
+ * Initializes @matrix to a transformation that scales by @sx and @sy
+ * in the X and Y dimensions, respectively.
+ **/
+void
+cairo_matrix_init_scale (cairo_matrix_t *matrix,
double sx, double sy)
{
- return cairo_matrix_set_affine (matrix,
- sx, 0,
- 0, sy,
- 0, 0);
+ cairo_matrix_init (matrix,
+ sx, 0,
+ 0, sy,
+ 0, 0);
}
+slim_hidden_def(cairo_matrix_init_scale);
/**
* cairo_matrix_scale:
* @matrix: a #cairo_matrix_t
- * @sx: Scale factor in the X direction
- * @sy: Scale factor in the Y direction
+ * @sx: scale factor in the X direction
+ * @sy: scale factor in the Y direction
*
* Applies scaling by @tx, @ty to the transformation in @matrix. The
* effect of the new transformation is to first scale the coordinates
@@ -264,20 +268,31 @@
*
* Return value: %CAIRO_STATUS_SUCCESS, always.
**/
-cairo_status_t
+void
cairo_matrix_scale (cairo_matrix_t *matrix, double sx, double sy)
{
cairo_matrix_t tmp;
- _cairo_matrix_set_scale (&tmp, sx, sy);
+ cairo_matrix_init_scale (&tmp, sx, sy);
- return cairo_matrix_multiply (matrix, &tmp, matrix);
+ cairo_matrix_multiply (matrix, &tmp, matrix);
}
slim_hidden_def(cairo_matrix_scale);
-cairo_status_t
-_cairo_matrix_set_rotate (cairo_matrix_t *matrix,
- double radians)
+/**
+ * cairo_matrix_init_rotate:
+ * @matrix: a cairo_matrix_t
+ * @radians: angle of rotation, in radians. The direction of rotation
+ * is defined such that positive angles rotate in the direction from
+ * the positive X axis toward the positive Y axis. With the default
+ * axis orientation of cairo, positive angles rotate in a clockwise
+ * direction.
+ *
+ * Initialized @matrix to a transformation that rotates by @radians.
+ **/
+void
+cairo_matrix_init_rotate (cairo_matrix_t *matrix,
+ double radians)
{
double s;
double c;
@@ -287,36 +302,35 @@
s = sin (radians);
c = cos (radians);
#endif
- return cairo_matrix_set_affine (matrix,
- c, s,
- -s, c,
- 0, 0);
+ cairo_matrix_init (matrix,
+ c, s,
+ -s, c,
+ 0, 0);
}
+slim_hidden_def(cairo_matrix_init_rotate);
/**
* cairo_matrix_rotate:
* @matrix: a @cairo_matrix_t
- * @radians: angle of rotation, in radians. Angles are defined
- * so that an angle of 90 degrees (%M_PI/2 radians) rotates the
- * positive X axis into the positive Y axis. With the default
- * cairo choice of axis orientation, positive rotations are
- * clockwise.
+ * @radians: angle of rotation, in radians. The direction of rotation
+ * is defined such that positive angles rotate in the direction from
+ * the positive X axis toward the positive Y axis. With the default
+ * axis orientation of cairo, positive angles rotate in a clockwise
+ * direction.
*
* Applies rotation by @radians to the transformation in
* @matrix. The effect of the new transformation is to first rotate the
* coordinates by @radians, then apply the original transformation
* to the coordinates.
- *
- * Return value: %CAIRO_STATUS_SUCCESS, always.
**/
-cairo_status_t
+void
cairo_matrix_rotate (cairo_matrix_t *matrix, double radians)
{
cairo_matrix_t tmp;
- _cairo_matrix_set_rotate (&tmp, radians);
+ cairo_matrix_init_rotate (&tmp, radians);
- return cairo_matrix_multiply (matrix, &tmp, matrix);
+ cairo_matrix_multiply (matrix, &tmp, matrix);
}
/**
@@ -331,7 +345,7 @@
* coordinates and then apply the transformation in @b to the
* coordinates.
*
- * Return value: %CAIRO_STATUS_SUCCESS, always.
+ * It is allowable for @result to be identical to either @a or @b.
**/
/*
* XXX: The ordering of the arguments to this function corresponds
@@ -339,29 +353,21 @@
* then we need to switch the two arguments and fix up all
* uses.
*/
-cairo_status_t
+void
cairo_matrix_multiply (cairo_matrix_t *result, const cairo_matrix_t *a, const cairo_matrix_t *b)
{
cairo_matrix_t r;
- int row, col, n;
- double t;
- for (row = 0; row < 3; row++) {
- for (col = 0; col < 2; col++) {
- if (row == 2)
- t = b->m[2][col];
- else
- t = 0;
- for (n = 0; n < 2; n++) {
- t += a->m[row][n] * b->m[n][col];
- }
- r.m[row][col] = t;
- }
- }
+ r.xx = a->xx * b->xx + a->yx * b->xy;
+ r.yx = a->xx * b->yx + a->yx * b->yy;
- *result = r;
+ r.xy = a->xy * b->xx + a->yy * b->xy;
+ r.yy = a->xy * b->yx + a->yy * b->yy;
- return CAIRO_STATUS_SUCCESS;
+ r.x0 = a->x0 * b->xx + a->y0 * b->xy + b->x0;
+ r.y0 = a->x0 * b->yx + a->y0 * b->yy + b->y0;
+
+ *result = r;
}
slim_hidden_def(cairo_matrix_multiply);
@@ -385,23 +391,17 @@
* always transforms to the same vector. If (@x1, at y1) transforms
* to (@x2, at y2) then (@x1+ at dx1, at y1+@dy1) will transform to
* (@x1+ at dx2, at y1+@dy2) for all values of @x1 and @x2.
- *
- * Return value: %CAIRO_STATUS_SUCCESS, always.
**/
-cairo_status_t
+void
cairo_matrix_transform_distance (cairo_matrix_t *matrix, double *dx, double *dy)
{
double new_x, new_y;
- new_x = (matrix->m[0][0] * *dx
- + matrix->m[1][0] * *dy);
- new_y = (matrix->m[0][1] * *dx
- + matrix->m[1][1] * *dy);
+ new_x = (matrix->xx * *dx + matrix->xy * *dy);
+ new_y = (matrix->yx * *dx + matrix->yy * *dy);
*dx = new_x;
*dy = new_y;
-
- return CAIRO_STATUS_SUCCESS;
}
slim_hidden_def(cairo_matrix_transform_distance);
@@ -412,22 +412,18 @@
* @y: Y position. An in/out parameter
*
* Transforms the point (@x, @y) by @matrix.
- *
- * Return value: %CAIRO_STATUS_SUCCESS, always.
**/
-cairo_status_t
+void
cairo_matrix_transform_point (cairo_matrix_t *matrix, double *x, double *y)
{
cairo_matrix_transform_distance (matrix, x, y);
- *x += matrix->m[2][0];
- *y += matrix->m[2][1];
-
- return CAIRO_STATUS_SUCCESS;
+ *x += matrix->x0;
+ *y += matrix->y0;
}
slim_hidden_def(cairo_matrix_transform_point);
-cairo_status_t
+void
_cairo_matrix_transform_bounding_box (cairo_matrix_t *matrix,
double *x, double *y,
double *width, double *height)
@@ -477,18 +473,19 @@
*y = min_y;
*width = max_x - min_x;
*height = max_y - min_y;
-
- return CAIRO_STATUS_SUCCESS;
}
static void
_cairo_matrix_scalar_multiply (cairo_matrix_t *matrix, double scalar)
{
- int row, col;
+ matrix->xx *= scalar;
+ matrix->yx *= scalar;
- for (row = 0; row < 3; row++)
- for (col = 0; col < 2; col++)
- matrix->m[row][col] *= scalar;
+ matrix->xy *= scalar;
+ matrix->yy *= scalar;
+
+ matrix->x0 *= scalar;
+ matrix->y0 *= scalar;
}
/* This function isn't a correct adjoint in that the implicit 1 in the
@@ -501,14 +498,15 @@
/* adj (A) = transpose (C:cofactor (A,i,j)) */
double a, b, c, d, tx, 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];
+ cairo_matrix_get_affine (matrix,
+ &a, &b,
+ &c, &d,
+ &tx, &ty);
- cairo_matrix_set_affine (matrix,
- d, -b,
- -c, a,
- c*ty - d*tx, b*tx - a*ty);
+ cairo_matrix_init (matrix,
+ d, -b,
+ -c, a,
+ c*ty - d*tx, b*tx - a*ty);
}
/**
@@ -542,20 +540,18 @@
}
slim_hidden_def(cairo_matrix_invert);
-cairo_status_t
+void
_cairo_matrix_compute_determinant (cairo_matrix_t *matrix, double *det)
{
double a, b, c, d;
- a = matrix->m[0][0]; b = matrix->m[0][1];
- c = matrix->m[1][0]; d = matrix->m[1][1];
+ a = matrix->xx; b = matrix->yx;
+ c = matrix->xy; d = matrix->yy;
*det = a*d - b*c;
-
- return CAIRO_STATUS_SUCCESS;
}
-cairo_status_t
+void
_cairo_matrix_compute_eigen_values (cairo_matrix_t *matrix, double *lambda1, double *lambda2)
{
/* The eigenvalues of an NxN matrix M are found by solving the polynomial:
@@ -577,16 +573,12 @@
double a, b, c, d, rad;
- a = matrix->m[0][0];
- b = matrix->m[0][1];
- c = matrix->m[1][0];
- d = matrix->m[1][1];
+ a = matrix->xx; b = matrix->yx;
+ c = matrix->xy; d = matrix->yy;
rad = sqrt (a*a + 2*a*d + d*d - 4*(a*d - b*c));
*lambda1 = (a + d + rad) / 2.0;
*lambda2 = (a + d - rad) / 2.0;
-
- return CAIRO_STATUS_SUCCESS;
}
/* Compute the amount that each basis vector is scaled by. */
Index: cairo-pattern.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pattern.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- cairo-pattern.c 4 Apr 2005 16:47:12 -0000 1.28
+++ cairo-pattern.c 7 Apr 2005 17:01:49 -0000 1.29
@@ -58,7 +58,7 @@
pattern->filter = CAIRO_FILTER_DEFAULT;
pattern->alpha = 1.0;
- _cairo_matrix_init (&pattern->matrix);
+ cairo_matrix_init_identity (&pattern->matrix);
}
static cairo_status_t
@@ -354,13 +354,17 @@
cairo_status_t
cairo_pattern_set_matrix (cairo_pattern_t *pattern, cairo_matrix_t *matrix)
{
- return cairo_matrix_copy (&pattern->matrix, matrix);
+ cairo_matrix_copy (&pattern->matrix, matrix);
+
+ return CAIRO_STATUS_SUCCESS;
}
cairo_status_t
cairo_pattern_get_matrix (cairo_pattern_t *pattern, cairo_matrix_t *matrix)
{
- return cairo_matrix_copy (matrix, &pattern->matrix);
+ cairo_matrix_copy (matrix, &pattern->matrix);
+
+ return CAIRO_STATUS_SUCCESS;
}
cairo_status_t
@@ -953,7 +957,7 @@
attr->x_offset = -x;
attr->y_offset = -y;
- cairo_matrix_set_identity (&attr->matrix);
+ cairo_matrix_init_identity (&attr->matrix);
attr->extend = repeat ? CAIRO_EXTEND_REPEAT : CAIRO_EXTEND_NONE;
attr->filter = CAIRO_FILTER_NEAREST;
attr->acquired = FALSE;
@@ -986,7 +990,7 @@
return CAIRO_STATUS_NO_MEMORY;
attribs->x_offset = attribs->y_offset = 0;
- cairo_matrix_set_identity (&attribs->matrix);
+ cairo_matrix_init_identity (&attribs->matrix);
attribs->extend = CAIRO_EXTEND_REPEAT;
attribs->filter = CAIRO_FILTER_NEAREST;
attribs->acquired = FALSE;
@@ -1074,7 +1078,7 @@
attr->extend = CAIRO_EXTEND_NONE;
attr->filter = CAIRO_FILTER_NEAREST;
- cairo_matrix_set_identity (&attr->matrix);
+ cairo_matrix_init_identity (&attr->matrix);
}
else
{
@@ -1100,7 +1104,7 @@
if (_cairo_matrix_is_integer_translation (&pattern->base.matrix,
&tx, &ty))
{
- cairo_matrix_set_identity (&attr->matrix);
+ cairo_matrix_init_identity (&attr->matrix);
attr->x_offset = tx;
attr->y_offset = ty;
}
Index: cairo-pdf-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pdf-surface.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- cairo-pdf-surface.c 4 Apr 2005 13:49:19 -0000 1.24
+++ cairo-pdf-surface.c 7 Apr 2005 17:01:49 -0000 1.25
@@ -1293,9 +1293,9 @@
_cairo_output_stream_printf (output,
"q %f %f %f %f %f %f cm /res%d Do Q\r\n",
- i2u.m[0][0], i2u.m[0][1],
- i2u.m[1][0], i2u.m[1][1],
- i2u.m[2][0], i2u.m[2][1],
+ i2u.xx, i2u.yx,
+ i2u.xy, i2u.yy,
+ i2u.x0, i2u.y0,
id);
bail:
@@ -1337,9 +1337,9 @@
_cairo_output_stream_printf (output,
"q %f %f %f %f %f %f cm",
- i2u.m[0][0], i2u.m[0][1],
- i2u.m[1][0], i2u.m[1][1],
- i2u.m[2][0], i2u.m[2][1]);
+ i2u.xx, i2u.yx,
+ i2u.xy, i2u.yy,
+ i2u.x0, i2u.y0);
num_streams = _cairo_array_num_elements (&src->streams);
for (i = 0; i < num_streams; i++) {
@@ -1461,7 +1461,7 @@
/* BBox must be smaller than XStep by YStep or acroread wont
* display the pattern. */
- cairo_matrix_set_identity (&pm);
+ cairo_matrix_init_identity (&pm);
cairo_matrix_scale (&pm, image->width, image->height);
cairo_matrix_copy (&pm, &pattern->base.matrix);
cairo_matrix_invert (&pm);
@@ -1476,9 +1476,9 @@
" /Resources << /XObject << /res%d %d 0 R >> >>\r\n"
" /Matrix [ %f %f %f %f %f %f ]\r\n",
id, id,
- pm.m[0][0], pm.m[0][1],
- pm.m[1][0], pm.m[1][1],
- pm.m[2][0], pm.m[2][1]);
+ pm.xx, pm.yx,
+ pm.xy, pm.yy,
+ pm.x0, pm.y0);
stream = _cairo_pdf_document_open_stream (document, entries);
Index: cairo-pen.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pen.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- cairo-pen.c 23 Mar 2005 21:50:51 -0000 1.22
+++ cairo-pen.c 7 Apr 2005 17:01:49 -0000 1.23
@@ -374,8 +374,8 @@
double radius,
cairo_matrix_t *matrix)
{
- double a = matrix->m[0][0], c = matrix->m[0][1];
- double b = matrix->m[1][0], d = matrix->m[1][1];
+ double a = matrix->xx, b = matrix->yx;
+ double c = matrix->xy, d = matrix->yy;
double i = a*a + c*c;
double j = b*b + d*d;
Index: cairo-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-surface.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- cairo-surface.c 4 Apr 2005 13:49:19 -0000 1.51
+++ cairo-surface.c 7 Apr 2005 17:01:49 -0000 1.52
@@ -56,7 +56,7 @@
_cairo_array_init (&surface->user_data_slots,
sizeof (cairo_user_data_slot_t));
- _cairo_matrix_init (&surface->matrix);
+ cairo_matrix_init_identity (&surface->matrix);
surface->filter = CAIRO_FILTER_NEAREST;
surface->repeat = 0;
@@ -476,7 +476,9 @@
if (surface == NULL)
return CAIRO_STATUS_NULL_POINTER;
- return cairo_matrix_copy (&surface->matrix, matrix);
+ cairo_matrix_copy (&surface->matrix, matrix);
+
+ return CAIRO_STATUS_SUCCESS;
}
slim_hidden_def(cairo_surface_set_matrix);
@@ -489,7 +491,9 @@
if (surface == NULL)
return CAIRO_STATUS_NULL_POINTER;
- return cairo_matrix_copy (matrix, &surface->matrix);
+ cairo_matrix_copy (matrix, &surface->matrix);
+
+ return CAIRO_STATUS_SUCCESS;
}
slim_hidden_def(cairo_surface_get_matrix);
Index: cairo-win32-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-win32-font.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- cairo-win32-font.c 30 Mar 2005 21:34:51 -0000 1.11
+++ cairo-win32-font.c 7 Apr 2005 17:01:49 -0000 1.12
@@ -138,12 +138,12 @@
/* The font matrix has x and y "scale" components which we extract and
* use as character scale values.
*/
- cairo_matrix_set_affine (&font->logical_to_device,
- sc->matrix[0][0],
- sc->matrix[0][1],
- sc->matrix[1][0],
- sc->matrix[1][1],
- 0, 0);
+ cairo_matrix_init (&font->logical_to_device,
+ sc->matrix[0][0],
+ sc->matrix[0][1],
+ sc->matrix[1][0],
+ sc->matrix[1][1],
+ 0, 0);
if (!font->preserve_axes) {
_cairo_matrix_compute_scale_factors (&font->logical_to_device,
@@ -159,7 +159,7 @@
font->device_to_logical = font->logical_to_device;
if (!CAIRO_OK (cairo_matrix_invert (&font->device_to_logical)))
- cairo_matrix_set_identity (&font->device_to_logical);
+ cairo_matrix_init_identity (&font->device_to_logical);
}
static BYTE
Index: cairo-xlib-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-xlib-surface.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- cairo-xlib-surface.c 4 Apr 2005 16:47:12 -0000 1.55
+++ cairo-xlib-surface.c 7 Apr 2005 17:01:49 -0000 1.56
@@ -465,13 +465,13 @@
if (!surface->picture)
return CAIRO_STATUS_SUCCESS;
- xtransform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]);
- xtransform.matrix[0][1] = _cairo_fixed_from_double (matrix->m[1][0]);
- xtransform.matrix[0][2] = _cairo_fixed_from_double (matrix->m[2][0]);
+ xtransform.matrix[0][0] = _cairo_fixed_from_double (matrix->xx);
+ xtransform.matrix[0][1] = _cairo_fixed_from_double (matrix->xy);
+ xtransform.matrix[0][2] = _cairo_fixed_from_double (matrix->x0);
- xtransform.matrix[1][0] = _cairo_fixed_from_double (matrix->m[0][1]);
- xtransform.matrix[1][1] = _cairo_fixed_from_double (matrix->m[1][1]);
- xtransform.matrix[1][2] = _cairo_fixed_from_double (matrix->m[2][1]);
+ xtransform.matrix[1][0] = _cairo_fixed_from_double (matrix->yx);
+ xtransform.matrix[1][1] = _cairo_fixed_from_double (matrix->yy);
+ xtransform.matrix[1][2] = _cairo_fixed_from_double (matrix->y0);
xtransform.matrix[2][0] = 0;
xtransform.matrix[2][1] = 0;
Index: cairo.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- cairo.c 6 Apr 2005 20:01:13 -0000 1.71
+++ cairo.c 7 Apr 2005 17:01:49 -0000 1.72
@@ -1698,7 +1698,7 @@
**/
void
cairo_text_extents (cairo_t *cr,
- const char *utf8,
+ const char *utf8,
cairo_text_extents_t *extents)
{
cairo_glyph_t *glyphs = NULL;
@@ -2051,18 +2051,36 @@
/**
* 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.
**/
void
-cairo_get_matrix (cairo_t *cr, cairo_matrix_t *matrix)
+cairo_current_matrix (cairo_t *cr, cairo_matrix_t *matrix)
{
CAIRO_CHECK_SANITY (cr);
- _cairo_gstate_get_matrix (cr->gstate, matrix);
+ _cairo_gstate_current_matrix (cr->gstate, matrix);
CAIRO_CHECK_SANITY (cr);
}
-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.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- cairo.h 6 Apr 2005 20:01:13 -0000 1.91
+++ cairo.h 7 Apr 2005 17:01:49 -0000 1.92
@@ -94,7 +94,12 @@
* A #cairo_matrix_t holds an affine transformation, such as a scale,
* rotation, or shear, or a combination of those.
**/
-typedef struct _cairo_matrix cairo_matrix_t;
+typedef struct _cairo_matrix {
+ double xx; double yx;
+ double xy; double yy;
+ double x0; double y0;
+} cairo_matrix_t;
+
typedef struct _cairo_pattern cairo_pattern_t;
typedef enum cairo_status {
@@ -668,8 +673,12 @@
/* 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_get_matrix (cairo_t *cr, cairo_matrix_t *matrix);
+cairo_current_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? */
@@ -970,51 +979,67 @@
/* Matrix functions */
-/* XXX: Rename all of these to cairo_transform_t */
-
+/* XXX: Deprecated. To be removed in favor of a structure of known size. */
cairo_matrix_t *
cairo_matrix_create (void);
+/* XXX: Deprecated. To be removed in favor of a structure of known size. */
void
cairo_matrix_destroy (cairo_matrix_t *matrix);
-cairo_status_t
+/* XXX: Deprecated. To be removed in favor of direct assignment. */
+void
cairo_matrix_copy (cairo_matrix_t *matrix, const cairo_matrix_t *other);
-cairo_status_t
-cairo_matrix_set_identity (cairo_matrix_t *matrix);
+void
+cairo_matrix_init (cairo_matrix_t *matrix,
+ double a, double b,
+ double c, double d,
+ double tx, double ty);
-cairo_status_t
-cairo_matrix_set_affine (cairo_matrix_t *matrix,
- double a, double b,
- double c, double d,
- double tx, double ty);
+void
+cairo_matrix_init_identity (cairo_matrix_t *matrix);
-cairo_status_t
+void
+cairo_matrix_init_translate (cairo_matrix_t *matrix,
+ double tx, double ty);
+
+void
+cairo_matrix_init_scale (cairo_matrix_t *matrix,
+ double sx, double sy);
+
+void
+cairo_matrix_init_rotate (cairo_matrix_t *matrix,
+ double radians);
+
+/* XXX: Deprecated. To be removed in favor of direct access. */
+void
cairo_matrix_get_affine (cairo_matrix_t *matrix,
double *a, double *b,
double *c, double *d,
double *tx, double *ty);
-cairo_status_t
+void
cairo_matrix_translate (cairo_matrix_t *matrix, double tx, double ty);
-cairo_status_t
+void
cairo_matrix_scale (cairo_matrix_t *matrix, double sx, double sy);
-cairo_status_t
+void
cairo_matrix_rotate (cairo_matrix_t *matrix, double radians);
cairo_status_t
cairo_matrix_invert (cairo_matrix_t *matrix);
-cairo_status_t
-cairo_matrix_multiply (cairo_matrix_t *result, const cairo_matrix_t *a, const cairo_matrix_t *b);
+void
+cairo_matrix_multiply (cairo_matrix_t *result,
+ const cairo_matrix_t *a,
+ const cairo_matrix_t *b);
-cairo_status_t
+void
cairo_matrix_transform_distance (cairo_matrix_t *matrix, double *dx, double *dy);
-cairo_status_t
+void
cairo_matrix_transform_point (cairo_matrix_t *matrix, double *x, double *y);
/**
@@ -1068,6 +1093,8 @@
#define cairo_init_clip cairo_init_clip_DEPRECATED_BY_cairo_reset_clip
#define cairo_surface_create_for_image cairo_surface_create_for_image_DEPRECATED_BY_cairo_image_surface_create_for_data
#define cairo_default_matrix cairo_default_matrix_DEPRECATED_BY_cairo_identity_matrix
+#define cairo_matrix_set_affine cairo_matrix_set_affine_DEPRECTATED_BY_cairo_matrix_init
+#define cairo_matrix_set_identity cairo_matrix_set_identity_DEPRECATED_BY_cairo_matrix_init_identity
#else /* CAIRO_API_SHAKEUP_FLAG_DAY */
@@ -1085,7 +1112,6 @@
#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_status cairo_status
#define cairo_get_status_string cairo_status_string
@@ -1097,6 +1123,8 @@
#define cairo_init_clip cairo_reset_clip
#define cairo_surface_create_for_image cairo_image_surface_create_for_data
#define cairo_default_matrix cairo_identity_matrix
+#define cairo_matrix_set_affine cairo_matrix_init
+#define cairo_matrix_set_identity cairo_matrix_init_identity
#endif /* CAIRO_API_SHAKEUP_FLAG_DAY */
Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -d -r1.117 -r1.118
--- cairoint.h 6 Apr 2005 20:01:13 -0000 1.117
+++ cairoint.h 7 Apr 2005 17:01:49 -0000 1.118
@@ -630,10 +630,6 @@
int num_glyphs);
} cairo_surface_backend_t;
-struct _cairo_matrix {
- double m[3][2];
-};
-
typedef struct _cairo_format_masks {
int bpp;
unsigned long alpha_mask;
@@ -956,8 +952,11 @@
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_get_matrix (cairo_gstate_t *gstate, cairo_matrix_t *matrix);
+_cairo_gstate_current_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);
@@ -1564,32 +1563,14 @@
/* cairo_matrix.c */
cairo_private void
-_cairo_matrix_init (cairo_matrix_t *matrix);
-
-cairo_private void
-_cairo_matrix_fini (cairo_matrix_t *matrix);
-
-cairo_private cairo_status_t
-_cairo_matrix_set_translate (cairo_matrix_t *matrix,
- double tx, double ty);
-
-cairo_private cairo_status_t
-_cairo_matrix_set_scale (cairo_matrix_t *matrix,
- double sx, double sy);
-
-cairo_private cairo_status_t
-_cairo_matrix_set_rotate (cairo_matrix_t *matrix,
- double angle);
-
-cairo_private cairo_status_t
_cairo_matrix_transform_bounding_box (cairo_matrix_t *matrix,
double *x, double *y,
double *width, double *height);
-cairo_private cairo_status_t
+cairo_private void
_cairo_matrix_compute_determinant (cairo_matrix_t *matrix, double *det);
-cairo_private cairo_status_t
+cairo_private void
_cairo_matrix_compute_eigen_values (cairo_matrix_t *matrix, double *lambda1, double *lambda2);
cairo_private cairo_status_t
@@ -1758,8 +1739,11 @@
slim_hidden_proto(cairo_matrix_invert)
slim_hidden_proto(cairo_matrix_multiply)
slim_hidden_proto(cairo_matrix_scale)
-slim_hidden_proto(cairo_matrix_set_affine)
-slim_hidden_proto(cairo_matrix_set_identity)
+slim_hidden_proto(cairo_matrix_init)
+slim_hidden_proto(cairo_matrix_init_identity)
+slim_hidden_proto(cairo_matrix_init_translate)
+slim_hidden_proto(cairo_matrix_init_scale)
+slim_hidden_proto(cairo_matrix_init_rotate)
slim_hidden_proto(cairo_matrix_transform_distance)
slim_hidden_proto(cairo_matrix_transform_point)
slim_hidden_proto(cairo_move_to)
- Previous message: [cairo-commit] cairo/test .cvsignore, 1.12, 1.13 Makefile.am, 1.26,
1.27 transforms-ref.png, NONE, 1.1 transforms.c, NONE, 1.1
- Next message: [cairo-commit] cairo ChangeLog,1.474,1.475
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the cairo-commit
mailing list