summaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe/p_inlines.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/include/pipe/p_inlines.h')
-rw-r--r--src/gallium/include/pipe/p_inlines.h31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/gallium/include/pipe/p_inlines.h b/src/gallium/include/pipe/p_inlines.h
index 8eb604e73f1..592c3c87c26 100644
--- a/src/gallium/include/pipe/p_inlines.h
+++ b/src/gallium/include/pipe/p_inlines.h
@@ -39,20 +39,6 @@ extern "C" {
#endif
-static INLINE void *
-pipe_surface_map(struct pipe_surface *surface)
-{
- return (char *)surface->winsys->buffer_map( surface->winsys, surface->buffer,
- PIPE_BUFFER_USAGE_CPU_WRITE |
- PIPE_BUFFER_USAGE_CPU_READ )
- + surface->offset;
-}
-
-static INLINE void
-pipe_surface_unmap(struct pipe_surface *surface)
-{
- surface->winsys->buffer_unmap( surface->winsys, surface->buffer );
-}
/**
* Set 'ptr' to point to 'surf' and update reference counting.
@@ -66,9 +52,20 @@ pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
if (surf)
surf->refcount++;
- if (*ptr /* && --(*ptr)->refcount == 0 */) {
- struct pipe_winsys *winsys = (*ptr)->winsys;
- winsys->surface_release(winsys, ptr);
+ if (*ptr) {
+
+ /* There are currently two sorts of surfaces... This needs to be
+ * fixed so that all surfaces are views into a texture.
+ */
+ if ((*ptr)->texture) {
+ struct pipe_screen *screen = (*ptr)->texture->screen;
+ screen->tex_surface_release( screen, ptr );
+ }
+ else {
+ struct pipe_winsys *winsys = (*ptr)->winsys;
+ winsys->surface_release(winsys, ptr);
+ }
+
assert(!*ptr);
}