summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-09-24 15:43:53 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-09-24 15:43:53 +0100
commit7637f547ca34668ef9d4f0c417de16e7126927b5 (patch)
tree96d4cab9664ab213e1cad5064b2ba5cfbf1e46d0 /src
parent65a23ef90975f95444da103f45eb240b2895ef44 (diff)
sna: Tweak partial Picture extraction to prefer limiting to max 3D coordinates
Where possible, keep the offset of the partial Picture within the 3D coordinate limit so that we can use the DrawRectangle offset to automatically adjust the coordinates. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_render.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 71330c1f..af072f02 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -1977,6 +1977,14 @@ sna_render_composite_redirect(struct sna *sna,
box.x1 = box.x1 & ~(tile_width * 8 / op->dst.pixmap->drawable.bitsPerPixel - 1);
box.x2 = ALIGN(box.x2, tile_width * 8 / op->dst.pixmap->drawable.bitsPerPixel);
+ if (box.x1 > sna->render.max_3d_size &&
+ box.x2 <= 2*sna->render.max_3d_size)
+ box.x1 = sna->render.max_3d_size;
+
+ if (box.y1 > sna->render.max_3d_size &&
+ box.y2 <= 2*sna->render.max_3d_size)
+ box.y1 = sna->render.max_3d_size;
+
offset = box.x1 * op->dst.pixmap->drawable.bitsPerPixel / 8 / tile_width * tile_size;
} else {
if (sna->kgem.gen < 040) {
@@ -1993,6 +2001,14 @@ sna_render_composite_redirect(struct sna *sna,
box.x2 = ALIGN(box.x2, 2);
}
+ if (box.x1 > sna->render.max_3d_size &&
+ box.x2 <= 2*sna->render.max_3d_size)
+ box.x1 = sna->render.max_3d_size;
+
+ if (box.y1 > sna->render.max_3d_size &&
+ box.y2 <= 2*sna->render.max_3d_size)
+ box.y1 = sna->render.max_3d_size;
+
offset = box.x1 * op->dst.pixmap->drawable.bitsPerPixel / 8;
}