summaryrefslogtreecommitdiff
path: root/src/cairo-pattern.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2013-05-31 16:44:29 +0200
committerChris Wilson <chris@chris-wilson.co.uk>2013-09-05 16:08:19 +0100
commitf0e2cd4494b1ac9a351d095fbeb53d702342d35c (patch)
treeec2f33d8745e42f1fce0e51e065bacc91edcd4cf /src/cairo-pattern.c
parent900fc4a890026e46a3b0a00967632f57074b8b93 (diff)
downloadcairo-f0e2cd4494b1ac9a351d095fbeb53d702342d35c.tar.gz
gstate: Handle device scale on surface as source
When creating a transformed pattern we must apply the device transform *before* the transform set on the pattern itself, otherwise e.g. its translation will not be affected by the device scale. We also fix up the device_transform related handling in _cairo_default_context_pop_group(). With a device scale we can no longer just use the device_transform_inverse to unset the device offset for the extents, so we make that a simple translate instead. We also remove some weird code that tries to handle the device transform but seems unnecessary (maybe a workaround for applying the device transform in the wrong order?). With that code removed things work fine, but with it things get translated wrongly when there is a scale.
Diffstat (limited to 'src/cairo-pattern.c')
-rw-r--r--src/cairo-pattern.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 940227d29..57b930b9e 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -2128,6 +2128,16 @@ cairo_pattern_get_extend (cairo_pattern_t *pattern)
slim_hidden_def (cairo_pattern_get_extend);
void
+_cairo_pattern_pretransform (cairo_pattern_t *pattern,
+ const cairo_matrix_t *ctm)
+{
+ if (pattern->status)
+ return;
+
+ cairo_matrix_multiply (&pattern->matrix, &pattern->matrix, ctm);
+}
+
+void
_cairo_pattern_transform (cairo_pattern_t *pattern,
const cairo_matrix_t *ctm_inverse)
{