xf86-video-intel: src/sna/sna_accel.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Jul 17 02:54:05 PDT 2013


 src/sna/sna_accel.c |   40 +++++++---------------------------------
 1 file changed, 7 insertions(+), 33 deletions(-)

New commits:
commit a764a6e69b23f644957cf3e4e98868464f458758
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jul 17 10:51:56 2013 +0100

    sna: Fix typo in computing box intersection
    
    Comparing y2 against y1 for the intersection was a silly typo,
    especially as the routine for computing the intersection already
    existed.
    
    Fixes regression in commit 34c9b759fbab8d548108e954d55de38c6f5bec31
    Author: Chris Wilson <chris at chris-wilson.co.uk>
    Date:   Tue Jul 16 19:39:37 2013 +0100
    
        sna: Note that borderClip region may be more than a singular box
    
    Reported-by: Clemens Eisserer <linuxhippy at gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66991
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 994e993..77233cd 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -5524,44 +5524,18 @@ sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 		 * VT is inactive, make sure the region isn't empty
 		 */
 		assert(!w->winSize.data);
-
-		if (region.extents.x1 < w->winSize.extents.x1)
-			region.extents.x1 = w->winSize.extents.x1;
-		if (region.extents.y1 < w->winSize.extents.y1)
-			region.extents.y1 = w->winSize.extents.y1;
-
-		if (region.extents.x2 > w->winSize.extents.x2)
-			region.extents.x2 = w->winSize.extents.x2;
-		if (region.extents.y2 > w->winSize.extents.y1)
-			region.extents.y2 = w->winSize.extents.y2;
-
-		if (w->borderClip.data == NULL) {
-			if (region.extents.x1 < w->borderClip.extents.x1)
-				region.extents.x1 = w->borderClip.extents.x1;
-			if (region.extents.y1 < w->borderClip.extents.y1)
-				region.extents.y1 = w->borderClip.extents.y1;
-
-			if (region.extents.x2 > w->borderClip.extents.x2)
-				region.extents.x2 = w->borderClip.extents.x2;
-			if (region.extents.y2 > w->borderClip.extents.y1)
-				region.extents.y2 = w->borderClip.extents.y2;
-		} else
+		box_intersect(&region.extents, &w->winSize.extents);
+		if (w->borderClip.data == NULL)
+			box_intersect(&region.extents, &w->borderClip.extents);
+		else
 			clip = &w->borderClip;
 	} else {
 		WindowPtr w = (WindowPtr)src;
 
 		DBG(("%s: window clip\n", __FUNCTION__));
-		if (w->clipList.data == NULL) {
-			if (region.extents.x1 < w->clipList.extents.x1)
-				region.extents.x1 = w->clipList.extents.x1;
-			if (region.extents.y1 < w->clipList.extents.y1)
-				region.extents.y1 = w->clipList.extents.y1;
-
-			if (region.extents.x2 > w->clipList.extents.x2)
-				region.extents.x2 = w->clipList.extents.x2;
-			if (region.extents.y2 > w->clipList.extents.y1)
-				region.extents.y2 = w->clipList.extents.y2;
-		} else
+		if (w->clipList.data == NULL)
+			box_intersect(&region.extents, &w->clipList.extents);
+		else
 			clip = &w->clipList;
 	}
 	if (clip == NULL) {


More information about the xorg-commit mailing list