diff options
author | Brian <[email protected]> | 2007-10-25 19:27:29 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-10-25 20:35:23 -0600 |
commit | f684120417c6b3ca9e7486ffeb24fe88e428834d (patch) | |
tree | c4e9a773294e968866e601a45032f6312dab7b79 /src/mesa/state_tracker | |
parent | 616112ea2e0eefea356be228bff8754ee955d8b3 (diff) |
Move region_alloc() and region_release() to pipe_winsys.
This allows regions to be allocated w/out a rendering context.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawpixels.c | 9 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_fbo.c | 8 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_mipmap_tree.c | 7 |
3 files changed, 15 insertions, 9 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index c4a954c43d2..5d8890e0225 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -47,6 +47,7 @@ #include "st_format.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" +#include "pipe/p_winsys.h" #include "pipe/tgsi/mesa/mesa_to_tgsi.h" #include "shader/prog_instruction.h" @@ -346,7 +347,8 @@ alloc_mipmap_tree(struct st_context *st, cpp = st_sizeof_format(pipeFormat); /* allocate texture region/storage */ - mt->region = st->pipe->region_alloc(st->pipe, cpp, width, height, flags); + mt->region = st->pipe->winsys->region_alloc(st->pipe->winsys, + cpp, width, height, flags); mt->target = PIPE_TEXTURE_2D; mt->internal_format = GL_RGBA; @@ -468,7 +470,7 @@ make_mipmap_tree(struct st_context *st, static void free_mipmap_tree(struct pipe_context *pipe, struct pipe_mipmap_tree *mt) { - pipe->region_release(pipe, &mt->region); + pipe->winsys->region_release(pipe->winsys, &mt->region); free(mt); } @@ -977,7 +979,8 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height, /* allocate texture region/storage */ - mt->region = pipe->region_alloc(pipe, cpp, width, height, flags); + mt->region = pipe->winsys->region_alloc(pipe->winsys, + cpp, width, height, flags); pitch = mt->region->pitch; /* map texture region */ diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 94e286feabe..f22132b3cf5 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -41,6 +41,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" +#include "pipe/p_winsys.h" #include "st_context.h" #include "st_cb_fbo.h" #include "st_cb_texture.h" @@ -95,10 +96,11 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, struct pipe_region *r = strb->surface->region; while (r->map) pipe->region_unmap(pipe, r); - pipe->region_release(pipe, &strb->surface->region); + pipe->winsys->region_release(pipe->winsys, &strb->surface->region); } - strb->surface->region = pipe->region_alloc(pipe, cpp, width, height, flags); + strb->surface->region = pipe->winsys->region_alloc(pipe->winsys, cpp, + width, height, flags); if (!strb->surface->region) return GL_FALSE; /* out of memory, try s/w buffer? */ @@ -125,7 +127,7 @@ st_renderbuffer_delete(struct gl_renderbuffer *rb) ASSERT(strb); if (strb && strb->surface) { if (strb->surface->region) { - pipe->region_release(pipe, &strb->surface->region); + pipe->winsys->region_release(pipe->winsys, &strb->surface->region); } free(strb->surface); } diff --git a/src/mesa/state_tracker/st_mipmap_tree.c b/src/mesa/state_tracker/st_mipmap_tree.c index faca148d805..d1db590bee4 100644 --- a/src/mesa/state_tracker/st_mipmap_tree.c +++ b/src/mesa/state_tracker/st_mipmap_tree.c @@ -31,6 +31,7 @@ #include "pipe/p_state.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" +#include "pipe/p_winsys.h" #define DBG if(0) printf @@ -87,8 +88,8 @@ st_miptree_create(struct pipe_context *pipe, ok = pipe->mipmap_tree_layout(pipe, mt); if (ok) { /* note: it's OK to pass 'pitch' as 'width' here: */ - mt->region = pipe->region_alloc(pipe, mt->cpp, mt->pitch, - mt->total_height, flags); + mt->region = pipe->winsys->region_alloc(pipe->winsys, mt->cpp, mt->pitch, + mt->total_height, flags); mt->pitch = mt->region->pitch; /*XXX NEW */ } @@ -124,7 +125,7 @@ st_miptree_release(struct pipe_context *pipe, DBG("%s deleting %p\n", __FUNCTION__, (void *) *mt); - pipe->region_release(pipe, &((*mt)->region)); + pipe->winsys->region_release(pipe->winsys, &((*mt)->region)); for (i = 0; i < MAX_TEXTURE_LEVELS; i++) if ((*mt)->level[i].image_offset) |