summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2012-02-10 13:36:46 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2012-11-27 16:26:34 +0000
commit9b10f20f472e6b0d6114fb61c88906e349e47f2b (patch)
tree6e5bb888e49a88e0f569958cb8ccdc5ee2c9a779
parent3ab95a2a5c848e8ce4c39be243fd5e2ac6bb1c1a (diff)
hw/xwin: Use pre-computed extent of damage for creating GDI region
When -clipupdates option is specified, use the pre-computed extent of damage, rather than computing a GDI region which combines all the individual boxes in the damage. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
-rw-r--r--hw/xwin/winshaddd.c14
-rw-r--r--hw/xwin/winshadddnl.c14
-rw-r--r--hw/xwin/winshadgdi.c15
3 files changed, 13 insertions, 30 deletions
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index 3afc57cd0..aad3a02a0 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -489,7 +489,7 @@ winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf)
POINT ptOrigin;
DWORD dwBox = RegionNumRects(damage);
BoxPtr pBox = RegionRects(damage);
- HRGN hrgnTemp = NULL, hrgnCombined = NULL;
+ HRGN hrgnCombined = NULL;
/*
* Return immediately if the app is not active
@@ -551,15 +551,9 @@ winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf)
BoxPtr pBoxExtents = RegionExtents(damage);
/* Compute a GDI region from the damaged region */
- hrgnCombined = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2);
- dwBox--;
- pBox++;
- while (dwBox--) {
- hrgnTemp = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2);
- CombineRgn(hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR);
- DeleteObject(hrgnTemp);
- pBox++;
- }
+ hrgnCombined =
+ CreateRectRgn(pBoxExtents->x1, pBoxExtents->y1, pBoxExtents->x2,
+ pBoxExtents->y2);
/* Install the GDI region as a clipping region */
SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined);
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index e7306151e..7668bd1c0 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -523,7 +523,7 @@ winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf)
POINT ptOrigin;
DWORD dwBox = RegionNumRects(damage);
BoxPtr pBox = RegionRects(damage);
- HRGN hrgnTemp = NULL, hrgnCombined = NULL;
+ HRGN hrgnCombined = NULL;
/*
* Return immediately if the app is not active
@@ -595,15 +595,9 @@ winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf)
BoxPtr pBoxExtents = RegionExtents(damage);
/* Compute a GDI region from the damaged region */
- hrgnCombined = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2);
- dwBox--;
- pBox++;
- while (dwBox--) {
- hrgnTemp = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2);
- CombineRgn(hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR);
- DeleteObject(hrgnTemp);
- pBox++;
- }
+ hrgnCombined =
+ CreateRectRgn(pBoxExtents->x1, pBoxExtents->y1, pBoxExtents->x2,
+ pBoxExtents->y2);
/* Install the GDI region as a clipping region */
SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined);
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index cdbb46bf2..912f7e41f 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -439,7 +439,7 @@ winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf)
DWORD dwBox = RegionNumRects(damage);
BoxPtr pBox = RegionRects(damage);
int x, y, w, h;
- HRGN hrgnTemp = NULL, hrgnCombined = NULL;
+ HRGN hrgnCombined = NULL;
#ifdef XWIN_UPDATESTATS
static DWORD s_dwNonUnitRegions = 0;
@@ -500,16 +500,11 @@ winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf)
}
}
else if (!pScreenInfo->fMultiWindow) {
+
/* Compute a GDI region from the damaged region */
- hrgnCombined = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2);
- dwBox--;
- pBox++;
- while (dwBox--) {
- hrgnTemp = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2);
- CombineRgn(hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR);
- DeleteObject(hrgnTemp);
- pBox++;
- }
+ hrgnCombined =
+ CreateRectRgn(pBoxExtents->x1, pBoxExtents->y1, pBoxExtents->x2,
+ pBoxExtents->y2);
/* Install the GDI region as a clipping region */
SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined);