mi: Deobfuscate miWindowExposures

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2014-09-23 10:30:56 -04:00
parent 0d30d44a8c
commit fb34f27348

View File

@ -425,17 +425,11 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn)
{ {
RegionPtr exposures = prgn; RegionPtr exposures = prgn;
if ((prgn && !RegionNil(prgn)) || (exposures && !RegionNil(exposures))) { if (prgn && !RegionNil(prgn)) {
RegionRec expRec; RegionRec expRec;
int clientInterested; int clientInterested =
/*
* Restore from backing-store FIRST.
*/
clientInterested =
(pWin->eventMask | wOtherEventMasks(pWin)) & ExposureMask; (pWin->eventMask | wOtherEventMasks(pWin)) & ExposureMask;
if (clientInterested && exposures && if (clientInterested && (RegionNumRects(prgn) > RECTLIMIT)) {
(RegionNumRects(exposures) > RECTLIMIT)) {
/* /*
* If we have LOTS of rectangles, we decide to take the extents * If we have LOTS of rectangles, we decide to take the extents
* and force an exposure on that. This should require much less * and force an exposure on that. This should require much less
@ -444,34 +438,21 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn)
*/ */
BoxRec box; BoxRec box;
box = *RegionExtents(exposures); box = *RegionExtents(prgn);
if (exposures == prgn) { exposures = &expRec;
exposures = &expRec; RegionInit(exposures, &box, 1);
RegionInit(exposures, &box, 1); RegionReset(prgn, &box);
RegionReset(prgn, &box);
}
else {
RegionReset(exposures, &box);
RegionUnion(prgn, prgn, exposures);
}
/* miPaintWindow doesn't clip, so we have to */ /* miPaintWindow doesn't clip, so we have to */
RegionIntersect(prgn, prgn, &pWin->clipList); RegionIntersect(prgn, prgn, &pWin->clipList);
} }
if (prgn && !RegionNil(prgn)) miPaintWindow(pWin, prgn, PW_BACKGROUND);
miPaintWindow(pWin, prgn, PW_BACKGROUND); if (clientInterested)
if (clientInterested && exposures && !RegionNil(exposures))
miSendExposures(pWin, exposures, miSendExposures(pWin, exposures,
pWin->drawable.x, pWin->drawable.y); pWin->drawable.x, pWin->drawable.y);
if (exposures == &expRec) { if (exposures == &expRec)
RegionUninit(exposures); RegionUninit(exposures);
} RegionEmpty(prgn);
else if (exposures && exposures != prgn)
RegionDestroy(exposures);
if (prgn)
RegionEmpty(prgn);
} }
else if (exposures && exposures != prgn)
RegionDestroy(exposures);
} }
#ifdef ROOTLESS #ifdef ROOTLESS