summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-11-07 08:05:09 -0700
committerBrian <brian.paul@tungstengraphics.com>2007-11-07 08:24:58 -0700
commit7d1a04e499564212a2a9aace12b05f424a357d3f (patch)
treef0b12d8c0d7916d0dbedfb3adad3d1d786455024 /src/mesa/state_tracker
parent52236661653169140d07a500facd65185b6b3666 (diff)
Add winsys->surface_release() to complement winsys->surface_alloc().
pipe_surface now has a pointer to the winsys which create/owns the surface. This allows clean surface deallocation w/out a rendering context.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 7c18f380cd..0d23f7eec4 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -129,19 +129,10 @@ static void
st_renderbuffer_delete(struct gl_renderbuffer *rb)
{
struct st_renderbuffer *strb = st_renderbuffer(rb);
- GET_CURRENT_CONTEXT(ctx);
- if (ctx) {
- struct pipe_context *pipe = ctx->st->pipe;
- ASSERT(strb);
- if (strb && strb->surface) {
- if (strb->surface->region) {
- pipe->winsys->region_release(pipe->winsys, &strb->surface->region);
- }
- free(strb->surface);
- }
- }
- else {
- _mesa_warning(NULL, "st_renderbuffer_delete() called, but no current context");
+ ASSERT(strb);
+ if (strb->surface) {
+ struct pipe_winsys *ws = strb->surface->winsys;
+ ws->surface_release(ws, &strb->surface);
}
free(strb);
}