xf86-video-intel: src/sna/sna_dri.c src/sna/sna_glyphs.c src/sna/sna.h

Chris Wilson ickle at kemper.freedesktop.org
Fri Jul 6 06:18:39 PDT 2012


 src/sna/sna.h        |    8 ++++++++
 src/sna/sna_dri.c    |    4 +---
 src/sna/sna_glyphs.c |    4 +---
 3 files changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 24b59a8955eb15522ad334a541530aca937fcf07
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jul 6 14:16:36 2012 +0100

    sna: Refactor a common function: is_clipped()
    
    Had I done this earlier, I would not have the bug in the open-coded
    version. Le sigh.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna.h b/src/sna/sna.h
index bda3cb8..3219e15 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -703,4 +703,12 @@ inline static bool is_power_of_two(unsigned x)
 	return (x & (x-1)) == 0;
 }
 
+inline static bool is_clipped(const RegionRec *r,
+			      const DrawableRec *d)
+{
+	return (r->data ||
+		r->extents.x2 - r->extents.x1 != d->width ||
+		r->extents.y2 - r->extents.y1 != d->height);
+}
+
 #endif /* _SNA_H */
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 36b40a7..e1b5de6 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -522,9 +522,7 @@ sna_dri_copy_to_front(struct sna *sna, DrawablePtr draw, RegionPtr region,
 	if (draw->type != DRAWABLE_PIXMAP) {
 		WindowPtr win = (WindowPtr)draw;
 
-		if (win->clipList.data ||
-		    win->clipList.extents.x2 - win->clipList.extents.x1 != draw->width ||
-		    win->clipList.extents.y2 - win->clipList.extents.y1 != draw->height) {
+		if (is_clipped(&win->clipList, draw)) {
 			DBG(("%s: draw=(%d, %d), delta=(%d, %d), clip.extents=(%d, %d), (%d, %d)\n",
 			     __FUNCTION__, draw->x, draw->y,
 			     get_drawable_dx(draw), get_drawable_dy(draw),
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index d4ace9d..d9a3dcf 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -471,9 +471,7 @@ glyphs_to_dst(struct sna *sna,
 	     __FUNCTION__, op, src_x, src_y, nlist,
 	     list->xOff, list->yOff, dst->pDrawable->x, dst->pDrawable->y));
 
-	if (dst->pCompositeClip->extents.x2 - dst->pCompositeClip->extents.x1 < dst->pDrawable->width ||
-	    dst->pCompositeClip->extents.y2 - dst->pCompositeClip->extents.y1 < dst->pDrawable->height ||
-	    dst->pCompositeClip->data) {
+	if (is_clipped(dst->pCompositeClip, dst->pDrawable)) {
 		rects = REGION_RECTS(dst->pCompositeClip);
 		nrect = REGION_NUM_RECTS(dst->pCompositeClip);
 	} else


More information about the xorg-commit mailing list