summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/xlib/xm_winsys.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-12-07 12:30:35 +0100
committerMichel Dänzer <michel@tungstengraphics.com>2007-12-07 12:30:35 +0100
commitb859cdf6f191b4d8b56537c8dc30082a7e2d94b3 (patch)
tree4bd3149cc81a2fb6434282a70b34361f94710cfd /src/mesa/pipe/xlib/xm_winsys.c
parent987d59bb83e9e08192563e5f1b52949c5511053c (diff)
Eliminate struct pipe_region.
Directly use struct pipe_buffer_handle for storage and struct pipe_surface for (un)mapping.
Diffstat (limited to 'src/mesa/pipe/xlib/xm_winsys.c')
-rw-r--r--src/mesa/pipe/xlib/xm_winsys.c50
1 files changed, 3 insertions, 47 deletions
diff --git a/src/mesa/pipe/xlib/xm_winsys.c b/src/mesa/pipe/xlib/xm_winsys.c
index 99816a811d..295174d4bb 100644
--- a/src/mesa/pipe/xlib/xm_winsys.c
+++ b/src/mesa/pipe/xlib/xm_winsys.c
@@ -186,7 +186,7 @@ xm_get_name(struct pipe_winsys *pws)
static struct pipe_buffer_handle *
-xm_buffer_create(struct pipe_winsys *pws, unsigned alignment)
+xm_buffer_create(struct pipe_winsys *pws, unsigned flags)
{
struct xm_buffer *buffer = CALLOC_STRUCT(xm_buffer);
buffer->refcount = 1;
@@ -228,47 +228,6 @@ xm_surface_pitch(struct pipe_winsys *winsys, unsigned cpp, unsigned width,
}
-static struct pipe_region *
-xm_region_alloc(struct pipe_winsys *winsys, unsigned size, unsigned flags)
-{
- struct pipe_region *region = CALLOC_STRUCT(pipe_region);
- const unsigned alignment = 64;
-
- region->refcount = 1;
-
- assert(size > 0);
-
- region->buffer = winsys->buffer_create( winsys, alignment );
-
- /* NULL data --> just allocate the space */
- winsys->buffer_data( winsys,
- region->buffer,
- size,
- NULL,
- PIPE_BUFFER_USAGE_PIXEL );
- return region;
-}
-
-
-static void
-xm_region_release(struct pipe_winsys *winsys, struct pipe_region **region)
-{
- if (!*region)
- return;
-
- assert((*region)->refcount > 0);
- (*region)->refcount--;
-
- if ((*region)->refcount == 0) {
- assert((*region)->map_refcount == 0);
-
- winsys->buffer_reference( winsys, &((*region)->buffer), NULL );
- free(*region);
- }
- *region = NULL;
-}
-
-
/**
* Called via pipe->surface_alloc() to create new surfaces (textures,
* renderbuffers, etc.
@@ -301,8 +260,8 @@ xm_surface_release(struct pipe_winsys *winsys, struct pipe_surface **s)
struct pipe_surface *surf = *s;
surf->refcount--;
if (surf->refcount == 0) {
- if (surf->region)
- winsys->region_release(winsys, &surf->region);
+ if (surf->buffer)
+ winsys->buffer_reference(winsys, &surf->buffer, NULL);
free(surf);
}
*s = NULL;
@@ -335,9 +294,6 @@ xmesa_get_pipe_winsys(void)
ws->buffer_subdata = xm_buffer_subdata;
ws->buffer_get_subdata = xm_buffer_get_subdata;
- ws->region_alloc = xm_region_alloc;
- ws->region_release = xm_region_release;
-
ws->surface_pitch = xm_surface_pitch;
ws->surface_alloc = xm_surface_alloc;
ws->surface_release = xm_surface_release;