summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRALOVICH, Kristóf <tade60@freemail.hu>2008-11-04 10:59:39 +0100
committerBrian Paul <brian.paul@tungstengraphics.com>2008-11-26 10:02:10 -0700
commit9c7aaa7afbda92587f28cc28c4c8315e7861d318 (patch)
treec3265ba46d2f87fdc4287f32c3a3b26f814e9c52
parent00f22f972f6c96589cb9f6fa75b803c9506d61f5 (diff)
glx: xcbified __glXIsDirect
-rw-r--r--src/glx/x11/glxcmds.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c
index 03c0e5ad1..18bf12084 100644
--- a/src/glx/x11/glxcmds.c
+++ b/src/glx/x11/glxcmds.c
@@ -44,6 +44,12 @@
#include "xf86dri.h"
#endif
+#if defined(USE_XCB)
+#include <X11/Xlib-xcb.h>
+#include <xcb/xcb.h>
+#include <xcb/glx.h>
+#endif
+
static const char __glXGLXClientVendorName[] = "SGI";
static const char __glXGLXClientVersion[] = "1.4";
@@ -749,8 +755,10 @@ PUBLIC void glXCopyContext(Display *dpy, GLXContext source,
*/
static Bool __glXIsDirect(Display *dpy, GLXContextID contextID)
{
+#if !defined(USE_XCB)
xGLXIsDirectReq *req;
xGLXIsDirectReply reply;
+#endif
CARD8 opcode;
opcode = __glXSetupForCommand(dpy);
@@ -758,6 +766,18 @@ static Bool __glXIsDirect(Display *dpy, GLXContextID contextID)
return GL_FALSE;
}
+#ifdef USE_XCB
+ xcb_connection_t* c = XGetXCBConnection(dpy);
+ xcb_glx_is_direct_reply_t* reply =
+ xcb_glx_is_direct_reply(c,
+ xcb_glx_is_direct(c, contextID),
+ NULL);
+
+ const Bool is_direct = reply->is_direct ? True : False;
+ free(reply);
+
+ return is_direct;
+#else
/* Send the glXIsDirect request */
LockDisplay(dpy);
GetReq(GLXIsDirect,req);
@@ -769,6 +789,7 @@ static Bool __glXIsDirect(Display *dpy, GLXContextID contextID)
SyncHandle();
return reply.isDirect;
+#endif /* USE_XCB */
}
/**