summaryrefslogtreecommitdiff
path: root/src/cairo-matrix.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2006-06-10 00:12:51 -0700
committerCarl Worth <cworth@cworth.org>2006-06-10 00:12:51 -0700
commitb129f747c5c7edc37982f286940d3583c74cfee9 (patch)
treea3dc62821d78bb4134695164c348f7317bcd76f8 /src/cairo-matrix.c
parent24da744d03e961078e68691225fb1363e47b2b22 (diff)
Change {x,y}_device_offset values to a device_transform matrix.
This is a step toward allowing device scaling in addition to device offsets. So far, the scale values are still always 1.0 so only the translation is actually being used. But most of the code is in place for doing scaling as well and it just needs to be hooked up. There are some fragile parts in this code, all of which involve using the translation without the scale, (so grep for device_transform.x0 or device_transform->x0). Some of these are likely bugs that will hopefully be obvious once we start using the scale. Others are OK if only because we 'know' that we aren't ever setting device scaling on a surface that has a device offset (we only set device scaling on surfaces we create internally and we don't export device scaling to the user). All of these fragile parts in the code have been marked with comments of the form: XXX: FRAGILE.
Diffstat (limited to 'src/cairo-matrix.c')
-rw-r--r--src/cairo-matrix.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cairo-matrix.c b/src/cairo-matrix.c
index a3ab6aa0..ffaae605 100644
--- a/src/cairo-matrix.c
+++ b/src/cairo-matrix.c
@@ -529,6 +529,14 @@ _cairo_matrix_compute_scale_factors (const cairo_matrix_t *matrix,
}
cairo_bool_t
+_cairo_matrix_is_identity (const cairo_matrix_t *matrix)
+{
+ return (matrix->xx == 1.0 && matrix->yx == 0.0 &&
+ matrix->xy == 0.0 && matrix->yy == 1.0 &&
+ matrix->x0 == 0.0 && matrix->y0 == 0.0);
+}
+
+cairo_bool_t
_cairo_matrix_is_integer_translation(const cairo_matrix_t *m,
int *itx, int *ity)
{