summaryrefslogtreecommitdiffstats
path: root/src/glx/x11/glxext.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-05-07 17:14:50 +0000
committerBrian Paul <[email protected]>2005-05-07 17:14:50 +0000
commit2eb147e7f5754a97cb1a5617db7d529754cfe002 (patch)
treeb39205101677521417a377a72f617570fcebfb04 /src/glx/x11/glxext.c
parent6f3d16c64aee2ef0eb94aa0e4ab1ce53fd4a5579 (diff)
Patches for XCB (Jeremy Kolb)
Diffstat (limited to 'src/glx/x11/glxext.c')
-rw-r--r--src/glx/x11/glxext.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c
index badaf9a559f..1d82af295fd 100644
--- a/src/glx/x11/glxext.c
+++ b/src/glx/x11/glxext.c
@@ -68,6 +68,12 @@
#include "dri_glx.h"
#endif
+#ifdef USE_XCB
+#include <X11/xcl.h>
+#include <X11/XCB/xcb.h>
+#include <X11/XCB/glx.h>
+#endif
+
#include <assert.h>
#ifdef DEBUG
@@ -1047,7 +1053,7 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv)
fb_req->glxCode = X_GLXGetFBConfigs;
fb_req->screen = i;
break;
-
+
case 2:
GetReqExtra(GLXVendorPrivateWithReply,
sz_xGLXGetFBConfigsSGIXReq-sz_xGLXVendorPrivateWithReplyReq,vpreq);
@@ -1349,10 +1355,17 @@ CARD8 __glXSetupForCommand(Display *dpy)
GLubyte *__glXFlushRenderBuffer(__GLXcontext *ctx, GLubyte *pc)
{
Display * const dpy = ctx->currentDpy;
+#ifdef USE_XCB
+ XCBConnection *c = XCBConnectionOfDisplay(dpy);
+#else
xGLXRenderReq *req;
+#endif /* USE_XCB */
const GLint size = pc - ctx->buf;
if ( (dpy != NULL) && (size > 0) ) {
+#ifdef USE_XCB
+ XCBGlxRender(c, ctx->currentContextTag, size, (char *)ctx->buf);
+#else
/* Send the entire buffer as an X request */
LockDisplay(dpy);
GetReq(GLXRender,req);
@@ -1363,6 +1376,7 @@ GLubyte *__glXFlushRenderBuffer(__GLXcontext *ctx, GLubyte *pc)
_XSend(dpy, (char *)ctx->buf, size);
UnlockDisplay(dpy);
SyncHandle();
+#endif
}
/* Reset pointer and return it */
@@ -1392,8 +1406,12 @@ void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber,
const GLvoid * data, GLint dataLen)
{
Display *dpy = gc->currentDpy;
+#ifdef USE_XCB
+ XCBConnection *c = XCBConnectionOfDisplay(dpy);
+ XCBGlxRenderLarge(c, gc->currentContextTag, requestNumber, totalRequests, dataLen, data);
+#else
xGLXRenderLargeReq *req;
-
+
if ( requestNumber == 1 ) {
LockDisplay(dpy);
}
@@ -1412,6 +1430,7 @@ void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber,
UnlockDisplay(dpy);
SyncHandle();
}
+#endif /* USE_XCB */
}