From e4f6f0ec02133e9297c3f2db787dee14bf0ae6e1 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 26 Oct 2007 10:45:42 -0600 Subject: surface_alloc() is now a winsys function. This allows surfaces to be allocated without a rendering context. A few loose ends to resolve, but in working condition. --- src/mesa/drivers/x11/xm_winsys.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/mesa/drivers/x11/xm_winsys.c') diff --git a/src/mesa/drivers/x11/xm_winsys.c b/src/mesa/drivers/x11/xm_winsys.c index 624d28dd01..36805437f0 100644 --- a/src/mesa/drivers/x11/xm_winsys.c +++ b/src/mesa/drivers/x11/xm_winsys.c @@ -289,6 +289,31 @@ xm_region_release(struct pipe_winsys *winsys, struct pipe_region **region) } +/** + * Called via pipe->surface_alloc() to create new surfaces (textures, + * renderbuffers, etc. + */ +static struct pipe_surface * +xm_surface_alloc(struct pipe_winsys *ws, GLuint pipeFormat) +{ + struct xmesa_surface *xms = CALLOC_STRUCT(xmesa_surface); + + assert(ws); + assert(pipeFormat); + + xms->surface.format = pipeFormat; + xms->surface.refcount = 1; +#if 0 + /* + * This is really just a softpipe surface, not an XImage/Pixmap surface. + */ + softpipe_init_surface_funcs(&xms->surface); +#endif + return &xms->surface; +} + + + struct xmesa_pipe_winsys { @@ -320,6 +345,8 @@ xmesa_create_pipe_winsys( XMesaContext xmesa ) xws->winsys.region_alloc = xm_region_alloc; xws->winsys.region_release = xm_region_release; + xws->winsys.surface_alloc = xm_surface_alloc; + xws->winsys.flush_frontbuffer = xm_flush_frontbuffer; xws->winsys.wait_idle = xm_wait_idle; xws->winsys.printf = xm_printf; -- cgit v1.2.3