summaryrefslogtreecommitdiff
path: root/src/sna/sna_blt.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-11-27 11:32:11 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-11-27 11:34:12 +0000
commitb2c9e9da639a134577485f83e0f66f54e2371b98 (patch)
tree9b72c74b462470fa954fd6a76f597c3dc1096648 /src/sna/sna_blt.c
parent1e06d19a00f5a5a05369deeb3c5ae15b282c0f92 (diff)
sna/blt: Avoid clobbering common state before converting to a BLT
In case we need to continue on with the render operation, we need to preserve the existing state. Reported-by: Jiri Slaby <jirislaby@gmail.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=57601 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_blt.c')
-rw-r--r--src/sna/sna_blt.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index ea11d00b..a2604237 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -1961,6 +1961,7 @@ sna_blt_composite__convert(struct sna *sna,
struct sna_composite_op *tmp)
{
uint32_t alpha_fixup;
+ int sx, sy;
uint8_t op;
#if DEBUG_NO_BLT || NO_BLT_COMPOSITE
@@ -2011,12 +2012,11 @@ sna_blt_composite__convert(struct sna *sna,
return false;
}
- tmp->u.blt.src_pixmap = NULL;
- tmp->u.blt.sx = tmp->src.offset[0];
- tmp->u.blt.sy = tmp->src.offset[1];
+ sx = tmp->src.offset[0];
+ sy = tmp->src.offset[1];
- x += tmp->src.offset[0];
- y += tmp->src.offset[1];
+ x += sx;
+ y += sy;
if (x < 0 || y < 0 ||
x + width > tmp->src.width ||
y + height > tmp->src.height) {
@@ -2034,8 +2034,8 @@ sna_blt_composite__convert(struct sna *sna,
yy + height > tmp->src.height)
return false;
- tmp->u.blt.sx += xx - x;
- tmp->u.blt.sy += yy - y;
+ sx += xx - x;
+ sy += yy - y;
} else
return false;
}
@@ -2054,6 +2054,10 @@ sna_blt_composite__convert(struct sna *sna,
__FUNCTION__,
tmp->dst.x, tmp->dst.y, tmp->u.blt.sx, tmp->u.blt.sy, alpha_fixup));
+ tmp->u.blt.src_pixmap = NULL;
+ tmp->u.blt.sx = sx;
+ tmp->u.blt.sy = sy;
+
if (alpha_fixup) {
tmp->blt = blt_composite_copy_with_alpha;
tmp->box = blt_composite_copy_box_with_alpha;