diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-08-10 11:15:33 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-08-10 11:15:33 -0600 |
commit | 0aa8b1643b6b32860a38285e886d60c6f38fccf5 (patch) | |
tree | 85735f3dcb67e31d532db4dd90c4ed8e72ee30f7 /src/mesa | |
parent | 3cc5b1645b6f04f546b8535ba46bb418b8199f49 (diff) |
added pipe_surface_unreference()
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/pipe/p_context.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h index 23961f4b8f..b5dd149603 100644 --- a/src/mesa/pipe/p_context.h +++ b/src/mesa/pipe/p_context.h @@ -248,6 +248,17 @@ pipe_surface_reference(struct pipe_surface **dst, struct pipe_surface *src) } } +static INLINE void +pipe_surface_unreference(struct pipe_surface **ps) +{ + assert(*ps); + (*ps)->refcount--; + if ((*ps)->refcount <= 0) { + /* XXX need a proper surface->free method */ + free(*ps); + } + *ps = NULL; +} #endif /* PIPE_CONTEXT_H */ |