summaryrefslogtreecommitdiffstats
path: root/src/glx/x11/glxext.c
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2008-03-08 21:02:23 -0500
committerKristian Høgsberg <[email protected]>2008-03-08 21:02:23 -0500
commit20b9230ce1b96ca246850a8088caeffc3f391a0c (patch)
tree9259704d09a62cffedcd3bb8583f8b8325817f4a /src/glx/x11/glxext.c
parent92d2a78f8d2d56cfadb4cb5323adec32fe73e353 (diff)
Move DRI drawable creation into dri_glx.c.
Diffstat (limited to 'src/glx/x11/glxext.c')
-rw-r--r--src/glx/x11/glxext.c45
1 files changed, 6 insertions, 39 deletions
diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c
index 372dbfca657..2f3261801a6 100644
--- a/src/glx/x11/glxext.c
+++ b/src/glx/x11/glxext.c
@@ -1178,53 +1178,20 @@ static Bool SendMakeCurrentRequest(Display *dpy, CARD8 opcode,
#ifdef GLX_DIRECT_RENDERING
static __DRIdrawable *
-FetchDRIDrawable( Display *dpy, GLXDrawable drawable, GLXContext gc)
+FetchDRIDrawable(Display *dpy, GLXDrawable drawable, GLXContext gc)
{
__GLXdisplayPrivate * const priv = __glXInitialize(dpy);
- __GLXdrawable *pdraw;
- __GLXscreenConfigs *sc;
- drm_drawable_t hwDrawable;
- void *empty_attribute_list = NULL;
+ __GLXDRIdrawable *pdraw;
+ __GLXscreenConfigs *psc;
if (priv == NULL || priv->driDisplay == NULL)
return NULL;
- sc = &priv->screenConfigs[gc->screen];
- if (__glxHashLookup(sc->drawHash, drawable, (void *) &pdraw) == 0)
+ psc = &priv->screenConfigs[gc->screen];
+ if (__glxHashLookup(psc->drawHash, drawable, (void *) &pdraw) == 0)
return &pdraw->driDrawable;
- /* Allocate a new drawable */
- pdraw = Xmalloc(sizeof(*pdraw));
- if (!pdraw)
- return NULL;
-
- pdraw->drawable = drawable;
- pdraw->psc = sc;
-
- if (!XF86DRICreateDrawable(dpy, sc->scr, drawable, &hwDrawable))
- return NULL;
-
- /* Create a new drawable */
- pdraw->driDrawable.private =
- (*sc->__driScreen.createNewDrawable)(&sc->__driScreen,
- gc->mode,
- &pdraw->driDrawable,
- hwDrawable,
- GLX_WINDOW_BIT,
- empty_attribute_list);
-
- if (!pdraw->driDrawable.private) {
- XF86DRIDestroyDrawable(dpy, sc->scr, drawable);
- Xfree(pdraw);
- return NULL;
- }
-
- if (__glxHashInsert(sc->drawHash, drawable, pdraw)) {
- (*pdraw->driDrawable.destroyDrawable)(&pdraw->driDrawable);
- XF86DRIDestroyDrawable(dpy, sc->scr, drawable);
- Xfree(pdraw);
- return NULL;
- }
+ pdraw = psc->driScreen->createDrawable(psc, drawable, gc);
return &pdraw->driDrawable;
}