summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-08-10 11:15:33 -0600
committerBrian <[email protected]>2007-08-10 11:15:33 -0600
commit0aa8b1643b6b32860a38285e886d60c6f38fccf5 (patch)
tree85735f3dcb67e31d532db4dd90c4ed8e72ee30f7
parent3cc5b1645b6f04f546b8535ba46bb418b8199f49 (diff)
added pipe_surface_unreference()
-rw-r--r--src/mesa/pipe/p_context.h11
1 files changed, 11 insertions, 0 deletions
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 */