aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/dmx/glxProxy/glxcmds.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-11-04 12:11:17 +0100
committermarha <marha@users.sourceforge.net>2013-11-04 12:11:17 +0100
commitd79b6645eb21ca82d506ef038b8ea71a1e431f3f (patch)
tree8f96f2c0492c134147a32e124ea5d0a7337b2242 /xorg-server/hw/dmx/glxProxy/glxcmds.c
parentfeb35c5e0724010fc4431e4e4fb24720fcdffe80 (diff)
parente4ef724e06621be9325fc41ed886fd404467fdc0 (diff)
downloadvcxsrv-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/hw/dmx/glxProxy/glxcmds.c')
-rw-r--r--xorg-server/hw/dmx/glxProxy/glxcmds.c42
1 files changed, 35 insertions, 7 deletions
diff --git a/xorg-server/hw/dmx/glxProxy/glxcmds.c b/xorg-server/hw/dmx/glxProxy/glxcmds.c
index 335da37ac..190eeefe2 100644
--- a/xorg-server/hw/dmx/glxProxy/glxcmds.c
+++ b/xorg-server/hw/dmx/glxProxy/glxcmds.c
@@ -123,6 +123,28 @@ GetBackEndDisplay(__GLXclientState * cl, int s)
return cl->be_displays[s];
}
+/**
+ * Convert the render type bits from fbconfig into context render type.
+ */
+static int
+renderTypeBitsToRenderTypeEnum(int fbRenderType)
+{
+ if (fbRenderType & GLX_RGBA_BIT)
+ return GLX_RGBA_TYPE;
+
+ if (fbRenderType & GLX_COLOR_INDEX_BIT)
+ return GLX_COLOR_INDEX_TYPE;
+
+ if (fbRenderType & GLX_RGBA_FLOAT_BIT_ARB)
+ return GLX_RGBA_FLOAT_TYPE_ARB;
+
+ if (fbRenderType & GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT)
+ return GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT;
+
+ /* There's no recognized renderType in the config */
+ return GLX_RGBA_TYPE;
+}
+
/*
** Create a GL context with the given properties.
*/
@@ -308,12 +330,14 @@ CreateContext(__GLXclientState * cl,
/* send the create context request to the back-end server */
dpy = GetBackEndDisplay(cl, screen);
if (glxc->pFBConfig) {
- /*Since for a certain visual both RGB and COLOR INDEX
- *can be on then the only parmeter to choose the renderType
- * should be the class of the colormap since all 4 first
- * classes does not support RGB mode only COLOR INDEX ,
- * and so TrueColor and DirectColor does not support COLOR INDEX*/
- int renderType = glxc->pFBConfig->renderType;
+ /* For a specific visual, multiple render types (i.e., both RGB
+ * and COLOR INDEX) can be accessible. The only parameter to
+ * choose the renderType should be the class of the colormap,
+ * since the first classes do not support RGB mode (only COLOR
+ * INDEX), and TrueColor and DirectColor do not support COLOR
+ * INDEX.
+ */
+ int renderType = GLX_RGBA_TYPE;
if (pVisual) {
switch (pVisual->class) {
@@ -329,7 +353,11 @@ CreateContext(__GLXclientState * cl,
renderType = GLX_RGBA_TYPE;
break;
}
+ } else {
+ renderType =
+ renderTypeBitsToRenderTypeEnum(glxc->pFBConfig->renderType);
}
+
if (__GLX_IS_VERSION_SUPPORTED(1, 3)) {
LockDisplay(dpy);
GetReq(GLXCreateNewContext, be_new_req);
@@ -3210,7 +3238,7 @@ __glXQueryContext(__GLXclientState * cl, GLbyte * pc)
*pSendBuf++ = GLX_FBCONFIG_ID;
*pSendBuf++ = (int) (ctx->pFBConfig->id);
*pSendBuf++ = GLX_RENDER_TYPE;
- *pSendBuf++ = (int) (ctx->pFBConfig->renderType);
+ *pSendBuf++ = renderTypeBitsToRenderTypeEnum(ctx->pFBConfig->renderType);
*pSendBuf++ = GLX_SCREEN;
*pSendBuf++ = (int) (ctx->pScreen->myNum);