diff options
author | Ian Romanick <[email protected]> | 2010-02-04 15:39:36 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-02-11 15:40:28 -0800 |
commit | 2b4e009ed56b69b243f5cc88f490dcf8166cf729 (patch) | |
tree | 9da68ede5b92565a47e02d0e8d20f868ad3adb7a | |
parent | 2d1088cc17ef3920225aceefb6dc9cf2a61e4dec (diff) |
glx: Use wrapper macro to detect direct rendering
The wrapper macro GC_IS_DIRECT is used in CreateContext and a couple
other places to eliminate the need for some of the '#ifdef
GLX_DIRECT_RENDERING' madness. There appear to be a *LOT* of places
in glxcmds.c where '#ifdef GLX_DIRECT_RENDERING' is missing.
-rw-r--r-- | src/glx/glxcmds.c | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index c3be974ea91..49224060adb 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -42,6 +42,9 @@ #include <sys/time.h> #include <X11/extensions/xf86vmode.h> #include "xf86dri.h" +#define GC_IS_DIRECT(gc) ((gc)->driContext != NULL) +#else +#define GC_IS_DIRECT(gc) (0) #endif #if defined(USE_XCB) @@ -431,11 +434,7 @@ CreateContext(Display * dpy, XVisualInfo * vis, req->visual = vis->visualid; req->screen = vis->screen; req->shareList = shareList ? shareList->xid : None; -#ifdef GLX_DIRECT_RENDERING - req->isDirect = gc->driContext != NULL; -#else - req->isDirect = 0; -#endif + req->isDirect = GC_IS_DIRECT(gc); } else if (use_glx_1_3) { xGLXCreateNewContextReq *req; @@ -449,11 +448,7 @@ CreateContext(Display * dpy, XVisualInfo * vis, req->screen = fbconfig->screen; req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; -#ifdef GLX_DIRECT_RENDERING - req->isDirect = gc->driContext != NULL; -#else - req->isDirect = 0; -#endif + req->isDirect = GC_IS_DIRECT(gc); } else { xGLXVendorPrivateWithReplyReq *vpreq; @@ -472,11 +467,7 @@ CreateContext(Display * dpy, XVisualInfo * vis, req->screen = fbconfig->screen; req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; -#ifdef GLX_DIRECT_RENDERING - req->isDirect = gc->driContext != NULL; -#else - req->isDirect = 0; -#endif + req->isDirect = GC_IS_DIRECT(gc); } UnlockDisplay(dpy); @@ -864,11 +855,9 @@ glXIsDirect(Display * dpy, GLXContext gc) { if (!gc) { return GL_FALSE; -#ifdef GLX_DIRECT_RENDERING } - else if (gc->driContext) { + else if (GC_IS_DIRECT(gc)) { return GL_TRUE; -#endif } return __glXIsDirect(dpy, gc->xid); } @@ -2874,13 +2863,8 @@ __glXReleaseTexImageEXT(Display * dpy, GLXDrawable drawable, int buffer) INT32 *buffer_ptr; CARD8 opcode; - if (gc == NULL) - return; - -#ifdef GLX_DIRECT_RENDERING - if (gc->driContext) + if ((gc == NULL) || GC_IS_DIRECT(gc)) return; -#endif opcode = __glXSetupForCommand(dpy); if (!opcode) |