p_inlines.h File Reference

Include dependency graph for p_inlines.h:

Go to the source code of this file.

Functions

static void * pipe_surface_map (struct pipe_surface *surf, unsigned flags)
static void pipe_surface_unmap (struct pipe_surface *surf)
static void pipe_surface_reference (struct pipe_surface **ptr, struct pipe_surface *surf)
 Set 'ptr' to point to 'surf' and update reference counting.
static void winsys_buffer_reference (struct pipe_winsys *winsys, struct pipe_buffer **ptr, struct pipe_buffer *buf)
static void pipe_texture_reference (struct pipe_texture **ptr, struct pipe_texture *pt)
 
See also:
pipe_surface_reference

static void pipe_texture_release (struct pipe_texture **ptr)
static struct pipe_bufferpipe_buffer_create (struct pipe_screen *screen, unsigned alignment, unsigned usage, unsigned size)
 Convenience wrappers for winsys buffer functions.
static struct pipe_bufferpipe_user_buffer_create (struct pipe_screen *screen, void *ptr, unsigned size)
static void pipe_buffer_destroy (struct pipe_screen *screen, struct pipe_buffer *buf)
static void * pipe_buffer_map (struct pipe_screen *screen, struct pipe_buffer *buf, unsigned usage)
static void pipe_buffer_unmap (struct pipe_screen *screen, struct pipe_buffer *buf)
static void pipe_buffer_reference (struct pipe_screen *screen, struct pipe_buffer **ptr, struct pipe_buffer *buf)


Function Documentation

static struct pipe_buffer* pipe_buffer_create ( struct pipe_screen screen,
unsigned  alignment,
unsigned  usage,
unsigned  size 
) [static, read]

Convenience wrappers for winsys buffer functions.

Definition at line 167 of file p_inlines.h.

References pipe_winsys::buffer_create, and pipe_screen::winsys.

00169 {
00170    return screen->winsys->buffer_create(screen->winsys, alignment, usage, size);
00171 }

static void pipe_buffer_destroy ( struct pipe_screen screen,
struct pipe_buffer buf 
) [static]

Definition at line 180 of file p_inlines.h.

References pipe_winsys::buffer_destroy, and pipe_screen::winsys.

00181 {
00182    screen->winsys->buffer_destroy(screen->winsys, buf);
00183 }

static void* pipe_buffer_map ( struct pipe_screen screen,
struct pipe_buffer buf,
unsigned  usage 
) [static]

Definition at line 186 of file p_inlines.h.

References pipe_winsys::buffer_map, and pipe_screen::winsys.

00189 {
00190    return screen->winsys->buffer_map(screen->winsys, buf, usage);
00191 }

static void pipe_buffer_reference ( struct pipe_screen screen,
struct pipe_buffer **  ptr,
struct pipe_buffer buf 
) [static]

Definition at line 204 of file p_inlines.h.

References pipe_screen::winsys, and winsys_buffer_reference().

00207 {
00208    winsys_buffer_reference(screen->winsys, ptr, buf);
00209 }

static void pipe_buffer_unmap ( struct pipe_screen screen,
struct pipe_buffer buf 
) [static]

Definition at line 194 of file p_inlines.h.

References pipe_winsys::buffer_unmap, and pipe_screen::winsys.

00196 {
00197    screen->winsys->buffer_unmap(screen->winsys, buf);
00198 }

static void* pipe_surface_map ( struct pipe_surface surf,
unsigned  flags 
) [static]

Definition at line 46 of file p_inlines.h.

References pipe_surface::buffer, pipe_winsys::buffer_map, pipe_surface::offset, pipe_texture::screen, pipe_screen::surface_map, pipe_surface::texture, and pipe_surface::winsys.

00047 {
00048    if (surf->texture) {
00049       struct pipe_screen *screen = surf->texture->screen;
00050       return surf->texture->screen->surface_map( screen, surf, flags );
00051    }
00052    else {
00053       struct pipe_winsys *winsys = surf->winsys;
00054       char *map = (char *)winsys->buffer_map( winsys, surf->buffer, flags );
00055       if (map == NULL)
00056          return NULL;
00057       return (void *)(map + surf->offset);
00058    }
00059 }

static void pipe_surface_reference ( struct pipe_surface **  ptr,
struct pipe_surface surf 
) [static]

Set 'ptr' to point to 'surf' and update reference counting.

The old thing pointed to, if any, will be unreferenced first. 'surf' may be NULL.

Definition at line 82 of file p_inlines.h.

References assert, pipe_surface::refcount, pipe_winsys::surface_release, and pipe_screen::tex_surface_release.

00083 {
00084    /* bump the refcount first */
00085    if (surf) 
00086       surf->refcount++;
00087 
00088    if (*ptr) {
00089 
00090       /* There are currently two sorts of surfaces... This needs to be
00091        * fixed so that all surfaces are views into a texture.
00092        */
00093       if ((*ptr)->texture) {
00094          struct pipe_screen *screen = (*ptr)->texture->screen;
00095          screen->tex_surface_release( screen, ptr );
00096       }
00097       else {
00098          struct pipe_winsys *winsys = (*ptr)->winsys;
00099          winsys->surface_release(winsys, ptr);
00100       }
00101 
00102       assert(!*ptr);
00103    }
00104 
00105    *ptr = surf;
00106 }

static void pipe_surface_unmap ( struct pipe_surface surf  )  [static]

Definition at line 62 of file p_inlines.h.

References pipe_surface::buffer, pipe_winsys::buffer_unmap, pipe_texture::screen, pipe_screen::surface_unmap, pipe_surface::texture, and pipe_surface::winsys.

00063 {
00064    if (surf->texture) {
00065       struct pipe_screen *screen = surf->texture->screen;
00066       surf->texture->screen->surface_unmap( screen, surf );
00067    }
00068    else {
00069       struct pipe_winsys *winsys = surf->winsys;
00070       winsys->buffer_unmap( winsys, surf->buffer );
00071    }
00072 }

static void pipe_texture_reference ( struct pipe_texture **  ptr,
struct pipe_texture pt 
) [static]

See also:
pipe_surface_reference

Definition at line 131 of file p_inlines.h.

References assert, pipe_texture::refcount, and pipe_screen::texture_release.

00133 {
00134    assert(ptr);
00135 
00136    if (pt) 
00137       pt->refcount++;
00138 
00139    if (*ptr) {
00140       struct pipe_screen *screen = (*ptr)->screen;
00141       assert(screen);
00142       screen->texture_release(screen, ptr);
00143 
00144       assert(!*ptr);
00145    }
00146 
00147    *ptr = pt;
00148 }

static void pipe_texture_release ( struct pipe_texture **  ptr  )  [static]

Definition at line 152 of file p_inlines.h.

References assert, and pipe_screen::texture_release.

00153 {
00154    struct pipe_screen *screen;
00155    assert(ptr);
00156    screen = (*ptr)->screen;
00157    screen->texture_release(screen, ptr);
00158    *ptr = NULL;
00159 }

static struct pipe_buffer* pipe_user_buffer_create ( struct pipe_screen screen,
void *  ptr,
unsigned  size 
) [static, read]

Definition at line 174 of file p_inlines.h.

References pipe_winsys::user_buffer_create, and pipe_screen::winsys.

00175 {
00176    return screen->winsys->user_buffer_create(screen->winsys, ptr, size);
00177 }

static void winsys_buffer_reference ( struct pipe_winsys winsys,
struct pipe_buffer **  ptr,
struct pipe_buffer buf 
) [static]

Definition at line 112 of file p_inlines.h.

References pipe_winsys::buffer_destroy, and pipe_buffer::refcount.

00115 {
00116    if (buf) 
00117       buf->refcount++;
00118 
00119    if (*ptr && --(*ptr)->refcount == 0)
00120       winsys->buffer_destroy( winsys, *ptr );
00121 
00122    *ptr = buf;
00123 }


Generated on Tue Sep 29 06:25:44 2009 for Gallium3D by  doxygen 1.5.4