summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2011-03-19 13:38:06 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2011-03-19 15:51:58 -0400
commitae165af1ad3fed9d6443f5733afecfb3b577a1aa (patch)
treeec0cd62981ca1540bdd18d7d4887741f03f066d4
parentab8fd100430f7a142799960ce371b36f4c673cda (diff)
Generate tighter damage for PolyFillRect
https://bugzilla.redhat.com/show_bug.cgi?id=552000
-rw-r--r--src/uxa/uxa-damage.c35
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);
}
}