summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-04-14 12:06:51 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-04-14 13:07:06 +0100
commit69a7737abeded6ee923643bd8a80a5a84e6a979c (patch)
treeea40d47c289b7a751b78d5a36189a8990f3b30c6 /src
parent1d2a46e0902d82b43a5e12af36521a6a7fd6ba39 (diff)
sna: Align texture subsurfaces to 2x2 texture samples
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_render.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 66e078a2..ec2aaadf 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -839,8 +839,15 @@ sna_render_pixmap_partial(struct sna *sna,
box.x2 = ALIGN(box.x2, tile_width * 8 / pixmap->drawable.bitsPerPixel);
offset = box.x1 * pixmap->drawable.bitsPerPixel / 8 / tile_width * tile_size;
- } else
+ } else {
+ box.y1 = box.y1 & ~1;
+ box.y2 = ALIGN(box.y2, 2);
+
+ box.x1 = box.x1 & ~1;
+ box.x2 = ALIGN(box.x2, 2);
+
offset = box.x1 * pixmap->drawable.bitsPerPixel / 8;
+ }
if (box.x2 > pixmap->drawable.width)
box.x2 = pixmap->drawable.width;