summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-10-26 11:47:45 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-10-27 10:25:33 +0100
commit5988422455ebb2a3b1cafadc1ff302c35a7a5039 (patch)
tree6aa33edf77b94cf082d0794b9201f859eb317967
parent3fc7cd2dc8e2b9c0d4143a9f6657f84050ae249a (diff)
sna: Handle degenerate copy area whilst wedged
We want to return early to avoid handing the empty box as the lower code makes the assumption that it has work to do. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 8df94eb8..153ec21f 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1708,6 +1708,8 @@ sna_copy_area(DrawablePtr src, DrawablePtr dst, GCPtr gc,
region.data = NULL;
if (gc->pCompositeClip)
RegionIntersect(&region, &region, gc->pCompositeClip);
+ if (!RegionNotEmpty(&region))
+ return NULL;
sna_drawable_move_region_to_cpu(dst, &region, true);
RegionTranslate(&region,
@@ -1891,6 +1893,10 @@ no_damage_clipped_translate:
no_damage_clipped:
region_set(&clip, extents);
region_maybe_clip(&clip, gc->pCompositeClip);
+ assert(clip.extents.x1 >= 0);
+ assert(clip.extents.y1 >= 0);
+ assert(clip.extents.x2 <= pixmap->drawable.width);
+ assert(clip.extents.y2 <= pixmap->drawable.height);
DBG(("%s: clip %d x [(%d, %d), (%d, %d)] x %d [(%d, %d)...]\n",
__FUNCTION__,
@@ -1991,6 +1997,10 @@ damage_clipped_translate:
damage_clipped:
region_set(&clip, extents);
region_maybe_clip(&clip, gc->pCompositeClip);
+ assert(clip.extents.x1 >= 0);
+ assert(clip.extents.y1 >= 0);
+ assert(clip.extents.x2 <= pixmap->drawable.width);
+ assert(clip.extents.y2 <= pixmap->drawable.height);
DBG(("%s: clip %d x [(%d, %d), (%d, %d)] x %d [(%d, %d)...]\n",
__FUNCTION__,