From: Michel Dänzer Date: Sun, 30 Aug 2009 11:06:18 +0000 (+0200) Subject: Merge branch 'mesa_7_5_branch' X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9053bb0d405db0b1a2a917317c7ec41e63b54f09;p=mesa.git Merge branch 'mesa_7_5_branch' Conflicts: src/glx/x11/glxcmds.c --- 9053bb0d405db0b1a2a917317c7ec41e63b54f09 diff --cc src/glx/x11/glxcmds.c index 2efe1919820,3242ac77121..ea55cc49efe --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@@ -843,44 -810,70 +843,72 @@@ __glXIsDirect(Display * dpy, GLXContext * \c GLX_DIRECT_RENDERING is not defined? Do we really need to bother with * the GLX protocol here at all? */ -PUBLIC Bool glXIsDirect(Display *dpy, GLXContext gc) +PUBLIC Bool +glXIsDirect(Display * dpy, GLXContext gc) { - if (!gc) { - return GL_FALSE; + if (!gc) { + return GL_FALSE; #ifdef GLX_DIRECT_RENDERING - } else if (gc->driContext) { - return GL_TRUE; + } + else if (gc->driContext) { + return GL_TRUE; #endif - } - return __glXIsDirect(dpy, gc->xid); -} - -PUBLIC GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis, - Pixmap pixmap) -{ - xGLXCreateGLXPixmapReq *req; - GLXPixmap xid; - CARD8 opcode; - - opcode = __glXSetupForCommand(dpy); - if (!opcode) { - return None; - } - - /* Send the glXCreateGLXPixmap request */ - LockDisplay(dpy); - GetReq(GLXCreateGLXPixmap,req); - req->reqType = opcode; - req->glxCode = X_GLXCreateGLXPixmap; - req->screen = vis->screen; - req->visual = vis->visualid; - req->pixmap = pixmap; - req->glxpixmap = xid = XAllocID(dpy); - UnlockDisplay(dpy); - SyncHandle(); + } + return __glXIsDirect(dpy, gc->xid); +} + +PUBLIC GLXPixmap +glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap) +{ + xGLXCreateGLXPixmapReq *req; + GLXPixmap xid; + CARD8 opcode; + + opcode = __glXSetupForCommand(dpy); + if (!opcode) { + return None; + } + + /* Send the glXCreateGLXPixmap request */ + LockDisplay(dpy); + GetReq(GLXCreateGLXPixmap, req); + req->reqType = opcode; + req->glxCode = X_GLXCreateGLXPixmap; + req->screen = vis->screen; + req->visual = vis->visualid; + req->pixmap = pixmap; + req->glxpixmap = xid = XAllocID(dpy); + UnlockDisplay(dpy); + SyncHandle(); + + #ifdef GLX_DIRECT_RENDERING - do { - /* FIXME: Maybe delay __DRIdrawable creation until the drawable - * is actually bound to a context... */ - - __GLXdisplayPrivate *const priv = __glXInitialize(dpy); - __GLXDRIdrawable *pdraw; - __GLXscreenConfigs *psc; - __GLcontextModes *modes; - - psc = &priv->screenConfigs[vis->screen]; - if (psc->driScreen == NULL) - break; - modes = _gl_context_modes_find_visual(psc->visuals, vis->visualid); - pdraw = psc->driScreen->createDrawable(psc, pixmap, req->glxpixmap, modes); - if (pdraw == NULL) { - fprintf(stderr, "failed to create pixmap\n"); - break; - } - - if (__glxHashInsert(psc->drawHash, req->glxpixmap, pdraw)) { - (*pdraw->destroyDrawable) (pdraw); - return None; /* FIXME: Check what we're supposed to do here... */ - } - } while (0); ++ do { ++ /* FIXME: Maybe delay __DRIdrawable creation until the drawable ++ * is actually bound to a context... */ ++ ++ __GLXdisplayPrivate *const priv = __glXInitialize(dpy); ++ __GLXDRIdrawable *pdraw; ++ __GLXscreenConfigs *psc; ++ __GLcontextModes *modes; ++ ++ psc = &priv->screenConfigs[vis->screen]; ++ if (psc->driScreen == NULL) ++ break; ++ modes = _gl_context_modes_find_visual(psc->visuals, vis->visualid); ++ pdraw = psc->driScreen->createDrawable(psc, pixmap, req->glxpixmap, modes); ++ if (pdraw == NULL) { ++ fprintf(stderr, "failed to create pixmap\n"); ++ break; ++ } ++ ++ if (__glxHashInsert(psc->drawHash, req->glxpixmap, pdraw)) { ++ (*pdraw->destroyDrawable) (pdraw); ++ return None; /* FIXME: Check what we're supposed to do here... */ ++ } ++ } while (0); + #endif + - return xid; + return xid; } /*