[cairo-commit] cairo/src cairo-font.c, 1.45, 1.46 cairo-ft-font.c,
1.58, 1.59 cairo-gstate.c, 1.125, 1.126 cairo-image-surface.c,
1.40, 1.41 cairo-matrix.c, 1.26, 1.27 cairo-pattern.c, 1.36,
1.37 cairo.c, 1.91, 1.92 cairo.h, 1.116, 1.117 cairoint.h,
1.137, 1.138
Carl Worth
commit at pdx.freedesktop.org
Mon May 9 09:13:01 PDT 2005
Committed by: cworth
Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv14980/src
Modified Files:
cairo-font.c cairo-ft-font.c cairo-gstate.c
cairo-image-surface.c cairo-matrix.c cairo-pattern.c cairo.c
cairo.h cairoint.h
Log Message:
* src/cairo-font.c: (_cairo_simple_font_face_create_font),
(cairo_scaled_font_create), (_cairo_scaled_font_init):
* src/cairo-ft-font.c: (_ft_scaled_font_create),
(_cairo_ft_scaled_font_create), (_ft_font_face_create_font):
* src/cairo-gstate.c: (_cairo_gstate_transform),
(_cairo_gstate_set_matrix), (_cairo_gstate_set_font_matrix):
* src/cairo-image-surface.c: (_cairo_image_surface_set_matrix):
* src/cairo-matrix.c: (_cairo_matrix_get_affine),
(cairo_matrix_transform_distance), (cairo_matrix_transform_point),
(_cairo_matrix_transform_bounding_box),
(_cairo_matrix_compute_determinant),
(_cairo_matrix_compute_eigen_values),
(_cairo_matrix_compute_scale_factors),
(_cairo_matrix_is_integer_translation):
* src/cairo-pattern.c: (cairo_pattern_set_matrix),
(_cairo_pattern_transform):
* src/cairo.c: (cairo_transform), (cairo_set_matrix),
(cairo_set_font_matrix):
* src/cairo.h:
* src/cairoint.h: Push cairo_matrix_t const-correctness down
through the entire implmentation, (expanding on preliminary work
by Robert O'Callahan <rocallahan at novell.com>)
Index: cairo-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-font.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- cairo-font.c 14 Apr 2005 13:05:59 -0000 1.45
+++ cairo-font.c 9 May 2005 16:12:52 -0000 1.46
@@ -344,8 +344,8 @@
static cairo_status_t
_cairo_simple_font_face_create_font (void *abstract_face,
- cairo_matrix_t *font_matrix,
- cairo_matrix_t *ctm,
+ const cairo_matrix_t *font_matrix,
+ const cairo_matrix_t *ctm,
cairo_scaled_font_t **scaled_font)
{
const cairo_scaled_font_backend_t *backend = CAIRO_FONT_BACKEND_DEFAULT;
@@ -429,8 +429,8 @@
typedef struct {
cairo_cache_entry_base_t base;
cairo_font_face_t *font_face;
- cairo_matrix_t *font_matrix;
- cairo_matrix_t *ctm;
+ const cairo_matrix_t *font_matrix;
+ const cairo_matrix_t *ctm;
} cairo_font_cache_key_t;
typedef struct {
@@ -706,9 +706,9 @@
* cairo_scaled_font_destroy()
**/
cairo_scaled_font_t *
-cairo_scaled_font_create (cairo_font_face_t *font_face,
- cairo_matrix_t *font_matrix,
- cairo_matrix_t *ctm)
+cairo_scaled_font_create (cairo_font_face_t *font_face,
+ const cairo_matrix_t *font_matrix,
+ const cairo_matrix_t *ctm)
{
cairo_font_cache_entry_t *entry;
cairo_font_cache_key_t key;
@@ -739,8 +739,8 @@
void
_cairo_scaled_font_init (cairo_scaled_font_t *scaled_font,
- cairo_matrix_t *font_matrix,
- cairo_matrix_t *ctm,
+ const cairo_matrix_t *font_matrix,
+ const cairo_matrix_t *ctm,
const cairo_scaled_font_backend_t *backend)
{
scaled_font->font_matrix = *font_matrix;
Index: cairo-ft-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ft-font.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- cairo-ft-font.c 6 May 2005 20:32:53 -0000 1.58
+++ cairo-ft-font.c 9 May 2005 16:12:52 -0000 1.59
@@ -709,10 +709,10 @@
}
static cairo_scaled_font_t *
-_ft_scaled_font_create (ft_unscaled_font_t *unscaled,
- int load_flags,
- cairo_matrix_t *font_matrix,
- cairo_matrix_t *ctm)
+_ft_scaled_font_create (ft_unscaled_font_t *unscaled,
+ int load_flags,
+ const cairo_matrix_t *font_matrix,
+ const cairo_matrix_t *ctm)
{
cairo_ft_scaled_font_t *f = NULL;
@@ -734,8 +734,8 @@
_cairo_ft_scaled_font_create (const char *family,
cairo_font_slant_t slant,
cairo_font_weight_t weight,
- cairo_matrix_t *font_matrix,
- cairo_matrix_t *ctm,
+ const cairo_matrix_t *font_matrix,
+ const cairo_matrix_t *ctm,
cairo_scaled_font_t **font)
{
FcPattern *pattern, *resolved;
@@ -1386,13 +1386,14 @@
static cairo_status_t
_ft_font_face_create_font (void *abstract_face,
- cairo_matrix_t *font_matrix,
- cairo_matrix_t *ctm,
+ const cairo_matrix_t *font_matrix,
+ const cairo_matrix_t *ctm,
cairo_scaled_font_t **scaled_font)
{
ft_font_face_t *font_face = abstract_face;
- *scaled_font = _ft_scaled_font_create (font_face->unscaled, font_face->load_flags,
+ *scaled_font = _ft_scaled_font_create (font_face->unscaled,
+ font_face->load_flags,
font_matrix, ctm);
if (*scaled_font)
return CAIRO_STATUS_SUCCESS;
Index: cairo-gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-gstate.c,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -d -r1.125 -r1.126
--- cairo-gstate.c 7 May 2005 04:25:56 -0000 1.125
+++ cairo-gstate.c 9 May 2005 16:12:52 -0000 1.126
@@ -601,7 +601,8 @@
}
cairo_status_t
-_cairo_gstate_transform (cairo_gstate_t *gstate, cairo_matrix_t *matrix)
+_cairo_gstate_transform (cairo_gstate_t *gstate,
+ const cairo_matrix_t *matrix)
{
cairo_matrix_t tmp;
@@ -617,8 +618,8 @@
}
cairo_status_t
-_cairo_gstate_set_matrix (cairo_gstate_t *gstate,
- cairo_matrix_t *matrix)
+_cairo_gstate_set_matrix (cairo_gstate_t *gstate,
+ const cairo_matrix_t *matrix)
{
cairo_status_t status;
@@ -1723,8 +1724,8 @@
}
cairo_status_t
-_cairo_gstate_set_font_matrix (cairo_gstate_t *gstate,
- cairo_matrix_t *matrix)
+_cairo_gstate_set_font_matrix (cairo_gstate_t *gstate,
+ const cairo_matrix_t *matrix)
{
_cairo_gstate_unset_font (gstate);
Index: cairo-image-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-image-surface.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- cairo-image-surface.c 6 May 2005 20:32:53 -0000 1.40
+++ cairo-image-surface.c 9 May 2005 16:12:52 -0000 1.41
@@ -354,7 +354,7 @@
cairo_status_t
_cairo_image_surface_set_matrix (cairo_image_surface_t *surface,
- cairo_matrix_t *matrix)
+ const cairo_matrix_t *matrix)
{
pixman_transform_t pixman_transform;
Index: cairo-matrix.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-matrix.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- cairo-matrix.c 6 May 2005 20:32:53 -0000 1.26
+++ cairo-matrix.c 9 May 2005 16:12:52 -0000 1.27
@@ -113,7 +113,7 @@
* names (such as a,b,c,d,e,f) for particular manipulations.
**/
void
-_cairo_matrix_get_affine (cairo_matrix_t *matrix,
+_cairo_matrix_get_affine (const cairo_matrix_t *matrix,
double *xx, double *yx,
double *xy, double *yy,
double *x0, double *y0)
@@ -326,7 +326,7 @@
* (@x1+ at dx2, at y1+@dy2) for all values of @x1 and @x2.
**/
void
-cairo_matrix_transform_distance (cairo_matrix_t *matrix, double *dx, double *dy)
+cairo_matrix_transform_distance (const cairo_matrix_t *matrix, double *dx, double *dy)
{
double new_x, new_y;
@@ -347,7 +347,7 @@
* Transforms the point (@x, @y) by @matrix.
**/
void
-cairo_matrix_transform_point (cairo_matrix_t *matrix, double *x, double *y)
+cairo_matrix_transform_point (const cairo_matrix_t *matrix, double *x, double *y)
{
cairo_matrix_transform_distance (matrix, x, y);
@@ -357,7 +357,7 @@
slim_hidden_def(cairo_matrix_transform_point);
void
-_cairo_matrix_transform_bounding_box (cairo_matrix_t *matrix,
+_cairo_matrix_transform_bounding_box (const cairo_matrix_t *matrix,
double *x, double *y,
double *width, double *height)
{
@@ -474,7 +474,8 @@
slim_hidden_def(cairo_matrix_invert);
void
-_cairo_matrix_compute_determinant (cairo_matrix_t *matrix, double *det)
+_cairo_matrix_compute_determinant (const cairo_matrix_t *matrix,
+ double *det)
{
double a, b, c, d;
@@ -485,7 +486,8 @@
}
void
-_cairo_matrix_compute_eigen_values (cairo_matrix_t *matrix, double *lambda1, double *lambda2)
+_cairo_matrix_compute_eigen_values (const cairo_matrix_t *matrix,
+ double *lambda1, double *lambda2)
{
/* The eigenvalues of an NxN matrix M are found by solving the polynomial:
@@ -516,7 +518,8 @@
/* Compute the amount that each basis vector is scaled by. */
cairo_status_t
-_cairo_matrix_compute_scale_factors (cairo_matrix_t *matrix, double *sx, double *sy, int x_major)
+_cairo_matrix_compute_scale_factors (const cairo_matrix_t *matrix,
+ double *sx, double *sy, int x_major)
{
double det;
@@ -557,7 +560,7 @@
}
cairo_bool_t
-_cairo_matrix_is_integer_translation(cairo_matrix_t *mat,
+_cairo_matrix_is_integer_translation(const cairo_matrix_t *mat,
int *itx, int *ity)
{
double a, b, c, d, tx, ty;
Index: cairo-pattern.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pattern.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- cairo-pattern.c 7 May 2005 04:25:56 -0000 1.36
+++ cairo-pattern.c 9 May 2005 16:12:52 -0000 1.37
@@ -370,7 +370,8 @@
}
cairo_status_t
-cairo_pattern_set_matrix (cairo_pattern_t *pattern, cairo_matrix_t *matrix)
+cairo_pattern_set_matrix (cairo_pattern_t *pattern,
+ const cairo_matrix_t *matrix)
{
pattern->matrix = *matrix;
@@ -414,8 +415,8 @@
}
void
-_cairo_pattern_transform (cairo_pattern_t *pattern,
- cairo_matrix_t *ctm_inverse)
+_cairo_pattern_transform (cairo_pattern_t *pattern,
+ const cairo_matrix_t *ctm_inverse)
{
cairo_matrix_multiply (&pattern->matrix, ctm_inverse, &pattern->matrix);
}
Index: cairo.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- cairo.c 7 May 2005 04:33:22 -0000 1.91
+++ cairo.c 9 May 2005 16:12:52 -0000 1.92
@@ -675,7 +675,8 @@
* user space takes place after any existing transformation.
**/
void
-cairo_transform (cairo_t *cr, cairo_matrix_t *matrix)
+cairo_transform (cairo_t *cr,
+ const cairo_matrix_t *matrix)
{
CAIRO_CHECK_SANITY (cr);
if (cr->status)
@@ -694,8 +695,8 @@
* equal to @matrix.
**/
void
-cairo_set_matrix (cairo_t *cr,
- cairo_matrix_t *matrix)
+cairo_set_matrix (cairo_t *cr,
+ const cairo_matrix_t *matrix)
{
CAIRO_CHECK_SANITY (cr);
if (cr->status)
@@ -1638,7 +1639,8 @@
* or stretch it unequally along the two axes
**/
void
-cairo_set_font_matrix (cairo_t *cr, cairo_matrix_t *matrix)
+cairo_set_font_matrix (cairo_t *cr,
+ const cairo_matrix_t *matrix)
{
CAIRO_CHECK_SANITY (cr);
if (cr->status)
Index: cairo.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.h,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- cairo.h 7 May 2005 05:42:52 -0000 1.116
+++ cairo.h 9 May 2005 16:12:52 -0000 1.117
@@ -342,12 +342,12 @@
cairo_rotate (cairo_t *cr, double angle);
void
-cairo_transform (cairo_t *cr,
- cairo_matrix_t *matrix);
+cairo_transform (cairo_t *cr,
+ const cairo_matrix_t *matrix);
void
-cairo_set_matrix (cairo_t *cr,
- cairo_matrix_t *matrix);
+cairo_set_matrix (cairo_t *cr,
+ const cairo_matrix_t *matrix);
void
cairo_identity_matrix (cairo_t *cr);
@@ -652,8 +652,8 @@
cairo_set_font_size (cairo_t *cr, double size);
void
-cairo_set_font_matrix (cairo_t *cr,
- cairo_matrix_t *matrix);
+cairo_set_font_matrix (cairo_t *cr,
+ const cairo_matrix_t *matrix);
cairo_matrix_t
cairo_get_font_matrix (cairo_t *cr, cairo_matrix_t *matrix);
@@ -712,9 +712,9 @@
/* Portable interface to general font features. */
cairo_scaled_font_t *
-cairo_scaled_font_create (cairo_font_face_t *font_face,
- cairo_matrix_t *font_matrix,
- cairo_matrix_t *ctm);
+cairo_scaled_font_create (cairo_font_face_t *font_face,
+ const cairo_matrix_t *font_matrix,
+ const cairo_matrix_t *ctm);
void
cairo_scaled_font_reference (cairo_scaled_font_t *scaled_font);
@@ -1023,10 +1023,12 @@
double alpha);
cairo_status_t
-cairo_pattern_set_matrix (cairo_pattern_t *pattern, cairo_matrix_t *matrix);
+cairo_pattern_set_matrix (cairo_pattern_t *pattern,
+ const cairo_matrix_t *matrix);
cairo_status_t
-cairo_pattern_get_matrix (cairo_pattern_t *pattern, cairo_matrix_t *matrix);
+cairo_pattern_get_matrix (cairo_pattern_t *pattern,
+ cairo_matrix_t *matrix);
typedef enum {
CAIRO_EXTEND_NONE,
@@ -1097,11 +1099,13 @@
/* XXX: Need a new name here perhaps. */
void
-cairo_matrix_transform_distance (cairo_matrix_t *matrix, double *dx, double *dy);
+cairo_matrix_transform_distance (const cairo_matrix_t *matrix,
+ double *dx, double *dy);
/* XXX: Need a new name here perhaps. */
void
-cairo_matrix_transform_point (cairo_matrix_t *matrix, double *x, double *y);
+cairo_matrix_transform_point (const cairo_matrix_t *matrix,
+ double *x, double *y);
#ifndef _CAIROINT_H_
Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -r1.137 -r1.138
--- cairoint.h 7 May 2005 04:33:22 -0000 1.137
+++ cairoint.h 9 May 2005 16:12:52 -0000 1.138
@@ -488,8 +488,8 @@
cairo_status_t (*create) (const char *family,
cairo_font_slant_t slant,
cairo_font_weight_t weight,
- cairo_matrix_t *font_matrix,
- cairo_matrix_t *ctm,
+ const cairo_matrix_t *font_matrix,
+ const cairo_matrix_t *ctm,
cairo_scaled_font_t **font);
void (*destroy) (void *font);
@@ -539,8 +539,8 @@
*/
void (*destroy) (void *font_face);
cairo_status_t (*create_font) (void *font_face,
- cairo_matrix_t *font_matrix,
- cairo_matrix_t *ctm,
+ const cairo_matrix_t *font_matrix,
+ const cairo_matrix_t *ctm,
cairo_scaled_font_t **scaled_font);
};
@@ -1025,12 +1025,12 @@
_cairo_gstate_rotate (cairo_gstate_t *gstate, double angle);
cairo_private cairo_status_t
-_cairo_gstate_transform (cairo_gstate_t *gstate,
- cairo_matrix_t *matrix);
+_cairo_gstate_transform (cairo_gstate_t *gstate,
+ const cairo_matrix_t *matrix);
cairo_private cairo_status_t
-_cairo_gstate_set_matrix (cairo_gstate_t *gstate,
- cairo_matrix_t *matrix);
+_cairo_gstate_set_matrix (cairo_gstate_t *gstate,
+ const cairo_matrix_t *matrix);
cairo_private cairo_status_t
_cairo_gstate_identity_matrix (cairo_gstate_t *gstate);
@@ -1126,8 +1126,8 @@
_cairo_gstate_get_font_matrix (cairo_gstate_t *gstate);
cairo_private cairo_status_t
-_cairo_gstate_set_font_matrix (cairo_gstate_t *gstate,
- cairo_matrix_t *matrix);
+_cairo_gstate_set_font_matrix (cairo_gstate_t *gstate,
+ const cairo_matrix_t *matrix);
cairo_private cairo_status_t
_cairo_gstate_get_font_face (cairo_gstate_t *gstate,
@@ -1218,8 +1218,8 @@
cairo_private void
_cairo_scaled_font_init (cairo_scaled_font_t *scaled_font,
- cairo_matrix_t *font_matrix,
- cairo_matrix_t *ctm,
+ const cairo_matrix_t *font_matrix,
+ const cairo_matrix_t *ctm,
const cairo_scaled_font_backend_t *backend);
cairo_private void
@@ -1524,7 +1524,7 @@
cairo_private cairo_status_t
_cairo_image_surface_set_matrix (cairo_image_surface_t *surface,
- cairo_matrix_t *matrix);
+ const cairo_matrix_t *matrix);
cairo_private cairo_status_t
_cairo_image_surface_set_filter (cairo_image_surface_t *surface,
@@ -1615,27 +1615,30 @@
/* cairo_matrix.c */
cairo_private void
-_cairo_matrix_get_affine (cairo_matrix_t *matrix,
+_cairo_matrix_get_affine (const cairo_matrix_t *matrix,
double *xx, double *yx,
double *xy, double *yy,
double *x0, double *y0);
cairo_private void
-_cairo_matrix_transform_bounding_box (cairo_matrix_t *matrix,
+_cairo_matrix_transform_bounding_box (const cairo_matrix_t *matrix,
double *x, double *y,
double *width, double *height);
cairo_private void
-_cairo_matrix_compute_determinant (cairo_matrix_t *matrix, double *det);
+_cairo_matrix_compute_determinant (const cairo_matrix_t *matrix, double *det);
cairo_private void
-_cairo_matrix_compute_eigen_values (cairo_matrix_t *matrix, double *lambda1, double *lambda2);
+_cairo_matrix_compute_eigen_values (const cairo_matrix_t *matrix,
+ double *lambda1, double *lambda2);
cairo_private cairo_status_t
-_cairo_matrix_compute_scale_factors (cairo_matrix_t *matrix, double *sx, double *sy, int x_major);
+_cairo_matrix_compute_scale_factors (const cairo_matrix_t *matrix,
+ double *sx, double *sy, int x_major);
cairo_private cairo_bool_t
-_cairo_matrix_is_integer_translation(cairo_matrix_t *matrix, int *itx, int *ity);
+_cairo_matrix_is_integer_translation(const cairo_matrix_t *matrix,
+ int *itx, int *ity);
/* cairo_traps.c */
cairo_private void
@@ -1711,8 +1714,8 @@
_cairo_pattern_create_solid (const cairo_color_t *color);
cairo_private void
-_cairo_pattern_transform (cairo_pattern_t *pattern,
- cairo_matrix_t *ctm_inverse);
+_cairo_pattern_transform (cairo_pattern_t *pattern,
+ const cairo_matrix_t *ctm_inverse);
cairo_private cairo_bool_t
_cairo_pattern_is_opaque_solid (cairo_pattern_t *pattern);
More information about the cairo-commit
mailing list