summaryrefslogtreecommitdiff
path: root/src/cairo-path-fixed.c
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2010-10-21 17:11:48 +0200
committerAndrea Canciani <ranma42@gmail.com>2010-10-29 17:31:23 +0200
commit929571b4b56d56c669eb4cbb3e109e2bd4620fb0 (patch)
tree913853f275bcda679ce9489ce40c39247254a03a /src/cairo-path-fixed.c
parent34f1db13a13f80733a7eb5bef4693c4df7a6fb4e (diff)
downloadcairo-929571b4b56d56c669eb4cbb3e109e2bd4620fb0.tar.gz
path: Cleanup _cairo_path_fixed_transform
Clean up the code and make sure that _cairo_path_fixed_translate is used whenever the _cairo_fixed_to_double rounding would result in the matrix being approximated with a translation.
Diffstat (limited to 'src/cairo-path-fixed.c')
-rw-r--r--src/cairo-path-fixed.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index 76fc196f6..f6b6cb456 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -975,6 +975,11 @@ _cairo_path_fixed_offset_and_scale (cairo_path_fixed_t *path,
cairo_path_buf_t *buf;
unsigned int i;
+ if (scalex == CAIRO_FIXED_ONE && scaley == CAIRO_FIXED_ONE) {
+ _cairo_path_fixed_translate (path, offx, offy);
+ return;
+ }
+
/* Recompute an approximation of the flags.
* It might be more strict than what is actually needed.
*/
@@ -1062,17 +1067,11 @@ _cairo_path_fixed_transform (cairo_path_fixed_t *path,
if (matrix->yx == 0.0 && matrix->xy == 0.0) {
/* Fast path for the common case of scale+transform */
- if (matrix->xx == 1. && matrix->yy == 1.) {
- _cairo_path_fixed_translate (path,
- _cairo_fixed_from_double (matrix->x0),
- _cairo_fixed_from_double (matrix->y0));
- } else {
- _cairo_path_fixed_offset_and_scale (path,
- _cairo_fixed_from_double (matrix->x0),
- _cairo_fixed_from_double (matrix->y0),
- _cairo_fixed_from_double (matrix->xx),
- _cairo_fixed_from_double (matrix->yy));
- }
+ _cairo_path_fixed_offset_and_scale (path,
+ _cairo_fixed_from_double (matrix->x0),
+ _cairo_fixed_from_double (matrix->y0),
+ _cairo_fixed_from_double (matrix->xx),
+ _cairo_fixed_from_double (matrix->yy));
return;
}