[PATCH 03/37] rootless: remove redundant RootlessShapedWindowIn

Adam Jackson ajax at redhat.com
Wed Oct 8 08:04:27 PDT 2014


miShapedWindowIn is identical.  Which you would expect, since neither
one takes an actual WindowPtr argument, so they couldn't possibly make
reference to rootlessness.

Reviewed-by: Julien Cristau <jcristau at debian.org>
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 miext/rootless/rootlessValTree.c | 65 ++--------------------------------------
 1 file changed, 3 insertions(+), 62 deletions(-)

diff --git a/miext/rootless/rootlessValTree.c b/miext/rootless/rootlessValTree.c
index 730d291..c7c2c99 100644
--- a/miext/rootless/rootlessValTree.c
+++ b/miext/rootless/rootlessValTree.c
@@ -106,64 +106,6 @@ Equipment Corporation.
 
 int RootlessMiValidateTree(WindowPtr pRoot, WindowPtr pChild, VTKind kind);
 
-/*
- * Compute the visibility of a shaped window
- */
-static int
-RootlessShapedWindowIn(RegionPtr universe,
-                       RegionPtr bounding, BoxPtr rect, int x, int y)
-{
-    BoxRec box;
-    register BoxPtr boundBox;
-    int nbox;
-    Bool someIn, someOut;
-    register int t, x1, y1, x2, y2;
-
-    nbox = RegionNumRects(bounding);
-    boundBox = RegionRects(bounding);
-    someIn = someOut = FALSE;
-    x1 = rect->x1;
-    y1 = rect->y1;
-    x2 = rect->x2;
-    y2 = rect->y2;
-    while (nbox--) {
-        if ((t = boundBox->x1 + x) < x1)
-            t = x1;
-        box.x1 = t;
-        if ((t = boundBox->y1 + y) < y1)
-            t = y1;
-        box.y1 = t;
-        if ((t = boundBox->x2 + x) > x2)
-            t = x2;
-        box.x2 = t;
-        if ((t = boundBox->y2 + y) > y2)
-            t = y2;
-        box.y2 = t;
-        if (box.x1 > box.x2)
-            box.x2 = box.x1;
-        if (box.y1 > box.y2)
-            box.y2 = box.y1;
-        switch (RegionContainsRect(universe, &box)) {
-        case rgnIN:
-            if (someOut)
-                return rgnPART;
-            someIn = TRUE;
-            break;
-        case rgnOUT:
-            if (someIn)
-                return rgnPART;
-            someOut = TRUE;
-            break;
-        default:
-            return rgnPART;
-        }
-        boundBox++;
-    }
-    if (someIn)
-        return rgnIN;
-    return rgnOUT;
-}
-
 #define HasParentRelativeBorder(w) (!(w)->borderIsPixel && \
 				    HasBorder(w) && \
 				    (w)->backgroundState == ParentRelative)
@@ -229,10 +171,9 @@ RootlessComputeClips(WindowPtr pParent, ScreenPtr pScreen,
             RegionPtr pBounding;
 
             if ((pBounding = wBoundingShape(pParent))) {
-                switch (RootlessShapedWindowIn(universe,
-                                               pBounding, &borderSize,
-                                               pParent->drawable.x,
-                                               pParent->drawable.y)) {
+                switch (miShapedWindowIn(universe, pBounding, &borderSize,
+                                         pParent->drawable.x,
+                                         pParent->drawable.y)) {
                 case rgnIN:
                     newVis = VisibilityUnobscured;
                     break;
-- 
1.9.3



More information about the xorg-devel mailing list