From ae165af1ad3fed9d6443f5733afecfb3b577a1aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= <ssp@redhat.com>
Date: Sat, 19 Mar 2011 13:38:06 -0400
Subject: [PATCH 09/13] Generate tighter damage for PolyFillRect
https://bugzilla.redhat.com/show_bug.cgi?id=552000
---
src/uxa/uxa-damage.c | 35 ++++++++++++++---------------------
1 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/src/uxa/uxa-damage.c b/src/uxa/uxa-damage.c
index 2259a43..586c466 100644
--- a/src/uxa/uxa-damage.c
+++ b/src/uxa/uxa-damage.c
@@ -869,29 +869,22 @@ uxa_damage_poly_fill_rect (RegionPtr region,
{
if (nRects && checkGCDamage (pGC))
{
- BoxRec box;
- xRectangle *pRectsTmp = pRects;
- int nRectsTmp = nRects;
-
- box.x1 = pRectsTmp->x;
- box.x2 = box.x1 + pRectsTmp->width;
- box.y1 = pRectsTmp->y;
- box.y2 = box.y1 + pRectsTmp->height;
-
- while(--nRectsTmp)
+ int i;
+
+ for (i = 0; i < nRects; ++i)
{
- pRectsTmp++;
- if(box.x1 > pRectsTmp->x) box.x1 = pRectsTmp->x;
- if(box.x2 < (pRectsTmp->x + pRectsTmp->width))
- box.x2 = pRectsTmp->x + pRectsTmp->width;
- if(box.y1 > pRectsTmp->y) box.y1 = pRectsTmp->y;
- if(box.y2 < (pRectsTmp->y + pRectsTmp->height))
- box.y2 = pRectsTmp->y + pRectsTmp->height;
+ xRectangle *rect = &(pRects[i]);
+ BoxRec box;
+
+ box.x1 = rect->x;
+ box.x2 = rect->x + rect->width;
+ box.y1 = rect->y;
+ box.y2 = rect->y + rect->height;
+
+ TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC);
+ if(BOX_NOT_EMPTY(box))
+ add_box (region, &box, pDrawable, pGC->subWindowMode);
}
-
- TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC);
- if(BOX_NOT_EMPTY(box))
- add_box (region, &box, pDrawable, pGC->subWindowMode);
}
}
--
1.7.4.4