gallium: Add destroy callback to all *_winsys interfaces.
For consistency and to simplify these objects' destruction.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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 );
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -75,6 +75,8 @@ struct pipe_screen;
|
||||
*/
|
||||
struct i915_winsys {
|
||||
|
||||
void (*destroy)( struct i915_winsys *sws );
|
||||
|
||||
/**
|
||||
* Get the current batch buffer from the winsys.
|
||||
*/
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -112,6 +112,8 @@ enum brw_cache_id {
|
||||
*/
|
||||
struct brw_winsys {
|
||||
|
||||
void (*destroy)(struct brw_winsys *);
|
||||
|
||||
/**
|
||||
* Reserve space on batch buffer.
|
||||
*
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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 );
|
||||
|
||||
|
Reference in New Issue
Block a user