summaryrefslogtreecommitdiff
path: root/src/sna/sna_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-06-28 00:35:14 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-06-28 09:45:47 +0100
commit0c93a0cf41cbfe88b18e9e69bd97bd75cf2404bd (patch)
tree28f345ea038914d8712e3f04d31d82e6134f2777 /src/sna/sna_render.c
parente33fbd6d7ff2a9efcc14974a05b5e1eb01bbce34 (diff)
sna: Compensate redirect drawing subrectangle inside an offset pixmap
Reported-by: Clemens Eisserer <linuxhippy@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66249 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_render.c')
-rw-r--r--src/sna/sna_render.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index db159fd3..dd757dd9 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -1911,10 +1911,15 @@ sna_render_composite_redirect(struct sna *sna,
DBG(("%s: dst pitch (%d) fits within render pipeline (%d)\n",
__FUNCTION__, op->dst.bo->pitch, sna->render.max_3d_pitch));
- box.x1 = x;
- box.x2 = bound(x, width);
- box.y1 = y;
- box.y2 = bound(y, height);
+ box.x1 = x + op->dst.x;
+ box.x2 = bound(box.x1, width);
+ box.y1 = y + op->dst.y;
+ box.y2 = bound(box.y1, height);
+
+ if (box.x1 < 0)
+ box.x1 = 0;
+ if (box.y1 < 0)
+ box.y1 = 0;
/* Ensure we align to an even tile row */
if (op->dst.bo->tiling) {