summaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe/p_inlines.h
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-01-20 12:22:49 +0000
committerJosé Fonseca <[email protected]>2009-01-20 12:22:49 +0000
commit5897383344da3320d158c26adae05de35480471f (patch)
tree33519f45f1309b273e4b5a92d5c06dd171b29191 /src/gallium/include/pipe/p_inlines.h
parentecc563b17f810399ddf74a68fca1e903ba49a0d6 (diff)
gallium: Remove the standalone surfaces.
This commit is mostly just a cosmetic change that cleans-up the interfaces, replacing pipe_winsys::surface_* calls by /** * Allocate storage for a display target surface. * * Often surfaces which are meant to be blitted to the front screen (i.e., * display targets) must be allocated with special characteristics, memory * pools, or obtained directly from the windowing system. * * This callback is invoked by the pipe_screenwhen creating a texture marked * with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET flag to get the underlying * buffer storage. */ struct pipe_buffer *(*surface_buffer_create)(struct pipe_winsys *ws, unsigned width, unsigned height, enum pipe_format format, unsigned usage, unsigned *stride); Most drivers were updated but not all were tested. Use the softpipe pipe driver and the xlib winsys changes as a reference when fixing other drivers.
Diffstat (limited to 'src/gallium/include/pipe/p_inlines.h')
-rw-r--r--src/gallium/include/pipe/p_inlines.h44
1 files changed, 12 insertions, 32 deletions
diff --git a/src/gallium/include/pipe/p_inlines.h b/src/gallium/include/pipe/p_inlines.h
index 5e79b7f485a..73783926169 100644
--- a/src/gallium/include/pipe/p_inlines.h
+++ b/src/gallium/include/pipe/p_inlines.h
@@ -45,30 +45,19 @@ extern "C" {
static INLINE void *
pipe_surface_map( struct pipe_surface *surf, unsigned flags )
{
- if (surf->texture) {
- struct pipe_screen *screen = surf->texture->screen;
- return surf->texture->screen->surface_map( screen, surf, flags );
- }
- else {
- struct pipe_winsys *winsys = surf->winsys;
- char *map = (char *)winsys->buffer_map( winsys, surf->buffer, flags );
- if (map == NULL)
- return NULL;
- return (void *)(map + surf->offset);
- }
+ struct pipe_screen *screen;
+ assert(surf->texture);
+ screen = surf->texture->screen;
+ return screen->surface_map( screen, surf, flags );
}
static INLINE void
pipe_surface_unmap( struct pipe_surface *surf )
{
- if (surf->texture) {
- struct pipe_screen *screen = surf->texture->screen;
- surf->texture->screen->surface_unmap( screen, surf );
- }
- else {
- struct pipe_winsys *winsys = surf->winsys;
- winsys->buffer_unmap( winsys, surf->buffer );
- }
+ struct pipe_screen *screen;
+ assert(surf->texture);
+ screen = surf->texture->screen;
+ screen->surface_unmap( screen, surf );
}
@@ -88,20 +77,11 @@ pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
}
if (*ptr) {
+ struct pipe_screen *screen;
assert((*ptr)->refcount);
-
- /* 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)->texture);
+ screen = (*ptr)->texture->screen;
+ screen->tex_surface_release( screen, ptr );
assert(!*ptr);
}