mi: Deobfuscate miWindowExposures
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
0d30d44a8c
commit
fb34f27348
|
@ -425,17 +425,11 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn)
|
|||
{
|
||||
RegionPtr exposures = prgn;
|
||||
|
||||
if ((prgn && !RegionNil(prgn)) || (exposures && !RegionNil(exposures))) {
|
||||
if (prgn && !RegionNil(prgn)) {
|
||||
RegionRec expRec;
|
||||
int clientInterested;
|
||||
|
||||
/*
|
||||
* Restore from backing-store FIRST.
|
||||
*/
|
||||
clientInterested =
|
||||
int clientInterested =
|
||||
(pWin->eventMask | wOtherEventMasks(pWin)) & ExposureMask;
|
||||
if (clientInterested && exposures &&
|
||||
(RegionNumRects(exposures) > RECTLIMIT)) {
|
||||
if (clientInterested && (RegionNumRects(prgn) > RECTLIMIT)) {
|
||||
/*
|
||||
* If we have LOTS of rectangles, we decide to take the extents
|
||||
* and force an exposure on that. This should require much less
|
||||
|
@ -444,34 +438,21 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn)
|
|||
*/
|
||||
BoxRec box;
|
||||
|
||||
box = *RegionExtents(exposures);
|
||||
if (exposures == prgn) {
|
||||
exposures = &expRec;
|
||||
RegionInit(exposures, &box, 1);
|
||||
RegionReset(prgn, &box);
|
||||
}
|
||||
else {
|
||||
RegionReset(exposures, &box);
|
||||
RegionUnion(prgn, prgn, exposures);
|
||||
}
|
||||
box = *RegionExtents(prgn);
|
||||
exposures = &expRec;
|
||||
RegionInit(exposures, &box, 1);
|
||||
RegionReset(prgn, &box);
|
||||
/* miPaintWindow doesn't clip, so we have to */
|
||||
RegionIntersect(prgn, prgn, &pWin->clipList);
|
||||
}
|
||||
if (prgn && !RegionNil(prgn))
|
||||
miPaintWindow(pWin, prgn, PW_BACKGROUND);
|
||||
if (clientInterested && exposures && !RegionNil(exposures))
|
||||
miPaintWindow(pWin, prgn, PW_BACKGROUND);
|
||||
if (clientInterested)
|
||||
miSendExposures(pWin, exposures,
|
||||
pWin->drawable.x, pWin->drawable.y);
|
||||
if (exposures == &expRec) {
|
||||
if (exposures == &expRec)
|
||||
RegionUninit(exposures);
|
||||
}
|
||||
else if (exposures && exposures != prgn)
|
||||
RegionDestroy(exposures);
|
||||
if (prgn)
|
||||
RegionEmpty(prgn);
|
||||
RegionEmpty(prgn);
|
||||
}
|
||||
else if (exposures && exposures != prgn)
|
||||
RegionDestroy(exposures);
|
||||
}
|
||||
|
||||
#ifdef ROOTLESS
|
||||
|
|
Loading…
Reference in New Issue
Block a user