diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-02-10 13:36:46 +0000 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-11-27 16:26:34 +0000 |
commit | 9b10f20f472e6b0d6114fb61c88906e349e47f2b (patch) | |
tree | 6e5bb888e49a88e0f569958cb8ccdc5ee2c9a779 /hw/xwin/winshadgdi.c | |
parent | 3ab95a2a5c848e8ce4c39be243fd5e2ac6bb1c1a (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>
Diffstat (limited to 'hw/xwin/winshadgdi.c')
-rw-r--r-- | hw/xwin/winshadgdi.c | 15 |
1 files changed, 5 insertions, 10 deletions
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); |