diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-11-02 11:18:39 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-11-02 11:18:39 +0100 |
commit | d6872d4e01df9a7e329524ea311512a9cf34da3b (patch) | |
tree | ae285606cc0dd1ad0137f636c8649fa4845fa226 /nx-X11/programs/Xserver | |
parent | 7afe95535b10739d806e5d7c15a8a1e86093bf84 (diff) | |
parent | 6fd0ffc99890c413d003bef323024f0cee62916f (diff) | |
download | nx-libs-d6872d4e01df9a7e329524ea311512a9cf34da3b.tar.gz nx-libs-d6872d4e01df9a7e329524ea311512a9cf34da3b.tar.bz2 nx-libs-d6872d4e01df9a7e329524ea311512a9cf34da3b.zip |
Merge branch 'uli42-pr/simplify_nxshm' into 3.6.x
Attributes GH PR #859: https://github.com/ArcticaProject/nx-libs/pull/859
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r-- | nx-X11/programs/Xserver/Xext/shm.c | 18 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 162 |
2 files changed, 35 insertions, 145 deletions
diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index 8e99b1047..868087462 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -490,9 +490,12 @@ ProcShmDetach(client) return(client->noClientException); } -#ifndef NXAGENT_SERVER static void +#ifdef NXAGENT_SERVER +xorg_miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) +#else miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) +#endif DrawablePtr dst; GCPtr pGC; int depth, w, h, sx, sy, sw, sh, dx, dy; @@ -525,6 +528,7 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) (*pmap->drawable.pScreen->DestroyPixmap)(pmap); } +#ifndef NXAGENT_SERVER static void fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) DrawablePtr dst; @@ -1138,9 +1142,12 @@ CreatePmap: return (BadAlloc); } -#ifndef NXAGENT_SERVER static int +#ifdef NXAGENT_SERVER +xorg_ProcShmDispatch (client) +#else ProcShmDispatch (client) +#endif register ClientPtr client; { REQUEST(xReq); @@ -1174,7 +1181,6 @@ ProcShmDispatch (client) return BadRequest; } } -#endif /* NXAGENT_SERVER */ static void SShmCompletionEvent(from, to) @@ -1278,9 +1284,12 @@ SProcShmCreatePixmap(client) return ProcShmCreatePixmap(client); } -#ifndef NXAGENT_SERVER static int +#ifdef NXAGENT_SERVER +xorg_SProcShmDispatch (client) +#else SProcShmDispatch (client) +#endif register ClientPtr client; { REQUEST(xReq); @@ -1302,4 +1311,3 @@ SProcShmDispatch (client) return BadRequest; } } -#endif /* NXAGENT_SERVER */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c index e1b55f561..83deb74c4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c @@ -164,42 +164,6 @@ ShmExtensionInit(void) } static void -nxagent_miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) - DrawablePtr dst; - GCPtr pGC; - int depth, w, h, sx, sy, sw, sh, dx, dy; - unsigned int format; - char *data; -{ - PixmapPtr pmap; - GCPtr putGC; - - putGC = GetScratchGC(depth, dst->pScreen); - if (!putGC) - { - return; - } - pmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth, - CREATE_PIXMAP_USAGE_SCRATCH); - if (!pmap) - { - FreeScratchGC(putGC); - return; - } - ValidateGC((DrawablePtr)pmap, putGC); - (*putGC->ops->PutImage)((DrawablePtr)pmap, putGC, depth, -sx, -sy, w, h, 0, - (format == XYPixmap) ? XYPixmap : ZPixmap, data); - FreeScratchGC(putGC); - if (format == XYBitmap) - (void)(*pGC->ops->CopyPlane)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh, - dx, dy, 1L); - else - (void)(*pGC->ops->CopyArea)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh, - dx, dy); - (*pmap->drawable.pScreen->DestroyPixmap)(pmap); -} - -static void miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) DrawablePtr dst; GCPtr pGC; @@ -211,7 +175,7 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) nxagentShmTrap = 0; - nxagent_miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data); + xorg_miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data); nxagentShmTrap = 1; @@ -486,77 +450,26 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr) return result; } - +/* A wrapper that handles the trap. This construct is used + to keep the derived code closer to the original +*/ static int -nxagent_ProcShmDispatch (client) - register ClientPtr client; +ProcShmDispatch (register ClientPtr client) { - REQUEST(xReq); + int result; -#ifdef NXAGENT_SERVER #ifdef TEST - fprintf(stderr, "ProcShmDispatch: Going to execute operation [%d] for client [%d].\n", - stuff -> data, client -> index); - + REQUEST(xReq); if (stuff->data <= X_ShmCreatePixmap) { - fprintf(stderr, "ProcShmDispatch: Request [%s] OPCODE#%d.\n", - nxagentShmRequestLiteral[stuff->data], stuff->data); + fprintf(stderr, "ProcShmDispatch: Request [%s] OPCODE [%d] for client [%d].\n", + nxagentShmRequestLiteral[stuff->data], stuff->data, client->index); } #endif -#endif - - switch (stuff->data) - { - case X_ShmQueryVersion: - return ProcShmQueryVersion(client); - case X_ShmAttach: - return ProcShmAttach(client); - case X_ShmDetach: - return ProcShmDetach(client); - case X_ShmPutImage: - { -#ifdef NXAGENT_SERVER - #ifdef TEST - fprintf(stderr, "ProcShmDispatch: Going to execute ProcShmPutImage() for client [%d].\n", - client -> index); - #endif -#endif - -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - return ProcPanoramiXShmPutImage(client); -#endif - return ProcShmPutImage(client); - } - case X_ShmGetImage: -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - return ProcPanoramiXShmGetImage(client); -#endif - return ProcShmGetImage(client); - case X_ShmCreatePixmap: -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - return ProcPanoramiXShmCreatePixmap(client); -#endif - return ProcShmCreatePixmap(client); - default: - return BadRequest; - } -} - -/* A wrapper that handles the trap. This construct is used - to keep the derived code closer to the original -*/ -static int -ProcShmDispatch (register ClientPtr client) -{ - int result; nxagentShmTrap = 1; - result = nxagent_ProcShmDispatch(client); + result = xorg_ProcShmDispatch(client); nxagentShmTrap = 0; @@ -564,55 +477,24 @@ ProcShmDispatch (register ClientPtr client) } static int -SProcShmDispatch (client) - register ClientPtr client; +SProcShmDispatch (register ClientPtr client) { - REQUEST(xReq); + int result; #ifdef TEST - fprintf(stderr, "SProcShmDispatch: Going to execute operation [%d] for client [%d].\n", - stuff -> data, client -> index); - #endif - - switch (stuff->data) + REQUEST(xReq); + if (stuff->data <= X_ShmCreatePixmap) { - case X_ShmQueryVersion: - return SProcShmQueryVersion(client); - case X_ShmAttach: - return SProcShmAttach(client); - case X_ShmDetach: - return SProcShmDetach(client); - case X_ShmPutImage: - { - int result; - - #ifdef TEST - fprintf(stderr, "SProcShmDispatch: Going to execute SProcShmPutImage() for client [%d].\n", - client -> index); - #endif - -#ifdef NXAGENT_SERVER - nxagentShmTrap = 1; -#endif + fprintf(stderr, "SProcShmDispatch: Request [%s] OPCODE [%d] for client [%d].\n", + nxagentShmRequestLiteral[stuff->data], stuff->data, client->index); + } + #endif - result = SProcShmPutImage(client); + nxagentShmTrap = 1; -#ifdef NXAGENT_SERVER - nxagentShmTrap = 0; -#endif + result = xorg_SProcShmDispatch(client); - #ifdef TEST - fprintf(stderr, "SProcShmDispatch: Returning from SProcShmPutImage() for client [%d].\n", - client -> index); - #endif + nxagentShmTrap = 0; - return result; - } - case X_ShmGetImage: - return SProcShmGetImage(client); - case X_ShmCreatePixmap: - return SProcShmCreatePixmap(client); - default: - return BadRequest; - } + return result; } |