From 0d30d44a8cdacfbc99d8193f76c133b803464622 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 11 Sep 2014 12:44:54 -0400 Subject: dix: Drop the third argument from WindowExposuresProcPtr 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, we can nuke it. mi{,Overlay}WindowExposures get slightly simpler here, and will get even simpler in just a moment. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson --- include/scrnintstr.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/scrnintstr.h b/include/scrnintstr.h index 6955e77fd..7331ec1b6 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 */ , -- cgit v1.2.3 From 1e56b2dfc6377234ffdcdf206528d476b04d13af Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 12 Sep 2014 12:51:13 -0400 Subject: mi: Move pScreen->SendGraphicsExpose up to dix No DDX is overriding this and it's fairly absurd to expose it as a screen operation anyway. Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson --- 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(-) (limited to 'include') diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index 83a2e0856..aa3859fdb 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 f7a08f82e..74abecd67 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 61ecc8df2..116da2e2c 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 7331ec1b6..269ff5a0c 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 700bb116e..8cb3ce7a5 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 7a1c17225..555f3b20a 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 00c15f713..ec4d10819 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; -- cgit v1.2.3 From 322ba42c23a3a107f7a62fb1c449792b616e5eba Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 15 Sep 2014 12:05:26 -0400 Subject: dix: Remove DIXsaveUnder bit from the Window Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson --- dix/window.c | 1 - include/windowstr.h | 1 - 2 files changed, 2 deletions(-) (limited to 'include') diff --git a/dix/window.c b/dix/window.c index 52e69efa5..f227e4ce4 100644 --- a/dix/window.c +++ b/dix/window.c @@ -362,7 +362,6 @@ SetWindowToDefaults(WindowPtr pWin) pWin->cursorIsNone = TRUE; pWin->backingStore = NotUseful; - pWin->DIXsaveUnder = FALSE; pWin->backStorage = (void *) NULL; pWin->mapped = FALSE; /* off */ diff --git a/include/windowstr.h b/include/windowstr.h index 6b79bbd2e..81f5f8c3c 100644 --- a/include/windowstr.h +++ b/include/windowstr.h @@ -151,7 +151,6 @@ typedef struct _Window { unsigned cursorIsNone:1; /* else real cursor (might inherit) */ unsigned backingStore:2; unsigned saveUnder:1; - unsigned DIXsaveUnder:1; unsigned bitGravity:4; unsigned winGravity:4; unsigned overrideRedirect:1; -- cgit v1.2.3 From 81d76a835b2f647e3051b1d93606e59db7998d76 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 15 Sep 2014 12:10:55 -0400 Subject: dix: Lower backStorage to a bit instead of a pointer Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson --- composite/compinit.c | 4 ++-- dix/window.c | 2 +- include/windowstr.h | 2 +- mi/miexpose.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/composite/compinit.c b/composite/compinit.c index 48e938fac..111c16e5d 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -119,12 +119,12 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask) pScreen->backingStoreSupport != NotUseful) { if (pWin->backingStore != NotUseful && !pWin->backStorage) { compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic); - pWin->backStorage = (void *) (intptr_t) 1; + pWin->backStorage = TRUE; } else if (pWin->backingStore == NotUseful && pWin->backStorage) { compUnredirectWindow(serverClient, pWin, CompositeRedirectAutomatic); - pWin->backStorage = NULL; + pWin->backStorage = FALSE; } } diff --git a/dix/window.c b/dix/window.c index f227e4ce4..e1645c3e7 100644 --- a/dix/window.c +++ b/dix/window.c @@ -362,7 +362,7 @@ SetWindowToDefaults(WindowPtr pWin) pWin->cursorIsNone = TRUE; pWin->backingStore = NotUseful; - pWin->backStorage = (void *) NULL; + pWin->backStorage = 0; pWin->mapped = FALSE; /* off */ pWin->realized = FALSE; /* off */ diff --git a/include/windowstr.h b/include/windowstr.h index 81f5f8c3c..740f4a6c0 100644 --- a/include/windowstr.h +++ b/include/windowstr.h @@ -144,12 +144,12 @@ typedef struct _Window { Mask eventMask; /* mask from the creating client */ PixUnion background; PixUnion border; - void *backStorage; /* null when BS disabled */ WindowOptPtr optional; unsigned backgroundState:2; /* None, Relative, Pixel, Pixmap */ unsigned borderIsPixel:1; unsigned cursorIsNone:1; /* else real cursor (might inherit) */ unsigned backingStore:2; + unsigned backStorage:1; /* if bs is allocated */ unsigned saveUnder:1; unsigned bitGravity:4; unsigned winGravity:4; diff --git a/mi/miexpose.c b/mi/miexpose.c index 555f3b20a..de8ee6c2a 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -143,7 +143,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, if (!pGC->graphicsExposures && (pDstDrawable->type == DRAWABLE_PIXMAP) && ((pSrcDrawable->type == DRAWABLE_PIXMAP) || - (((WindowPtr) pSrcDrawable)->backStorage == NULL))) + (((WindowPtr) pSrcDrawable)->backStorage == 0))) return NULL; srcBox.x1 = srcx; -- cgit v1.2.3