summaryrefslogtreecommitdiff
path: root/src/cairo-pattern.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-10-22 18:29:02 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-10-30 17:14:27 +0000
commit9d2189afbd2aa1413f620a4d35016ef3be3fc0e9 (patch)
treefe7e1c06800ea7e99bb51365452f9e017782fda1 /src/cairo-pattern.c
parent2c277ddbea42222130b8b1c2a2b4934503b40188 (diff)
[pattern] Do not recompute the inverse if setting an identical matrix.
More micro-optimisation.
Diffstat (limited to 'src/cairo-pattern.c')
-rw-r--r--src/cairo-pattern.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 81fa62ad..064eeb6c 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -1055,6 +1055,9 @@ cairo_pattern_set_matrix (cairo_pattern_t *pattern,
if (pattern->status)
return;
+ if (memcmp (&pattern->matrix, matrix, sizeof (cairo_matrix_t)) == 0)
+ return;
+
pattern->matrix = *matrix;
inverse = *matrix;