gallium: Add destroy callback to all *_winsys interfaces.

For consistency and to simplify these objects' destruction.
This commit is contained in:
José Fonseca
2008-08-08 12:23:21 +01:00
parent be36f7869e
commit 9dcb956a06
9 changed files with 32 additions and 0 deletions

View File

@@ -132,6 +132,11 @@ cell_is_format_supported( struct pipe_screen *screen,
static void
cell_destroy_screen( struct pipe_screen *screen )
{
struct pipe_winsys *winsys = screen->winsys;
if(winsys->destroy)
winsys->destroy(winsys);
FREE(screen);
}

View File

@@ -44,6 +44,9 @@ static void i915_destroy( struct pipe_context *pipe )
struct i915_context *i915 = i915_context( pipe );
draw_destroy( i915->draw );
if(i915->winsys)
i915->winsys->destroy(i915->winsys);
FREE( i915 );
}

View File

@@ -193,6 +193,11 @@ i915_is_format_supported( struct pipe_screen *screen,
static void
i915_destroy_screen( struct pipe_screen *screen )
{
struct pipe_winsys *winsys = screen->winsys;
if(winsys->destroy)
winsys->destroy(winsys);
FREE(screen);
}

View File

@@ -75,6 +75,8 @@ struct pipe_screen;
*/
struct i915_winsys {
void (*destroy)( struct i915_winsys *sws );
/**
* Get the current batch buffer from the winsys.
*/

View File

@@ -52,6 +52,9 @@ static void brw_destroy(struct pipe_context *pipe)
{
struct brw_context *brw = brw_context(pipe);
if(brw->winsys->destroy)
brw->winsys->destroy(brw->winsys);
FREE(brw);
}

View File

@@ -206,6 +206,11 @@ brw_is_format_supported( struct pipe_screen *screen,
static void
brw_destroy_screen( struct pipe_screen *screen )
{
struct pipe_winsys *winsys = screen->winsys;
if(winsys->destroy)
winsys->destroy(winsys);
FREE(screen);
}

View File

@@ -112,6 +112,8 @@ enum brw_cache_id {
*/
struct brw_winsys {
void (*destroy)(struct brw_winsys *);
/**
* Reserve space on batch buffer.
*

View File

@@ -139,6 +139,11 @@ softpipe_is_format_supported( struct pipe_screen *screen,
static void
softpipe_destroy_screen( struct pipe_screen *screen )
{
struct pipe_winsys *winsys = screen->winsys;
if(winsys->destroy)
winsys->destroy(winsys);
FREE(screen);
}

View File

@@ -62,6 +62,8 @@ struct pipe_surface;
*/
struct pipe_winsys
{
void (*destroy)( struct pipe_winsys *ws );
/** Returns name of this winsys interface */
const char *(*get_name)( struct pipe_winsys *ws );