Merge branch 'mesa_7_5_branch'
authorMichel Dänzer <daenzer@vmware.com>
Sun, 30 Aug 2009 11:06:18 +0000 (13:06 +0200)
committerMichel Dänzer <michel@daenzer.net>
Sun, 30 Aug 2009 11:06:18 +0000 (13:06 +0200)
Conflicts:
src/glx/x11/glxcmds.c

1  2 
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;
  }
  
  /*