diff options
author | Carl Worth <cworth@cworth.org> | 2005-04-07 10:01:49 +0000 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2005-04-07 10:01:49 +0000 |
commit | d135938efd443e4adce63cf8c5926ac421b2d3ed (patch) | |
tree | f0398b406ea37889ff7604a834be4eedeeab91ae /src/cairo-pattern.c | |
parent | 92060c12ee2acc38541ec2398abba5e1569278de (diff) |
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.
Track changes to cairo_matrix_t interface.
Add a test case showing the same path drawn under various transforms, (including skews set directly by initializing a cairo_matrix_t).
Diffstat (limited to 'src/cairo-pattern.c')
-rw-r--r-- | src/cairo-pattern.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c index f0e615afb..6e1b3fca3 100644 --- a/src/cairo-pattern.c +++ b/src/cairo-pattern.c @@ -58,7 +58,7 @@ _cairo_pattern_init (cairo_pattern_t *pattern, cairo_pattern_type_t type) 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_pattern_add_color_stop (cairo_pattern_t *pattern, 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 @@ _cairo_pattern_acquire_surface_for_gradient (cairo_gradient_pattern_t *pattern, 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 @@ _cairo_pattern_acquire_surface_for_solid (cairo_solid_pattern_t *pattern, 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 @@ _cairo_pattern_acquire_surface_for_surface (cairo_surface_pattern_t *pattern, 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 @@ _cairo_pattern_acquire_surface_for_surface (cairo_surface_pattern_t *pattern, 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; } |