[PATCH 09/37] mi: Move pScreen->SendGraphicsExpose up to dix

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


No DDX is overriding this and it's fairly absurd to expose it as a
screen operation anyway.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 Xext/panoramiXprocs.c | 10 ++++------
 dix/dispatch.c        | 52 +++++++++++++++++++++++++++++++++++++++++++++++----
 include/dix.h         |  6 ++++++
 include/scrnintstr.h  |  7 -------
 mi/mi.h               |  7 -------
 mi/miexpose.c         | 47 ----------------------------------------------
 mi/miscrinit.c        |  1 -
 7 files changed, 58 insertions(+), 72 deletions(-)

diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 83a2e08..aa3859f 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -1193,9 +1193,8 @@ PanoramiXCopyArea(ClientPtr client)
             Bool overlap;
 
             RegionValidate(&totalReg, &overlap);
-            (*pDst->pScreen->SendGraphicsExpose) (client, &totalReg,
-                                                  stuff->dstDrawable,
-                                                  X_CopyArea, 0);
+            SendGraphicsExpose(client, &totalReg, stuff->dstDrawable,
+                               X_CopyArea, 0);
             RegionUninit(&totalReg);
         }
     }
@@ -1306,9 +1305,8 @@ PanoramiXCopyPlane(ClientPtr client)
         Bool overlap;
 
         RegionValidate(&totalReg, &overlap);
-        (*pdstDraw->pScreen->SendGraphicsExpose) (client, &totalReg,
-                                                  stuff->dstDrawable,
-                                                  X_CopyPlane, 0);
+        SendGraphicsExpose(client, &totalReg, stuff->dstDrawable,
+                           X_CopyPlane, 0);
         RegionUninit(&totalReg);
     }
 
diff --git a/dix/dispatch.c b/dix/dispatch.c
index f7a08f8..74abecd 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -1597,6 +1597,52 @@ ProcClearToBackground(ClientPtr client)
     return Success;
 }
 
+/* send GraphicsExpose events, or a NoExpose event, based on the region */
+void
+SendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable,
+                     int major, int minor)
+{
+    if (pRgn && !RegionNil(pRgn)) {
+        xEvent *pEvent;
+        xEvent *pe;
+        BoxPtr pBox;
+        int i;
+        int numRects;
+
+        numRects = RegionNumRects(pRgn);
+        pBox = RegionRects(pRgn);
+        if (!(pEvent = calloc(numRects, sizeof(xEvent))))
+            return;
+        pe = pEvent;
+
+        for (i = 1; i <= numRects; i++, pe++, pBox++) {
+            pe->u.u.type = GraphicsExpose;
+            pe->u.graphicsExposure.drawable = drawable;
+            pe->u.graphicsExposure.x = pBox->x1;
+            pe->u.graphicsExposure.y = pBox->y1;
+            pe->u.graphicsExposure.width = pBox->x2 - pBox->x1;
+            pe->u.graphicsExposure.height = pBox->y2 - pBox->y1;
+            pe->u.graphicsExposure.count = numRects - i;
+            pe->u.graphicsExposure.majorEvent = major;
+            pe->u.graphicsExposure.minorEvent = minor;
+        }
+        /* GraphicsExpose is a "critical event", which TryClientEvents
+         * handles specially. */
+        TryClientEvents(client, NULL, pEvent, numRects,
+                        (Mask) 0, NoEventMask, NullGrab);
+        free(pEvent);
+    }
+    else {
+        xEvent event = {
+            .u.noExposure.drawable = drawable,
+            .u.noExposure.majorEvent = major,
+            .u.noExposure.minorEvent = minor
+        };
+        event.u.u.type = NoExpose;
+        WriteEventsToClient(client, 1, &event);
+    }
+}
+
 int
 ProcCopyArea(ClientPtr client)
 {
@@ -1628,8 +1674,7 @@ ProcCopyArea(ClientPtr client)
                                   stuff->width, stuff->height,
                                   stuff->dstX, stuff->dstY);
     if (pGC->graphicsExposures) {
-        (*pDst->pScreen->SendGraphicsExpose)
-            (client, pRgn, stuff->dstDrawable, X_CopyArea, 0);
+        SendGraphicsExpose(client, pRgn, stuff->dstDrawable, X_CopyArea, 0);
         if (pRgn)
             RegionDestroy(pRgn);
     }
@@ -1676,8 +1721,7 @@ ProcCopyPlane(ClientPtr client)
                                 stuff->srcY, stuff->width, stuff->height,
                                 stuff->dstX, stuff->dstY, stuff->bitPlane);
     if (pGC->graphicsExposures) {
-        (*pdstDraw->pScreen->SendGraphicsExpose)
-            (client, pRgn, stuff->dstDrawable, X_CopyPlane, 0);
+        SendGraphicsExpose(client, pRgn, stuff->dstDrawable, X_CopyPlane, 0);
         if (pRgn)
             RegionDestroy(pRgn);
     }
diff --git a/include/dix.h b/include/dix.h
index 61ecc8d..116da2e 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -254,6 +254,12 @@ extern _X_EXPORT void ClientWakeup(ClientPtr /*client */ );
 
 extern _X_EXPORT Bool ClientIsAsleep(ClientPtr /*client */ );
 
+extern _X_EXPORT void SendGraphicsExpose(ClientPtr /*client */ ,
+                                         RegionPtr /*pRgn */ ,
+                                         XID /*drawable */ ,
+                                         int /*major */ ,
+                                         int  /*minor */);
+
 /* atom.c */
 
 extern _X_EXPORT Atom MakeAtom(const char * /*string */ ,
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 7331ec1..269ff5a 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -252,12 +252,6 @@ typedef void (*ResolveColorProcPtr) (unsigned short * /*pred */ ,
 
 typedef RegionPtr (*BitmapToRegionProcPtr) (PixmapPtr /*pPix */ );
 
-typedef void (*SendGraphicsExposeProcPtr) (ClientPtr /*client */ ,
-                                           RegionPtr /*pRgn */ ,
-                                           XID /*drawable */ ,
-                                           int /*major */ ,
-                                           int /*minor */ );
-
 typedef void (*ScreenBlockHandlerProcPtr) (ScreenPtr pScreen,
                                            void *pTimeout,
                                            void *pReadmask);
@@ -540,7 +534,6 @@ typedef struct _Screen {
     /* Region procedures */
 
     BitmapToRegionProcPtr BitmapToRegion;
-    SendGraphicsExposeProcPtr SendGraphicsExpose;
 
     /* os layer procedures */
 
diff --git a/mi/mi.h b/mi/mi.h
index 700bb11..8cb3ce7 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -232,13 +232,6 @@ extern _X_EXPORT RegionPtr miHandleExposures(DrawablePtr /*pSrcDrawable */ ,
                                              int /*dsty */
     );
 
-extern _X_EXPORT void miSendGraphicsExpose(ClientPtr /*client */ ,
-                                           RegionPtr /*pRgn */ ,
-                                           XID /*drawable */ ,
-                                           int /*major */ ,
-                                           int  /*minor */
-    );
-
 extern _X_EXPORT void miSendExposures(WindowPtr /*pWin */ ,
                                       RegionPtr /*pRgn */ ,
                                       int /*dx */ ,
diff --git a/mi/miexpose.c b/mi/miexpose.c
index 7a1c172..555f3b2 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -306,53 +306,6 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
     }
 }
 
-/* send GraphicsExpose events, or a NoExpose event, based on the region */
-
-void
-miSendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable,
-                     int major, int minor)
-{
-    if (pRgn && !RegionNil(pRgn)) {
-        xEvent *pEvent;
-        xEvent *pe;
-        BoxPtr pBox;
-        int i;
-        int numRects;
-
-        numRects = RegionNumRects(pRgn);
-        pBox = RegionRects(pRgn);
-        if (!(pEvent = calloc(numRects, sizeof(xEvent))))
-            return;
-        pe = pEvent;
-
-        for (i = 1; i <= numRects; i++, pe++, pBox++) {
-            pe->u.u.type = GraphicsExpose;
-            pe->u.graphicsExposure.drawable = drawable;
-            pe->u.graphicsExposure.x = pBox->x1;
-            pe->u.graphicsExposure.y = pBox->y1;
-            pe->u.graphicsExposure.width = pBox->x2 - pBox->x1;
-            pe->u.graphicsExposure.height = pBox->y2 - pBox->y1;
-            pe->u.graphicsExposure.count = numRects - i;
-            pe->u.graphicsExposure.majorEvent = major;
-            pe->u.graphicsExposure.minorEvent = minor;
-        }
-        /* GraphicsExpose is a "critical event", which TryClientEvents
-         * handles specially. */
-        TryClientEvents(client, NULL, pEvent, numRects,
-                        (Mask) 0, NoEventMask, NullGrab);
-        free(pEvent);
-    }
-    else {
-        xEvent event = {
-            .u.noExposure.drawable = drawable,
-            .u.noExposure.majorEvent = major,
-            .u.noExposure.minorEvent = minor
-        };
-        event.u.u.type = NoExpose;
-        WriteEventsToClient(client, 1, &event);
-    }
-}
-
 void
 miSendExposures(WindowPtr pWin, RegionPtr pRgn, int dx, int dy)
 {
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index 00c15f7..ec4d108 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -259,7 +259,6 @@ miScreenInit(ScreenPtr pScreen, void *pbits,  /* pointer to screen bits */
     /* CreateColormap, DestroyColormap, InstallColormap, UninstallColormap */
     /* ListInstalledColormaps, StoreColors, ResolveColor */
     /* BitmapToRegion */
-    pScreen->SendGraphicsExpose = miSendGraphicsExpose;
     pScreen->BlockHandler = (ScreenBlockHandlerProcPtr) NoopDDA;
     pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr) NoopDDA;
     pScreen->MarkWindow = miMarkWindow;
-- 
1.9.3



More information about the xorg-devel mailing list