[PATCH 04/18] dix: Drop the third argument from WindowExposuresProcPtr

Adam Jackson ajax at redhat.com
Tue Sep 23 11:32:20 PDT 2014


A careful read shows that it was always NULL.  It hasn't always been; as
the DDX spec indicates, it was the "occluded region that has backing
store", but since that backing store code is long gone nothing, we can
nuke it.

mi{,Overlay}WindowExposures get slightly simpler here, and will get even
simpler in just a moment.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 dix/window.c               |  2 +-
 fb/fboverlay.c             |  5 ++---
 fb/fboverlay.h             |  4 +---
 hw/dmx/dmxwindow.c         |  4 ++--
 hw/dmx/dmxwindow.h         |  3 +--
 hw/kdrive/ephyr/ephyr.c    |  2 +-
 hw/kdrive/src/kxv.c        |  6 +++---
 hw/xfree86/common/xf86xv.c |  6 +++---
 hw/xfree86/dri/dri.c       |  4 ++--
 hw/xfree86/dri/dri.h       |  3 +--
 hw/xnest/Window.c          |  4 ++--
 hw/xnest/XNWindow.h        |  3 +--
 include/scrnintstr.h       |  3 +--
 mi/mi.h                    |  4 +---
 mi/miexpose.c              | 15 +++------------
 mi/mioverlay.c             | 30 ++++++++----------------------
 mi/miwindow.c              |  4 ++--
 17 files changed, 35 insertions(+), 67 deletions(-)

diff --git a/dix/window.c b/dix/window.c
index f4acdc8..52e69ef 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -2601,7 +2601,7 @@ MapWindow(WindowPtr pWin, ClientPtr client)
             (*pScreen->PostValidateTree) (NullWindow, pWin, VTMap);
         RegionNull(&temp);
         RegionCopy(&temp, &pWin->clipList);
-        (*pScreen->WindowExposures) (pWin, &temp, NullRegion);
+        (*pScreen->WindowExposures) (pWin, &temp);
         RegionUninit(&temp);
     }
 
diff --git a/fb/fboverlay.c b/fb/fboverlay.c
index 935bf1b..6a5f0f8 100644
--- a/fb/fboverlay.c
+++ b/fb/fboverlay.c
@@ -240,12 +240,11 @@ fbOverlayCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
 }
 
 void
-fbOverlayWindowExposures(WindowPtr pWin,
-                         RegionPtr prgn, RegionPtr other_exposed)
+fbOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn)
 {
     fbOverlayUpdateLayerRegion(pWin->drawable.pScreen,
                                fbOverlayWindowLayer(pWin), prgn);
-    miWindowExposures(pWin, prgn, other_exposed);
+    miWindowExposures(pWin, prgn);
 }
 
 Bool
diff --git a/fb/fboverlay.h b/fb/fboverlay.h
index 57c9873..47727e4 100644
--- a/fb/fboverlay.h
+++ b/fb/fboverlay.h
@@ -82,9 +82,7 @@ extern _X_EXPORT void
  fbOverlayCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
 
 extern _X_EXPORT void
-
-fbOverlayWindowExposures(WindowPtr pWin,
-                         RegionPtr prgn, RegionPtr other_exposed);
+fbOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn);
 
 extern _X_EXPORT Bool
 
diff --git a/hw/dmx/dmxwindow.c b/hw/dmx/dmxwindow.c
index 1c23527..c753735 100644
--- a/hw/dmx/dmxwindow.c
+++ b/hw/dmx/dmxwindow.c
@@ -772,7 +772,7 @@ dmxWindowExposurePredicate(Display * dpy, XEvent * ev, XPointer ptr)
  *  in DMX, the events that are generated by the back-end server are
  *  redundant, so we eat them here. */
 void
-dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn, RegionPtr other_exposed)
+dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn)
 {
     ScreenPtr pScreen = pWindow->drawable.pScreen;
     DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
@@ -799,7 +799,7 @@ dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn, RegionPtr other_exposed)
 
 #if 1
     if (pScreen->WindowExposures)
-        pScreen->WindowExposures(pWindow, prgn, other_exposed);
+        pScreen->WindowExposures(pWindow, prgn);
 #endif
     DMX_WRAP(WindowExposures, dmxWindowExposures, dmxScreen, pScreen);
 }
diff --git a/hw/dmx/dmxwindow.h b/hw/dmx/dmxwindow.h
index c6b2efe..dda6538 100644
--- a/hw/dmx/dmxwindow.h
+++ b/hw/dmx/dmxwindow.h
@@ -73,8 +73,7 @@ extern Bool dmxChangeWindowAttributes(WindowPtr pWindow, unsigned long mask);
 extern Bool dmxRealizeWindow(WindowPtr pWindow);
 extern Bool dmxUnrealizeWindow(WindowPtr pWindow);
 extern void dmxRestackWindow(WindowPtr pWindow, WindowPtr pOldNextSib);
-extern void dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn,
-                               RegionPtr other_exposed);
+extern void dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn);
 extern void dmxCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg,
                           RegionPtr prgnSrc);
 
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index 85d4193..8b88f3e 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -878,7 +878,7 @@ ephyrExposePairedWindow(int a_remote)
     screen = pair->local->drawable.pScreen;
     RegionNull(&reg);
     RegionCopy(&reg, &pair->local->clipList);
-    screen->WindowExposures(pair->local, &reg, NullRegion);
+    screen->WindowExposures(pair->local, &reg);
     RegionUninit(&reg);
 }
 #endif                          /* XF86DRI */
diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
index f979e1f..163d5c1 100644
--- a/hw/kdrive/src/kxv.c
+++ b/hw/kdrive/src/kxv.c
@@ -86,7 +86,7 @@ static int KdXVQueryImageAttributes(XvPortPtr, XvImagePtr,
 /* ScreenRec fields */
 
 static Bool KdXVDestroyWindow(WindowPtr pWin);
-static void KdXVWindowExposures(WindowPtr pWin, RegionPtr r1, RegionPtr r2);
+static void KdXVWindowExposures(WindowPtr pWin, RegionPtr r1);
 static void KdXVClipNotify(WindowPtr pWin, int dx, int dy);
 static Bool KdXVCloseScreen(ScreenPtr);
 
@@ -822,7 +822,7 @@ KdXVDestroyWindow(WindowPtr pWin)
 }
 
 static void
-KdXVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
+KdXVWindowExposures(WindowPtr pWin, RegionPtr reg1)
 {
     ScreenPtr pScreen = pWin->drawable.pScreen;
     KdXVScreenPtr ScreenPriv = GET_KDXV_SCREEN(pScreen);
@@ -834,7 +834,7 @@ KdXVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
     AreasExposed = (WinPriv && reg1 && RegionNotEmpty(reg1));
 
     pScreen->WindowExposures = ScreenPriv->WindowExposures;
-    (*pScreen->WindowExposures) (pWin, reg1, reg2);
+    (*pScreen->WindowExposures) (pWin, reg1);
     pScreen->WindowExposures = KdXVWindowExposures;
 
     /* filter out XClearWindow/Area */
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index d342bde..d8fd88d 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -84,7 +84,7 @@ static int xf86XVQueryImageAttributes(XvPortPtr, XvImagePtr,
 /* ScreenRec fields */
 
 static Bool xf86XVDestroyWindow(WindowPtr pWin);
-static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr r1, RegionPtr r2);
+static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr r1);
 static void xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin,
                                    VTKind kind);
 static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy);
@@ -1048,7 +1048,7 @@ xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind)
 }
 
 static void
-xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
+xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1)
 {
     ScreenPtr pScreen = pWin->drawable.pScreen;
     XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
@@ -1059,7 +1059,7 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
     AreasExposed = (WinPriv && reg1 && RegionNotEmpty(reg1));
 
     pScreen->WindowExposures = ScreenPriv->WindowExposures;
-    (*pScreen->WindowExposures) (pWin, reg1, reg2);
+    (*pScreen->WindowExposures) (pWin, reg1);
     pScreen->WindowExposures = xf86XVWindowExposures;
 
     /* filter out XClearWindow/Area */
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 3f2f6a9..5077c7c 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -1828,7 +1828,7 @@ DRIGetContextStore(DRIContextPrivPtr context)
 }
 
 void
-DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg)
+DRIWindowExposures(WindowPtr pWin, RegionPtr prgn)
 {
     ScreenPtr pScreen = pWin->drawable.pScreen;
     DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
@@ -1846,7 +1846,7 @@ DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg)
         pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures;
 
         /* call lower layers */
-        (*pScreen->WindowExposures) (pWin, prgn, bsreg);
+        (*pScreen->WindowExposures) (pWin, prgn);
 
         /* rewrap */
         pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
diff --git a/hw/xfree86/dri/dri.h b/hw/xfree86/dri/dri.h
index dec6885..1ce0970 100644
--- a/hw/xfree86/dri/dri.h
+++ b/hw/xfree86/dri/dri.h
@@ -280,8 +280,7 @@ extern _X_EXPORT void DRISwapContext(int drmFD, void *oldctx, void *newctx);
 
 extern _X_EXPORT void *DRIGetContextStore(DRIContextPrivPtr context);
 
-extern _X_EXPORT void DRIWindowExposures(WindowPtr pWin,
-                                         RegionPtr prgn, RegionPtr bsreg);
+extern _X_EXPORT void DRIWindowExposures(WindowPtr pWin, RegionPtr prgn);
 
 extern _X_EXPORT Bool DRIDestroyWindow(WindowPtr pWin);
 
diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c
index fc87e82..8d9c672 100644
--- a/hw/xnest/Window.c
+++ b/hw/xnest/Window.c
@@ -386,7 +386,7 @@ xnestWindowExposurePredicate(Display * dpy, XEvent * event, XPointer ptr)
 }
 
 void
-xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_exposed)
+xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn)
 {
     XEvent event;
     Window window;
@@ -410,7 +410,7 @@ xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_exposed)
             XPutBackEvent(xnestDisplay, &event);
     }
 
-    miWindowExposures(pWin, pRgn, other_exposed);
+    miWindowExposures(pWin, pRgn);
 }
 
 void
diff --git a/hw/xnest/XNWindow.h b/hw/xnest/XNWindow.h
index 02b0f3f..6320ede 100644
--- a/hw/xnest/XNWindow.h
+++ b/hw/xnest/XNWindow.h
@@ -66,8 +66,7 @@ Bool xnestRealizeWindow(WindowPtr pWin);
 Bool xnestUnrealizeWindow(WindowPtr pWin);
 void xnestCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion);
 void xnestClipNotify(WindowPtr pWin, int dx, int dy);
-void xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn,
-                          RegionPtr other_exposed);
+void xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn);
 void xnestSetShape(WindowPtr pWin, int kind);
 void xnestShapeWindow(WindowPtr pWin);
 
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 6955e77..7331ec1 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -155,8 +155,7 @@ typedef void (*PostValidateTreeProcPtr) (WindowPtr /*pParent */ ,
                                          VTKind /*kind */ );
 
 typedef void (*WindowExposuresProcPtr) (WindowPtr /*pWindow */ ,
-                                        RegionPtr /*prgn */ ,
-                                        RegionPtr /*other_exposed */ );
+                                        RegionPtr /*prgn */);
 
 typedef void (*CopyWindowProcPtr) (WindowPtr /*pWindow */ ,
                                    DDXPointRec /*ptOldOrg */ ,
diff --git a/mi/mi.h b/mi/mi.h
index d5a5ba3..4b5e862 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -247,9 +247,7 @@ extern _X_EXPORT void miSendExposures(WindowPtr /*pWin */ ,
     );
 
 extern _X_EXPORT void miWindowExposures(WindowPtr /*pWin */ ,
-                                        RegionPtr /*prgn */ ,
-                                        RegionPtr       /*other_exposed */
-    );
+                                        RegionPtr /*prgn */);
 
 extern _X_EXPORT void miPaintWindow(WindowPtr /*pWin */ ,
                                     RegionPtr /*prgn */ ,
diff --git a/mi/miexpose.c b/mi/miexpose.c
index 198c433..23987fa 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -421,12 +421,11 @@ miSendExposures(WindowPtr pWin, RegionPtr pRgn, int dx, int dy)
 }
 
 void
-miWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed)
+miWindowExposures(WindowPtr pWin, RegionPtr prgn)
 {
     RegionPtr exposures = prgn;
 
-    if ((prgn && !RegionNil(prgn)) ||
-        (exposures && !RegionNil(exposures)) || other_exposed) {
+    if ((prgn && !RegionNil(prgn)) || (exposures && !RegionNil(exposures))) {
         RegionRec expRec;
         int clientInterested;
 
@@ -435,14 +434,6 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed)
          */
         clientInterested =
             (pWin->eventMask | wOtherEventMasks(pWin)) & ExposureMask;
-        if (other_exposed) {
-            if (exposures) {
-                RegionUnion(other_exposed, exposures, other_exposed);
-                if (exposures != prgn)
-                    RegionDestroy(exposures);
-            }
-            exposures = other_exposed;
-        }
         if (clientInterested && exposures &&
             (RegionNumRects(exposures) > RECTLIMIT)) {
             /*
@@ -474,7 +465,7 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed)
         if (exposures == &expRec) {
             RegionUninit(exposures);
         }
-        else if (exposures && exposures != prgn && exposures != other_exposed)
+        else if (exposures && exposures != prgn)
             RegionDestroy(exposures);
         if (prgn)
             RegionEmpty(prgn);
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
index 7f502fa..f894e2b 100644
--- a/mi/mioverlay.c
+++ b/mi/mioverlay.c
@@ -79,7 +79,7 @@ static void miOverlayMarkUnrealizedWindow(WindowPtr, WindowPtr, Bool);
 static int miOverlayValidateTree(WindowPtr, WindowPtr, VTKind);
 static void miOverlayHandleExposures(WindowPtr);
 static void miOverlayMoveWindow(WindowPtr, int, int, WindowPtr, VTKind);
-static void miOverlayWindowExposures(WindowPtr, RegionPtr, RegionPtr);
+static void miOverlayWindowExposures(WindowPtr, RegionPtr);
 static void miOverlayResizeWindow(WindowPtr, int, int, unsigned int,
                                   unsigned int, WindowPtr);
 static void miOverlayClearToBackground(WindowPtr, int, int, int, int, Bool);
@@ -827,7 +827,7 @@ miOverlayHandleExposures(WindowPtr pWin)
     miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
     WindowPtr pChild;
     ValidatePtr val;
-    void (*WindowExposures) (WindowPtr, RegionPtr, RegionPtr);
+    WindowExposuresProcPtr WindowExposures;
 
     WindowExposures = pWin->drawable.pScreen->WindowExposures;
     if (pPriv->underlayMarked) {
@@ -849,8 +849,7 @@ miOverlayHandleExposures(WindowPtr pWin)
                     }
                     RegionUninit(&mival->borderExposed);
 
-                    (*WindowExposures) (pTree->pWin, &mival->exposed,
-                                        NullRegion);
+                    (*WindowExposures) (pTree->pWin, &mival->exposed);
                     RegionUninit(&mival->exposed);
                 }
                 free(mival);
@@ -886,7 +885,7 @@ miOverlayHandleExposures(WindowPtr pWin)
                 if (RegionNotEmpty(&val->after.borderExposed)) {
                     miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER);
                 }
-                (*WindowExposures) (pChild, &val->after.exposed, NullRegion);
+                (*WindowExposures) (pChild, &val->after.exposed);
             }
             RegionUninit(&val->after.borderExposed);
             RegionUninit(&val->after.exposed);
@@ -980,26 +979,16 @@ miOverlayMoveWindow(WindowPtr pWin,
 #endif
 
 static void
-miOverlayWindowExposures(WindowPtr pWin,
-                         RegionPtr prgn, RegionPtr other_exposed)
+miOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn)
 {
     RegionPtr exposures = prgn;
 
-    if ((prgn && !RegionNil(prgn)) ||
-        (exposures && !RegionNil(exposures)) || other_exposed) {
+    if ((prgn && !RegionNil(prgn)) || (exposures && !RegionNil(exposures))) {
         RegionRec expRec;
         int clientInterested;
 
         clientInterested = (pWin->eventMask | wOtherEventMasks(pWin)) &
             ExposureMask;
-        if (other_exposed) {
-            if (exposures) {
-                RegionUnion(other_exposed, exposures, other_exposed);
-                if (exposures != prgn)
-                    RegionDestroy(exposures);
-            }
-            exposures = other_exposed;
-        }
         if (clientInterested && exposures &&
             (RegionNumRects(exposures) > RECTLIMIT)) {
             ScreenPtr pScreen = pWin->drawable.pScreen;
@@ -1035,7 +1024,7 @@ miOverlayWindowExposures(WindowPtr pWin,
         if (exposures == &expRec) {
             RegionUninit(exposures);
         }
-        else if (exposures && exposures != prgn && exposures != other_exposed)
+        else if (exposures && exposures != prgn)
             RegionDestroy(exposures);
         if (prgn)
             RegionEmpty(prgn);
@@ -1592,7 +1581,6 @@ miOverlayClearToBackground(WindowPtr pWin,
     miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
     BoxRec box;
     RegionRec reg;
-    RegionPtr pBSReg = NullRegion;
     ScreenPtr pScreen = pWin->drawable.pScreen;
     miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
     RegionPtr clipList;
@@ -1636,12 +1624,10 @@ miOverlayClearToBackground(WindowPtr pWin,
 
     RegionIntersect(&reg, &reg, clipList);
     if (generateExposures)
-        (*pScreen->WindowExposures) (pWin, &reg, pBSReg);
+        (*pScreen->WindowExposures) (pWin, &reg);
     else if (pWin->backgroundState != None)
         miPaintWindow(pWin, &reg, PW_BACKGROUND);
     RegionUninit(&reg);
-    if (pBSReg)
-        RegionDestroy(pBSReg);
 }
 
 /****************************************************************/
diff --git a/mi/miwindow.c b/mi/miwindow.c
index 82c3513..ba4c9ed 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -111,7 +111,7 @@ miClearToBackground(WindowPtr pWin,
 
     RegionIntersect(&reg, &reg, &pWin->clipList);
     if (generateExposures)
-        (*pWin->drawable.pScreen->WindowExposures) (pWin, &reg, NULL);
+        (*pWin->drawable.pScreen->WindowExposures) (pWin, &reg);
     else if (pWin->backgroundState != None)
         miPaintWindow(pWin, &reg, PW_BACKGROUND);
     RegionUninit(&reg);
@@ -221,7 +221,7 @@ miHandleValidateExposures(WindowPtr pWin)
             if (RegionNotEmpty(&val->after.borderExposed))
                 miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER);
             RegionUninit(&val->after.borderExposed);
-            (*WindowExposures) (pChild, &val->after.exposed, NullRegion);
+            (*WindowExposures) (pChild, &val->after.exposed);
             RegionUninit(&val->after.exposed);
             free(val);
             pChild->valdata = NULL;
-- 
1.9.3



More information about the xorg-devel mailing list