summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-10-13 17:32:54 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-10-13 17:52:10 +0100
commiteb5f86b78181b174664aaa9bc689db5421b7e7bd (patch)
treef7a5f1bf4bb0eea51764cdf7b5797ecfdaf51032
parenta4766026ad0aa14283e35598d33f13d311cc029b (diff)
sna/accel: Correctly offset the damage intersection for glyph runs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 4d41881f..99b0cef2 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -3179,6 +3179,8 @@ sna_glyph_blt(DrawablePtr drawable, GCPtr gc,
region_set(&clip, extents);
region_maybe_clip(&clip, gc->pCompositeClip);
+ if (RegionNotEmpty(&clip))
+ return false;
/* XXX loop over clips using SETUP_CLIP? */
if (clip.data != NULL) {
@@ -3193,6 +3195,11 @@ sna_glyph_blt(DrawablePtr drawable, GCPtr gc,
x += drawable->x + dx;
y += drawable->y + dy;
+ clip.extents.x1 += dx;
+ clip.extents.x2 += dx;
+ clip.extents.y1 += dy;
+ clip.extents.y2 += dy;
+
kgem_set_mode(&sna->kgem, KGEM_BLT);
if (!kgem_check_batch(&sna->kgem, 16) ||
!kgem_check_bo_fenced(&sna->kgem, priv->gpu_bo, NULL) ||
@@ -3209,8 +3216,8 @@ sna_glyph_blt(DrawablePtr drawable, GCPtr gc,
b[1] >>= 2;
}
b[1] |= 1 << 30 | transparent << 29 | blt_depth(drawable->depth) << 24 | rop << 16;
- b[2] = (dy + clip.extents.y1) << 16 | (dx + clip.extents.x1);
- b[3] = (dy + clip.extents.y2) << 16 | (dx + clip.extents.x2);
+ b[2] = clip.extents.y1 << 16 | clip.extents.x1;
+ b[3] = clip.extents.y2 << 16 | clip.extents.x2;
b[4] = kgem_add_reloc(&sna->kgem, sna->kgem.nbatch + 4,
priv->gpu_bo,
I915_GEM_DOMAIN_RENDER << 16 |
@@ -3255,8 +3262,8 @@ sna_glyph_blt(DrawablePtr drawable, GCPtr gc,
b[1] >>= 2;
}
b[1] |= 1 << 30 | transparent << 29 | blt_depth(drawable->depth) << 24 | rop << 16;
- b[2] = (dy + clip.extents.y1) << 16 | (dx + clip.extents.x1);
- b[3] = (dy + clip.extents.y2) << 16 | (dx + clip.extents.x2);
+ b[2] = clip.extents.y1 << 16 | clip.extents.x1;
+ b[3] = clip.extents.y2 << 16 | clip.extents.x2;
b[4] = kgem_add_reloc(&sna->kgem, sna->kgem.nbatch + 4,
priv->gpu_bo,
I915_GEM_DOMAIN_RENDER << 16 |
@@ -3297,7 +3304,7 @@ sna_glyph_blt(DrawablePtr drawable, GCPtr gc,
r.y1 = y1;
r.x2 = x1 + w;
r.y2 = y1 + h;
- if (box_intersect(&r, extents))
+ if (box_intersect(&r, &clip.extents))
sna_damage_add_box(damage, &r);
}
skip: