summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_fbo.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/state_tracker/st_cb_fbo.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/state_tracker/st_cb_fbo.c')
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 43681b7f8a..6b9023c410 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -109,22 +109,22 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
width, flags);
}
- /* free old region */
- if (strb->surface->region) {
- /* loop here since mapping is refcounted */
- struct pipe_region *r = strb->surface->region;
- while (r->map)
- pipe->region_unmap(pipe, r);
- pipe->winsys->region_release(pipe->winsys, &strb->surface->region);
- }
-
- strb->surface->region = pipe->winsys->region_alloc(pipe->winsys,
- strb->surface->pitch *
- cpp * height, flags);
- if (!strb->surface->region)
+ /* loop here since mapping is refcounted */
+ while (strb->surface->map)
+ pipe_surface_unmap(strb->surface);
+ if (strb->surface->buffer)
+ pipe->winsys->buffer_reference(pipe->winsys, &strb->surface->buffer,
+ NULL);
+
+ strb->surface->buffer = pipe->winsys->buffer_create(pipe->winsys, flags);
+ if (!strb->surface->buffer)
return GL_FALSE; /* out of memory, try s/w buffer? */
- ASSERT(strb->surface->region->buffer);
+ pipe->winsys->buffer_data(pipe->winsys, strb->surface->buffer,
+ strb->surface->pitch * cpp * height, NULL,
+ PIPE_BUFFER_USAGE_PIXEL);
+
+ ASSERT(strb->surface->buffer);
ASSERT(strb->surface->format);
strb->Base.Width = strb->surface->width = width;