diff options
author | Kristian Høgsberg <krh@redhat.com> | 2008-07-21 18:16:38 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2008-07-24 13:34:24 -0400 |
commit | 24dddcd0ef845f4120f8588dc63ec754338ffac8 (patch) | |
tree | ba660c3a6ad41b8e3acc2778f3f98d87128194bc | |
parent | 5c1e254cc85e9ad409b0217780545c29f62d5feb (diff) |
Drop unnecessary linked list of contexts from GLXDrawable.
-rw-r--r-- | glx/glxcmds.c | 16 | ||||
-rw-r--r-- | glx/glxdrawable.h | 9 | ||||
-rw-r--r-- | glx/glxutil.c | 68 |
3 files changed, 10 insertions, 83 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 083113584..ea70ca478 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -147,8 +147,10 @@ validGlxFBConfigForWindow(ClientPtr client, __GLXconfig *config, void __glXContextDestroy(__GLXcontext *context) { - if (!context->isDirect) - __glXDeassociateContext(context); + if (!context->isDirect) { + __glXUnrefDrawable(context->drawPriv); + __glXUnrefDrawable(context->readPriv); + } __glXFlushContextCache(); } @@ -618,7 +620,10 @@ DoMakeCurrent(__GLXclientState *cl, return __glXError(GLXBadContext); } __glXFlushContextCache(); - __glXDeassociateContext(prevglxc); + if (!glxc->isDirect) { + __glXUnrefDrawable(glxc->drawPriv); + __glXUnrefDrawable(glxc->readPriv); + } } @@ -644,9 +649,8 @@ DoMakeCurrent(__GLXclientState *cl, } glxc->isCurrent = GL_TRUE; - __glXAssociateContext(glxc); - assert(drawPriv->drawGlxc == glxc); - assert(readPriv->readGlxc == glxc); + __glXRefDrawable(glxc->drawPriv); + __glXRefDrawable(glxc->readPriv); } if (prevglxc) { diff --git a/glx/glxdrawable.h b/glx/glxdrawable.h index 98e301b88..5b4338272 100644 --- a/glx/glxdrawable.h +++ b/glx/glxdrawable.h @@ -77,15 +77,6 @@ struct __GLXdrawable { __GLXconfig *config; /* - ** Lists of contexts bound to this drawable. There are two lists here. - ** One list is of the contexts that have this drawable bound for drawing, - ** and the other is the list of contexts that have this drawable bound - ** for reading. - */ - __GLXcontext *drawGlxc; - __GLXcontext *readGlxc; - - /* ** reference count */ int refCount; diff --git a/glx/glxutil.c b/glx/glxutil.c index fc73a02c9..f5b741420 100644 --- a/glx/glxutil.c +++ b/glx/glxutil.c @@ -44,74 +44,6 @@ #include "glxserver.h" #include "glxutil.h" -/************************************************************************/ -/* Context stuff */ - - -/* -** associate a context with a drawable -*/ -void -__glXAssociateContext(__GLXcontext *glxc) -{ - glxc->nextDrawPriv = glxc->drawPriv->drawGlxc; - glxc->drawPriv->drawGlxc = glxc; - - __glXRefDrawable(glxc->drawPriv); - - - glxc->nextReadPriv = glxc->readPriv->readGlxc; - glxc->readPriv->readGlxc = glxc; - - __glXRefDrawable(glxc->readPriv); -} - -/* -** Deassociate a context from a drawable -*/ -void -__glXDeassociateContext(__GLXcontext *glxc) -{ - __GLXcontext *curr, *prev; - - prev = NULL; - if (glxc->drawPriv) { - for ( curr = glxc->drawPriv->drawGlxc; curr != NULL - ; prev = curr, curr = curr->nextDrawPriv ) { - if (curr == glxc) { - /* found context. Deassociate. */ - if (prev == NULL) { - glxc->drawPriv->drawGlxc = curr->nextDrawPriv; - } else { - prev->nextDrawPriv = curr->nextDrawPriv; - } - curr->nextDrawPriv = NULL; - __glXUnrefDrawable(glxc->drawPriv); - break; - } - } - } - - prev = NULL; - if (glxc->readPriv) { - for ( curr = glxc->readPriv->readGlxc - ; curr != NULL - ; prev = curr, curr = curr->nextReadPriv ) { - if (curr == glxc) { - /* found context. Deassociate. */ - if (prev == NULL) { - glxc->readPriv->readGlxc = curr->nextReadPriv; - } else { - prev->nextReadPriv = curr->nextReadPriv; - } - curr->nextReadPriv = NULL; - __glXUnrefDrawable(glxc->readPriv); - break; - } - } - } -} - /*****************************************************************************/ /* Drawable private stuff */ |