aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glx/glxscreens.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
committermarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
commit81f91c615982e50bb62708201569c33a3cd3d973 (patch)
tree4f32ecc48a3b7b5e76642f3792338263c53879bd /xorg-server/glx/glxscreens.c
parentb571a562410f565af2bdde52d9f7f9a23ffae04f (diff)
parenta915739887477b28d924ecc8417ee107d125bd6c (diff)
downloadvcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.gz
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.bz2
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.zip
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/glx/glxscreens.c')
-rw-r--r--xorg-server/glx/glxscreens.c40
1 files changed, 36 insertions, 4 deletions
diff --git a/xorg-server/glx/glxscreens.c b/xorg-server/glx/glxscreens.c
index d232e888c..fe7b22d96 100644
--- a/xorg-server/glx/glxscreens.c
+++ b/xorg-server/glx/glxscreens.c
@@ -181,6 +181,7 @@ static char GLXServerExtensions[] =
"GLX_SGIX_swap_barrier "
#endif
"GLX_SGIX_fbconfig "
+ "GLX_SGIX_pbuffer "
"GLX_MESA_copy_sub_buffer "
;
@@ -215,6 +216,7 @@ glxCloseScreen (int index, ScreenPtr pScreen)
__GLXscreen *pGlxScreen = glxGetScreen(pScreen);
pScreen->CloseScreen = pGlxScreen->CloseScreen;
+ pScreen->DestroyWindow = pGlxScreen->DestroyWindow;
pGlxScreen->destroy(pGlxScreen);
@@ -227,8 +229,8 @@ glxGetScreen(ScreenPtr pScreen)
return dixLookupPrivate(&pScreen->devPrivates, glxScreenPrivateKey);
}
-void GlxSetVisualConfigs(int nconfigs,
- __GLXvisualConfig *configs, void **privates)
+_X_EXPORT void GlxSetVisualConfigs(int nconfigs,
+ void *configs, void **privates)
{
/* We keep this stub around for the DDX drivers that still
* call it. */
@@ -257,6 +259,7 @@ AddScreenVisuals(ScreenPtr pScreen, int count, int d)
VisualPtr visuals;
ColormapPtr installedCmap;
DepthPtr depth;
+ int rc;
depth = NULL;
for (i = 0; i < pScreen->numDepths; i++) {
@@ -297,8 +300,10 @@ AddScreenVisuals(ScreenPtr pScreen, int count, int d)
* for all colormaps.
*/
for (i = 0; i < numInstalledCmaps; i++) {
- installedCmap = LookupIDByType (installedCmaps[i], RT_COLORMAP);
- if (!installedCmap)
+ rc = dixLookupResourceByType((pointer *)&installedCmap,
+ installedCmaps[i], RT_COLORMAP,
+ serverClient, DixReadAccess);
+ if (rc != Success)
continue;
j = installedCmap->pVisual - pScreen->visuals;
installedCmap->pVisual = &visuals[j];
@@ -395,6 +400,31 @@ pickFBConfig(__GLXscreen *pGlxScreen, VisualPtr visual)
return best;
}
+static Bool
+glxDestroyWindow(WindowPtr pWin)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ __GLXscreen *pGlxScreen = glxGetScreen(pScreen);
+ Bool retval = TRUE;
+
+ FreeResource(pWin->drawable.id, FALSE);
+
+ /* call lower wrapped functions */
+ if (pGlxScreen->DestroyWindow) {
+ /* unwrap */
+ pScreen->DestroyWindow = pGlxScreen->DestroyWindow;
+
+ /* call lower layers */
+ retval = (*pScreen->DestroyWindow)(pWin);
+
+ /* rewrap */
+ pGlxScreen->DestroyWindow = pScreen->DestroyWindow;
+ pScreen->DestroyWindow = glxDestroyWindow;
+ }
+
+ return retval;
+}
+
void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
{
__GLXconfig *m;
@@ -409,6 +439,8 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
pGlxScreen->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = glxCloseScreen;
+ pGlxScreen->DestroyWindow = pScreen->DestroyWindow;
+ pScreen->DestroyWindow = glxDestroyWindow;
i = 0;
for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next) {