From 3904216b01fd9dabee65e6cb120fa8aad5e8b459 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 6 Mar 2019 17:03:58 -0500 Subject: [PATCH 1/2] dix: Outdent Unmap{Window,Subwindows} a bit No functional change, just folding some conditionals together. --- dix/window.c | 49 ++++++++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/dix/window.c b/dix/window.c index f4ace76c7..ec94a8843 100644 --- a/dix/window.c +++ b/dix/window.c @@ -2856,13 +2856,11 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure) pWin->mapped = FALSE; if (wasRealized) UnrealizeTree(pWin, fromConfigure); - if (wasViewable) { - if (!fromConfigure) { - (*pScreen->ValidateTree) (pLayerWin->parent, pWin, VTUnmap); - (*pScreen->HandleExposures) (pLayerWin->parent); - if (pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pWin, VTUnmap); - } + if (wasViewable && !fromConfigure) { + (*pScreen->ValidateTree) (pLayerWin->parent, pWin, VTUnmap); + (*pScreen->HandleExposures) (pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pWin, VTUnmap); } if (wasRealized && !fromConfigure) { WindowsRestructured(); @@ -2909,31 +2907,28 @@ UnmapSubwindows(WindowPtr pWin) UnrealizeTree(pChild, FALSE); } } - if (wasViewable) { - if (anyMarked) { - if (pLayerWin->parent == pWin) - (*pScreen->MarkWindow) (pWin); - else { - WindowPtr ptmp; + if (wasViewable && anyMarked) { + if (pLayerWin->parent == pWin) + (*pScreen->MarkWindow) (pWin); + else { + WindowPtr ptmp; - (*pScreen->MarkOverlappedWindows) (pWin, pLayerWin, NULL); - (*pScreen->MarkWindow) (pLayerWin->parent); + (*pScreen->MarkOverlappedWindows) (pWin, pLayerWin, NULL); + (*pScreen->MarkWindow) (pLayerWin->parent); - /* Windows between pWin and pLayerWin may not have been marked */ - ptmp = pWin; + /* Windows between pWin and pLayerWin may not have been marked */ + ptmp = pWin; - while (ptmp != pLayerWin->parent) { - (*pScreen->MarkWindow) (ptmp); - ptmp = ptmp->parent; - } - pHead = pWin->firstChild; + while (ptmp != pLayerWin->parent) { + (*pScreen->MarkWindow) (ptmp); + ptmp = ptmp->parent; } - (*pScreen->ValidateTree) (pLayerWin->parent, pHead, VTUnmap); - (*pScreen->HandleExposures) (pLayerWin->parent); - if (pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pHead, - VTUnmap); + pHead = pWin->firstChild; } + (*pScreen->ValidateTree) (pLayerWin->parent, pHead, VTUnmap); + (*pScreen->HandleExposures) (pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pHead, VTUnmap); } if (wasRealized) { WindowsRestructured(); -- GitLab From f665a9c9e6c8643f3050378249db3088ae3057be Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 30 Sep 2014 12:26:28 -0400 Subject: [PATCH 2/2] mi: Shortcut miDoCopy/miCopyArea based on clipList This is maybe one more comparison, but it catches FullyObscured windows slightly earlier, so it's kind of a wash. The important thing is this allows for paintable but unmapped windows, which will have non-empty clipList. --- mi/mibitblt.c | 4 ++-- mi/micopy.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/mi/mibitblt.c b/mi/mibitblt.c index 43d9bd917..4f7e29170 100644 --- a/mi/mibitblt.c +++ b/mi/mibitblt.c @@ -92,9 +92,9 @@ miCopyArea(DrawablePtr pSrcDrawable, srcx = xIn + pSrcDrawable->x; srcy = yIn + pSrcDrawable->y; - /* If the destination isn't realized, this is easy */ + /* If the destination is clipped away, this is easy */ if (pDstDrawable->type == DRAWABLE_WINDOW && - !((WindowPtr) pDstDrawable)->realized) + RegionNil(&((WindowPtr)pDstDrawable)->clipList)) return NULL; /* clip the source */ diff --git a/mi/micopy.c b/mi/micopy.c index 12cdad4ad..4db128c4f 100644 --- a/mi/micopy.c +++ b/mi/micopy.c @@ -152,10 +152,9 @@ miDoCopy(DrawablePtr pSrcDrawable, Bool fastDst = FALSE; /* for fast clipping with one rect dest */ Bool fastExpose = FALSE; /* for fast exposures with pixmap source */ - /* Short cut for unmapped windows */ - + /* Short cut for unmapped or fully clipped windows */ if (pDstDrawable->type == DRAWABLE_WINDOW && - !((WindowPtr) pDstDrawable)->realized) { + RegionNil(&((WindowPtr)pDstDrawable)->clipList)) { return NULL; } -- GitLab