glx: Use one function to add a context to all global tables
Instead of having separate __glXAddContextToList and AddResource functions, just have one function that does both steps. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Reviewed-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
This commit is contained in:
parent
c1d91ab370
commit
cd5689cac5
|
@ -308,16 +308,14 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId,
|
||||||
glxc->drawPriv = NULL;
|
glxc->drawPriv = NULL;
|
||||||
glxc->readPriv = NULL;
|
glxc->readPriv = NULL;
|
||||||
|
|
||||||
/* Register this context as a resource.
|
/* Add the new context to the various global tables of GLX contexts.
|
||||||
*/
|
*/
|
||||||
if (!AddResource(gcId, __glXContextRes, (pointer)glxc)) {
|
if (!__glXAddContext(glxc)) {
|
||||||
(*glxc->destroy) (glxc);
|
(*glxc->destroy) (glxc);
|
||||||
client->errorValue = gcId;
|
client->errorValue = gcId;
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
__glXAddToContextList(glxc);
|
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
11
glx/glxext.c
11
glx/glxext.c
|
@ -157,11 +157,18 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid)
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
Bool
|
||||||
__glXAddToContextList(__GLXcontext * cx)
|
__glXAddContext(__GLXcontext * cx)
|
||||||
{
|
{
|
||||||
|
/* Register this context as a resource.
|
||||||
|
*/
|
||||||
|
if (!AddResource(cx->id, __glXContextRes, (pointer)cx)) {
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
cx->next = glxAllContexts;
|
cx->next = glxAllContexts;
|
||||||
glxAllContexts = cx;
|
glxAllContexts = cx;
|
||||||
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
extern GLboolean __glXFreeContext(__GLXcontext * glxc);
|
extern GLboolean __glXFreeContext(__GLXcontext * glxc);
|
||||||
extern void __glXFlushContextCache(void);
|
extern void __glXFlushContextCache(void);
|
||||||
|
|
||||||
extern void __glXAddToContextList(__GLXcontext * cx);
|
extern Bool __glXAddContext(__GLXcontext * cx);
|
||||||
extern void __glXErrorCallBack(GLenum code);
|
extern void __glXErrorCallBack(GLenum code);
|
||||||
extern void __glXClearErrorOccured(void);
|
extern void __glXClearErrorOccured(void);
|
||||||
extern GLboolean __glXErrorOccured(void);
|
extern GLboolean __glXErrorOccured(void);
|
||||||
|
|
Loading…
Reference in New Issue