st/dri: Add support for surfaceless current contexts.

Tested with Wayland.
This commit is contained in:
Chia-I Wu
2010-11-10 01:38:41 +08:00
parent 3418f74a94
commit 5b6ec5a553
3 changed files with 7 additions and 2 deletions
@@ -178,7 +178,8 @@ dri_make_current(__DRIcontext * cPriv,
read->texture_stamp = driReadPriv->lastStamp - 1;
}
ctx->stapi->make_current(ctx->stapi, ctx->st, &draw->base, &read->base);
ctx->stapi->make_current(ctx->stapi, ctx->st,
(draw) ? &draw->base : NULL, (read) ? &read->base : NULL);
return GL_TRUE;
}
@@ -70,7 +70,8 @@ struct dri_drawable
static INLINE struct dri_drawable *
dri_drawable(__DRIdrawable * driDrawPriv)
{
return (struct dri_drawable *)driDrawPriv->driverPrivate;
return (struct dri_drawable *) (driDrawPriv)
? driDrawPriv->driverPrivate : NULL;
}
/***********************************************************************
@@ -231,6 +231,9 @@ dri_fill_st_visual(struct st_visual *stvis, struct dri_screen *screen,
{
memset(stvis, 0, sizeof(*stvis));
if (!mode)
return;
stvis->samples = mode->samples;
stvis->render_buffer = ST_ATTACHMENT_INVALID;