aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-11-17 13:16:39 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-11-17 13:16:39 +0100
commit39d45a0e8ff58a649e5c8e403f89e3b14ad1c9d2 (patch)
treed34c52b995ea4e96306518d0ca663c0457d2e4e9 /nx-X11/programs/Xserver/hw/nxagent/NXglxext.c
parent56569f3366841b16c389ca37267776b5c6044f8a (diff)
parent9a16043722f6d60505a8776048b39cc7f1e799d9 (diff)
downloadnx-libs-39d45a0e8ff58a649e5c8e403f89e3b14ad1c9d2.tar.gz
nx-libs-39d45a0e8ff58a649e5c8e403f89e3b14ad1c9d2.tar.bz2
nx-libs-39d45a0e8ff58a649e5c8e403f89e3b14ad1c9d2.zip
Merge branch 'uli42-small_fixes' into 3.6.x
Attributes GH PR #532: https://github.com/ArcticaProject/nx-libs/pull/532
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/NXglxext.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXglxext.c82
1 files changed, 7 insertions, 75 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c
index 5512cae1b..9d0f4f719 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c
@@ -57,12 +57,11 @@
*/
static int __glXDispatch(ClientPtr client)
{
- int result;
-
REQUEST(xGLXSingleReq);
CARD8 opcode;
int (*proc)(__GLXclientState *cl, GLbyte *pc);
__GLXclientState *cl;
+ int retval;
opcode = stuff->glxCode;
cl = __glXClients[client->index];
@@ -107,77 +106,10 @@ static int __glXDispatch(ClientPtr client)
/*
** Use the opcode to index into the procedure table.
*/
- proc = __glXSingleTable[opcode];
-
- /*
- * Report upstream that we are
- * dispatching a GLX operation.
- */
-
- nxagentGlxTrap = 1;
-
- #ifdef TEST
- fprintf(stderr, "__glXDispatch: Going to dispatch GLX operation [%d] for client [%d].\n",
- opcode, client -> index);
- #endif
-
- result = (*proc)(cl, (GLbyte *) stuff);
-
- nxagentGlxTrap = 0;
-
- #ifdef TEST
- fprintf(stderr, "__glXDispatch: Dispatched GLX operation [%d] for client [%d].\n",
- opcode, client -> index);
- #endif
-
- return result;
-}
-
-static int __glXSwapDispatch(ClientPtr client)
-{
- int result;
-
- REQUEST(xGLXSingleReq);
- CARD8 opcode;
- int (*proc)(__GLXclientState *cl, GLbyte *pc);
- __GLXclientState *cl;
-
- opcode = stuff->glxCode;
- cl = __glXClients[client->index];
- if (!cl) {
- cl = (__GLXclientState *) malloc(sizeof(__GLXclientState));
- __glXClients[client->index] = cl;
- if (!cl) {
- return BadAlloc;
- }
- memset(cl, 0, sizeof(__GLXclientState));
- }
-
- if (!cl->inUse) {
- /*
- ** This is first request from this client. Associate a resource
- ** with the client so we will be notified when the client dies.
- */
- XID xid = FakeClientID(client->index);
- if (!AddResource( xid, __glXClientRes, (void *)(long)client->index)) {
- return BadAlloc;
- }
- ResetClientState(client->index);
- cl->inUse = GL_TRUE;
- cl->client = client;
- }
-
- /*
- ** Check for valid opcode.
- */
- if (opcode >= __GLX_SINGLE_TABLE_SIZE) {
- return BadRequest;
- }
-
- /*
- ** Use the opcode to index into the procedure table.
- */
- proc = __glXSwapSingleTable[opcode];
+ if (client->swapped)
+ proc = __glXSwapSingleTable[opcode];
+ else
+ proc = __glXSingleTable[opcode];
/*
* Report upstream that we are
@@ -191,7 +123,7 @@ static int __glXSwapDispatch(ClientPtr client)
opcode, client -> index);
#endif
- result = (*proc)(cl, (GLbyte *) stuff);
+ retval = (*proc)(cl, (GLbyte *) stuff);
nxagentGlxTrap = 0;
@@ -200,5 +132,5 @@ static int __glXSwapDispatch(ClientPtr client)
opcode, client -> index);
#endif
- return result;
+ return retval;
}