devPrivates rework: update new GL/glxext code.
Need to merge so this type of thing stops happening.
This commit is contained in:
parent
c3f7b86255
commit
50b27e1ad2
|
@ -27,6 +27,7 @@
|
||||||
#include "glxserver.h"
|
#include "glxserver.h"
|
||||||
#include <windowstr.h>
|
#include <windowstr.h>
|
||||||
#include <propertyst.h>
|
#include <propertyst.h>
|
||||||
|
#include "privates.h"
|
||||||
#include <os.h>
|
#include <os.h>
|
||||||
#include "g_disptab.h"
|
#include "g_disptab.h"
|
||||||
#include "unpack.h"
|
#include "unpack.h"
|
||||||
|
@ -53,7 +54,7 @@ RESTYPE __glXSwapBarrierRes;
|
||||||
*/
|
*/
|
||||||
xGLXSingleReply __glXReply;
|
xGLXSingleReply __glXReply;
|
||||||
|
|
||||||
static int glxClientPrivateIndex;
|
static DevPrivateKey glxClientPrivateKey = &glxClientPrivateKey;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Client that called into GLX dispatch.
|
** Client that called into GLX dispatch.
|
||||||
|
@ -218,7 +219,7 @@ int __glXError(int error)
|
||||||
__GLXclientState *
|
__GLXclientState *
|
||||||
glxGetClient(ClientPtr pClient)
|
glxGetClient(ClientPtr pClient)
|
||||||
{
|
{
|
||||||
return (__GLXclientState *) pClient->devPrivates[glxClientPrivateIndex].ptr;
|
return dixLookupPrivate(&pClient->devPrivates, glxClientPrivateKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -288,9 +289,7 @@ void GlxExtensionInit(void)
|
||||||
__glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
|
__glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
|
||||||
__glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone);
|
__glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone);
|
||||||
|
|
||||||
glxClientPrivateIndex = AllocateClientPrivateIndex ();
|
if (!dixRequestPrivate(glxClientPrivateKey, sizeof (__GLXclientState)))
|
||||||
if (!AllocateClientPrivate (glxClientPrivateIndex,
|
|
||||||
sizeof (__GLXclientState)))
|
|
||||||
return;
|
return;
|
||||||
if (!AddCallback (&ClientStateCallback, glxClientCallback, 0))
|
if (!AddCallback (&ClientStateCallback, glxClientCallback, 0))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -41,11 +41,12 @@
|
||||||
#include <windowstr.h>
|
#include <windowstr.h>
|
||||||
#include <os.h>
|
#include <os.h>
|
||||||
|
|
||||||
|
#include "privates.h"
|
||||||
#include "glxserver.h"
|
#include "glxserver.h"
|
||||||
#include "glxutil.h"
|
#include "glxutil.h"
|
||||||
#include "glxext.h"
|
#include "glxext.h"
|
||||||
|
|
||||||
static int glxScreenPrivateIndex;
|
static DevPrivateKey glxScreenPrivateKey = &glxScreenPrivateKey;
|
||||||
|
|
||||||
const char GLServerVersion[] = "1.4";
|
const char GLServerVersion[] = "1.4";
|
||||||
static const char GLServerExtensions[] =
|
static const char GLServerExtensions[] =
|
||||||
|
@ -278,22 +279,11 @@ glxCloseScreen (int index, ScreenPtr pScreen)
|
||||||
__GLXscreen *
|
__GLXscreen *
|
||||||
glxGetScreen(ScreenPtr pScreen)
|
glxGetScreen(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
return (__GLXscreen *) pScreen->devPrivates[glxScreenPrivateIndex].ptr;
|
return dixLookupPrivate(&pScreen->devPrivates, glxScreenPrivateKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __glXScreenInit(__GLXscreen *glxScreen, ScreenPtr pScreen)
|
void __glXScreenInit(__GLXscreen *glxScreen, ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
static int glxGeneration;
|
|
||||||
|
|
||||||
if (glxGeneration != serverGeneration)
|
|
||||||
{
|
|
||||||
glxScreenPrivateIndex = AllocateScreenPrivateIndex ();
|
|
||||||
if (glxScreenPrivateIndex == -1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
glxGeneration = serverGeneration;
|
|
||||||
}
|
|
||||||
|
|
||||||
glxScreen->pScreen = pScreen;
|
glxScreen->pScreen = pScreen;
|
||||||
glxScreen->GLextensions = xstrdup(GLServerExtensions);
|
glxScreen->GLextensions = xstrdup(GLServerExtensions);
|
||||||
glxScreen->GLXvendor = xstrdup(GLXServerVendorName);
|
glxScreen->GLXvendor = xstrdup(GLXServerVendorName);
|
||||||
|
@ -308,9 +298,9 @@ void __glXScreenInit(__GLXscreen *glxScreen, ScreenPtr pScreen)
|
||||||
|
|
||||||
__glXScreenInitVisuals(glxScreen);
|
__glXScreenInitVisuals(glxScreen);
|
||||||
|
|
||||||
pScreen->devPrivates[glxScreenPrivateIndex].ptr = (pointer) glxScreen;
|
dixSetPrivate(&pScreen->devPrivates, glxScreenPrivateKey, glxScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __glXScreenDestroy(__GLXscreen *screen)
|
void __glXScreenDestroy(__GLXscreen *screen)
|
||||||
{
|
{
|
||||||
xfree(screen->GLXvendor);
|
xfree(screen->GLXvendor);
|
||||||
|
|
Loading…
Reference in New Issue