From 4e101e7e3b4d3e6cdb38f1cd60a764aaade5c4a2 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 14 Mar 2019 16:19:02 -0400 Subject: [PATCH] mi: Simplify a conditional in miHandleExposures miHandleExposures does two things: computes the region for which to generate expose events, and (if the destination is a window) paints the exposed regions with the background. The bit of this conditional we're deleting here asserts that the source is either a pixmap or a window without backing store. The only other possibility is a window _with_ backing store. In the old backing store implementation, this was where you would recover bits from backing store. Since our "backing store" is the redirected window pixmap, we know we've already copied all we could, because CopyArea had already seen the entire window pixmap. So now in that third case, we are still drawing to a pixmap (so there's no background to paint) and we are still not generating events, so we can exit early. The comment above the function about recovering bits from backing store is clearly misleading, so delete that too. --- mi/miexpose.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/mi/miexpose.c b/mi/miexpose.c index c34530c34..d84bb6a98 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -112,10 +112,6 @@ the region package can call this. non-existent areas to non-obscured areas of the destination. Paint the background for the region, if the destination is a window. -NOTE: - this should generally be called, even if graphicsExposures is false, -because this is where bits get recovered from backing store. - */ RegionPtr @@ -140,10 +136,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, Bool extents; /* avoid work if we can */ - if (!pGC->graphicsExposures && - (pDstDrawable->type == DRAWABLE_PIXMAP) && - ((pSrcDrawable->type == DRAWABLE_PIXMAP) || - (((WindowPtr) pSrcDrawable)->backStorage == 0))) + if (!pGC->graphicsExposures && pDstDrawable->type == DRAWABLE_PIXMAP) return NULL; srcBox.x1 = srcx;