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>
This commit is contained in:
parent
3ab95a2a5c
commit
9b10f20f47
|
@ -489,7 +489,7 @@ winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf)
|
||||||
POINT ptOrigin;
|
POINT ptOrigin;
|
||||||
DWORD dwBox = RegionNumRects(damage);
|
DWORD dwBox = RegionNumRects(damage);
|
||||||
BoxPtr pBox = RegionRects(damage);
|
BoxPtr pBox = RegionRects(damage);
|
||||||
HRGN hrgnTemp = NULL, hrgnCombined = NULL;
|
HRGN hrgnCombined = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return immediately if the app is not active
|
* Return immediately if the app is not active
|
||||||
|
@ -551,15 +551,9 @@ winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf)
|
||||||
BoxPtr pBoxExtents = RegionExtents(damage);
|
BoxPtr pBoxExtents = RegionExtents(damage);
|
||||||
|
|
||||||
/* Compute a GDI region from the damaged region */
|
/* Compute a GDI region from the damaged region */
|
||||||
hrgnCombined = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
hrgnCombined =
|
||||||
dwBox--;
|
CreateRectRgn(pBoxExtents->x1, pBoxExtents->y1, pBoxExtents->x2,
|
||||||
pBox++;
|
pBoxExtents->y2);
|
||||||
while (dwBox--) {
|
|
||||||
hrgnTemp = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
|
||||||
CombineRgn(hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR);
|
|
||||||
DeleteObject(hrgnTemp);
|
|
||||||
pBox++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Install the GDI region as a clipping region */
|
/* Install the GDI region as a clipping region */
|
||||||
SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined);
|
SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined);
|
||||||
|
|
|
@ -523,7 +523,7 @@ winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf)
|
||||||
POINT ptOrigin;
|
POINT ptOrigin;
|
||||||
DWORD dwBox = RegionNumRects(damage);
|
DWORD dwBox = RegionNumRects(damage);
|
||||||
BoxPtr pBox = RegionRects(damage);
|
BoxPtr pBox = RegionRects(damage);
|
||||||
HRGN hrgnTemp = NULL, hrgnCombined = NULL;
|
HRGN hrgnCombined = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return immediately if the app is not active
|
* Return immediately if the app is not active
|
||||||
|
@ -595,15 +595,9 @@ winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf)
|
||||||
BoxPtr pBoxExtents = RegionExtents(damage);
|
BoxPtr pBoxExtents = RegionExtents(damage);
|
||||||
|
|
||||||
/* Compute a GDI region from the damaged region */
|
/* Compute a GDI region from the damaged region */
|
||||||
hrgnCombined = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
hrgnCombined =
|
||||||
dwBox--;
|
CreateRectRgn(pBoxExtents->x1, pBoxExtents->y1, pBoxExtents->x2,
|
||||||
pBox++;
|
pBoxExtents->y2);
|
||||||
while (dwBox--) {
|
|
||||||
hrgnTemp = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
|
||||||
CombineRgn(hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR);
|
|
||||||
DeleteObject(hrgnTemp);
|
|
||||||
pBox++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Install the GDI region as a clipping region */
|
/* Install the GDI region as a clipping region */
|
||||||
SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined);
|
SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined);
|
||||||
|
|
|
@ -439,7 +439,7 @@ winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf)
|
||||||
DWORD dwBox = RegionNumRects(damage);
|
DWORD dwBox = RegionNumRects(damage);
|
||||||
BoxPtr pBox = RegionRects(damage);
|
BoxPtr pBox = RegionRects(damage);
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
HRGN hrgnTemp = NULL, hrgnCombined = NULL;
|
HRGN hrgnCombined = NULL;
|
||||||
|
|
||||||
#ifdef XWIN_UPDATESTATS
|
#ifdef XWIN_UPDATESTATS
|
||||||
static DWORD s_dwNonUnitRegions = 0;
|
static DWORD s_dwNonUnitRegions = 0;
|
||||||
|
@ -500,16 +500,11 @@ winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!pScreenInfo->fMultiWindow) {
|
else if (!pScreenInfo->fMultiWindow) {
|
||||||
|
|
||||||
/* Compute a GDI region from the damaged region */
|
/* Compute a GDI region from the damaged region */
|
||||||
hrgnCombined = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
hrgnCombined =
|
||||||
dwBox--;
|
CreateRectRgn(pBoxExtents->x1, pBoxExtents->y1, pBoxExtents->x2,
|
||||||
pBox++;
|
pBoxExtents->y2);
|
||||||
while (dwBox--) {
|
|
||||||
hrgnTemp = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
|
||||||
CombineRgn(hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR);
|
|
||||||
DeleteObject(hrgnTemp);
|
|
||||||
pBox++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Install the GDI region as a clipping region */
|
/* Install the GDI region as a clipping region */
|
||||||
SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined);
|
SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined);
|
||||||
|
|
Loading…
Reference in New Issue