Drawable drawable;
Window root;
- Status stat;
unsigned uw, uh, bw, depth;
drawable = pdraw->xDrawable;
- stat = XGetGeometry(dpy, drawable, &root,
- x, y, &uw, &uh, &bw, &depth);
+ XGetGeometry(dpy, drawable, &root, x, y, &uw, &uh, &bw, &depth);
*w = uw;
*h = uh;
}
if (context->extensions)
XFree((char *) context->extensions);
- GarbageCollectDRIDrawables(context->psc);
-
(*psc->core->destroyContext) (pcp->driContext);
Xfree(pcp);
struct drisw_screen *psc = (struct drisw_screen *) pcp->base.psc;
(*psc->core->unbindContext) (pcp->driContext);
+
+ driReleaseDrawables(&pcp->base);
}
static const struct glx_context_vtable drisw_context_vtable = {
}
static void
-driDestroyDrawable(__GLXDRIdrawable * pdraw)
+driswDestroyDrawable(__GLXDRIdrawable * pdraw)
{
struct drisw_drawable *pdp = (struct drisw_drawable *) pdraw;
struct drisw_screen *psc = (struct drisw_screen *) pdp->base.psc;
}
static __GLXDRIdrawable *
-driCreateDrawable(struct glx_screen *base, XID xDrawable,
- GLXDrawable drawable, struct glx_config *modes)
+driswCreateDrawable(struct glx_screen *base, XID xDrawable,
+ GLXDrawable drawable, struct glx_config *modes)
{
struct drisw_drawable *pdp;
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes;
return NULL;
}
- pdp->base.destroyDrawable = driDestroyDrawable;
+ pdp->base.destroyDrawable = driswDestroyDrawable;
return &pdp->base;
}
static int64_t
-driSwapBuffers(__GLXDRIdrawable * pdraw,
- int64_t target_msc, int64_t divisor, int64_t remainder)
+driswSwapBuffers(__GLXDRIdrawable * pdraw,
+ int64_t target_msc, int64_t divisor, int64_t remainder)
{
struct drisw_drawable *pdp = (struct drisw_drawable *) pdraw;
struct drisw_screen *psc = (struct drisw_screen *) pdp->base.psc;
}
static void
-driDestroyScreen(struct glx_screen *base)
+driswDestroyScreen(struct glx_screen *base)
{
struct drisw_screen *psc = (struct drisw_screen *) base;
};
static struct glx_screen *
-driCreateScreen(int screen, struct glx_display *priv)
+driswCreateScreen(int screen, struct glx_display *priv)
{
__GLXDRIscreen *psp;
const __DRIconfig **driver_configs;
return NULL;
memset(psc, 0, sizeof *psc);
- if (!glx_screen_init(&psc->base, screen, priv))
- return NULL;
+ if (!glx_screen_init(&psc->base, screen, priv)) {
+ Xfree(psc);
+ return NULL;
+ }
psc->driver = driOpenSwrast();
if (psc->driver == NULL)
psc->base.vtable = &drisw_screen_vtable;
psp = &psc->vtable;
psc->base.driScreen = psp;
- psp->destroyScreen = driDestroyScreen;
- psp->createDrawable = driCreateDrawable;
- psp->swapBuffers = driSwapBuffers;
+ psp->destroyScreen = driswDestroyScreen;
+ psp->createDrawable = driswCreateDrawable;
+ psp->swapBuffers = driswSwapBuffers;
return &psc->base;
handle_error:
if (psc->driver)
dlclose(psc->driver);
+ glx_screen_cleanup(&psc->base);
Xfree(psc);
ErrorMessageF("reverting to indirect rendering\n");
/* Called from __glXFreeDisplayPrivate.
*/
static void
-driDestroyDisplay(__GLXDRIdisplay * dpy)
+driswDestroyDisplay(__GLXDRIdisplay * dpy)
{
Xfree(dpy);
}
if (pdpyp == NULL)
return NULL;
- pdpyp->base.destroyDisplay = driDestroyDisplay;
- pdpyp->base.createScreen = driCreateScreen;
+ pdpyp->base.destroyDisplay = driswDestroyDisplay;
+ pdpyp->base.createScreen = driswCreateScreen;
return &pdpyp->base;
}