diff options
author | marha <marha@users.sourceforge.net> | 2013-11-04 12:11:17 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-11-04 12:11:17 +0100 |
commit | d79b6645eb21ca82d506ef038b8ea71a1e431f3f (patch) | |
tree | 8f96f2c0492c134147a32e124ea5d0a7337b2242 /xorg-server/glx/glxext.c | |
parent | feb35c5e0724010fc4431e4e4fb24720fcdffe80 (diff) | |
parent | e4ef724e06621be9325fc41ed886fd404467fdc0 (diff) | |
download | vcxsrv-d79b6645eb21ca82d506ef038b8ea71a1e431f3f.tar.gz vcxsrv-d79b6645eb21ca82d506ef038b8ea71a1e431f3f.tar.bz2 vcxsrv-d79b6645eb21ca82d506ef038b8ea71a1e431f3f.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
fontconfig glproto libX11 mesa xserver xkeyboard-config git update 31 oct 2013
Conflicts:
xorg-server/glx/dispatch.h
xorg-server/glx/glapi.c
xorg-server/glx/glapi.h
xorg-server/glx/glapi_gentable.c
xorg-server/glx/glapitable.h
xorg-server/glx/glprocs.h
xorg-server/glx/glxcmdsswap.c
xorg-server/glx/glxdri.c
xorg-server/glx/glxext.c
xorg-server/glx/glxext.h
xorg-server/glx/indirect_dispatch.c
xorg-server/glx/indirect_dispatch.h
xorg-server/glx/indirect_dispatch_swap.c
xorg-server/glx/indirect_reqsize.c
xorg-server/glx/indirect_reqsize.h
xorg-server/glx/indirect_size.h
xorg-server/glx/indirect_size_get.c
xorg-server/glx/indirect_size_get.h
xorg-server/glx/indirect_table.c
xorg-server/glx/indirect_texture_compression.c
xorg-server/glx/render2.c
xorg-server/glx/render2swap.c
Diffstat (limited to 'xorg-server/glx/glxext.c')
-rw-r--r-- | xorg-server/glx/glxext.c | 51 |
1 files changed, 35 insertions, 16 deletions
diff --git a/xorg-server/glx/glxext.c b/xorg-server/glx/glxext.c index e690044a4..b35339b06 100644 --- a/xorg-server/glx/glxext.c +++ b/xorg-server/glx/glxext.c @@ -50,9 +50,6 @@ #include "glxext.h" #include "indirect_table.h" #include "indirect_util.h" -#include "glapi.h" - -extern void FlushContext(__GLXcontext *cx); /* ** The last context used by the server. It is the context that is current @@ -102,16 +99,15 @@ __glXResetLargeCommandStatus(__GLXclientState * cl) } /* -** This procedure is called when the client who created the context goes -** away OR when glXDestroyContext is called. In either case, all we do is -** flag that the ID is no longer valid, and (maybe) free the context. -** use. -*/ + * This procedure is called when the client who created the context goes away + * OR when glXDestroyContext is called. In either case, all we do is flag that + * the ID is no longer valid, and (maybe) free the context. + */ static int ContextGone(__GLXcontext * cx, XID id) { cx->idExists = GL_FALSE; - if (!cx->isCurrent) { + if (!cx->currentClient) { __glXFreeContext(cx); } @@ -145,11 +141,10 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid) for (c = glxAllContexts; c; c = next) { next = c->next; - if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) { - if (GET_DISPATCH()) FlushContext(c); /* Only flush if we still have a context */ - + if (c->currentClient && + (c->drawPriv == glxPriv || c->readPriv == glxPriv)) { + /* just force a re-bind the next time through */ (*c->loseCurrent) (c); - c->isCurrent = GL_FALSE; if (c == __glXLastContext) __glXFlushContextCache(); } @@ -205,17 +200,17 @@ __glXRemoveFromContextList(__GLXcontext * cx) GLboolean __glXFreeContext(__GLXcontext * cx) { - if (cx->idExists || cx->isCurrent) + if (cx->idExists || cx->currentClient) return GL_FALSE; + __glXRemoveFromContextList(cx); + free(cx->feedbackBuf); free(cx->selectBuf); if (cx == __glXLastContext) { __glXFlushContextCache(); } - __glXRemoveFromContextList(cx); - /* We can get here through both regular dispatching from * __glXDispatch() or as a callback from the resource manager. In * the latter case we need to lift the DRI lock manually. */ @@ -292,6 +287,7 @@ glxClientCallback(CallbackListPtr *list, pointer closure, pointer data) NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; __GLXclientState *cl = glxGetClient(pClient); + __GLXcontext *c, *next; switch (pClient->clientState) { case ClientStateRunning: @@ -299,6 +295,16 @@ glxClientCallback(CallbackListPtr *list, pointer closure, pointer data) break; case ClientStateGone: + /* detach from all current contexts */ + for (c = glxAllContexts; c; c = next) { + next = c->next; + if (c->currentClient == pClient) { + c->loseCurrent(c); + c->currentClient = NULL; + __glXFreeContext(c); + } + } + free(cl->returnBuf); free(cl->largeCmdBuf); free(cl->GLClientextensions); @@ -539,6 +545,19 @@ __glXleaveServer(GLboolean rendering) glxServerLeaveCount++; } +static void (*(*_get_proc_address)(const char *))(void); + +void +__glXsetGetProcAddress(void (*(*get_proc_address) (const char *))(void)) +{ + _get_proc_address = get_proc_address; +} + +void *__glGetProcAddress(const char *proc) +{ + return _get_proc_address(proc); +} + /* ** Top level dispatcher; all commands are executed from here down. */ |