diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2017-10-18 00:21:00 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-11-17 13:10:29 +0100 |
commit | fff0d54733b016f225eb767b3d755c06295ac806 (patch) | |
tree | 4b5bad96c6bc4986384ff89b1eba7d733eda5e33 /nx-X11/programs/Xserver/hw | |
parent | b0b62dde6decc460feb4037b630ce0de6d1fb19b (diff) | |
download | nx-libs-fff0d54733b016f225eb767b3d755c06295ac806.tar.gz nx-libs-fff0d54733b016f225eb767b3d755c06295ac806.tar.bz2 nx-libs-fff0d54733b016f225eb767b3d755c06295ac806.zip |
glxext.c/NXglxext.c: merge two functions into one
This has also been done in Xorg 7.1
This also fixes a little flaw for the swapped case: a check for
glXRenderLarge was missing.
Diffstat (limited to 'nx-X11/programs/Xserver/hw')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/NXglxext.c | 75 |
1 files changed, 4 insertions, 71 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c index 5512cae1b..f94473be0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c @@ -107,77 +107,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 |