From 0aa8b1643b6b32860a38285e886d60c6f38fccf5 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 10 Aug 2007 11:15:33 -0600 Subject: [PATCH] added pipe_surface_unreference() --- src/mesa/pipe/p_context.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h index 23961f4b8f5..b5dd149603c 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 */ -- 2.30.2