summaryrefslogtreecommitdiff
path: root/src/cairo-xcb-surface-render.c
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2012-06-03 16:53:49 +0200
committerUli Schlachter <psychon@znc.in>2012-06-25 21:18:18 +0200
commite704f64d8fcceb220c8c99092c19c2cfd4bd9330 (patch)
treefad47f846222598fc0fcea2b15f19cbc57f80861 /src/cairo-xcb-surface-render.c
parent13d61d7bdb7ec37ebb7324187aca1b9b9b1600cf (diff)
downloadcairo-e704f64d8fcceb220c8c99092c19c2cfd4bd9330.tar.gz
xcb: Handle recording surfaces differently
Let's say we are painting recording surface 'source' to xcb surface 'target' by replaying the source to a temporary surface 'tmp'. Previously, the xcb backend replayed the recording surface to tmp with just a translation and then used that as its source surface with the pattern's transformation. That means 'tmp' used the same coordinate system as 'source'. This patch changes this so that the transformation is applied during the replay and painting from 'tmp' to 'target' is just a simple translation, so 'tmp' now uses the same coordinate system as 'target'. This should produce way less better results, because transforming a recording surface should have less artifacts than transforming a raster surface. Fixes: record1414x-* record2x-* record90-* ps-surface-source Breaks (or rather, "exposes unrelated bug that I have not yet figured out in"): record-extend-*-similar Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'src/cairo-xcb-surface-render.c')
-rw-r--r--src/cairo-xcb-surface-render.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c
index 7736ed81b..c950f5cd8 100644
--- a/src/cairo-xcb-surface-render.c
+++ b/src/cairo-xcb-surface-render.c
@@ -1084,6 +1084,8 @@ record_to_picture (cairo_surface_t *target,
}
cairo_matrix_init_translate (&matrix, extents->x, extents->y);
+ cairo_matrix_multiply (&matrix, &matrix, &pattern->base.matrix);
+
status = _cairo_recording_surface_replay_with_clip (source,
&matrix, tmp,
NULL);
@@ -1095,13 +1097,7 @@ record_to_picture (cairo_surface_t *target,
/* Now that we have drawn this to an xcb surface, try again with that */
_cairo_pattern_init_static_copy (&tmp_pattern.base, &pattern->base);
tmp_pattern.surface = tmp;
-
- if (extents->x | extents->y) {
- cairo_matrix_t *pmatrix = &tmp_pattern.base.matrix;
-
- cairo_matrix_init_translate (&matrix, -extents->x, -extents->y);
- cairo_matrix_multiply (pmatrix, pmatrix, &matrix);
- }
+ cairo_matrix_init_translate (&tmp_pattern.base.matrix, -extents->x, -extents->y);
picture = _copy_to_picture ((cairo_xcb_surface_t *) tmp);
if (picture->base.status == CAIRO_STATUS_SUCCESS)