aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_cb_bitmap.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-10-15 16:50:35 +0200
committermarha <marha@users.sourceforge.net>2012-10-15 16:50:35 +0200
commit54db46582aba2252d544fa3956522f9ef06b49cb (patch)
treee3692fa2c3864c2bd13089d80bbaccb86b5d4825 /mesalib/src/mesa/state_tracker/st_cb_bitmap.c
parent8223fb176264123c86c0d3eb845973d00fd62cc2 (diff)
downloadvcxsrv-54db46582aba2252d544fa3956522f9ef06b49cb.tar.gz
vcxsrv-54db46582aba2252d544fa3956522f9ef06b49cb.tar.bz2
vcxsrv-54db46582aba2252d544fa3956522f9ef06b49cb.zip
xserver mesa pixman git update 15 oct 2012
xserver: a69429a17bf4630f6e26f61630a1c2b287202627 pixman: d5f2f39319fc358cccda60abe0bc927bd27131c1 mesa: 4004620d34a580c8fdb965d9b640e97453fc8b28
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_cb_bitmap.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_bitmap.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_bitmap.c b/mesalib/src/mesa/state_tracker/st_cb_bitmap.c
index 62e571235..b024ef0db 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_bitmap.c
@@ -306,11 +306,9 @@ make_bitmap_texture(struct gl_context *ctx, GLsizei width, GLsizei height,
return NULL;
}
- transfer = pipe_get_transfer(st->pipe, pt, 0, 0,
- PIPE_TRANSFER_WRITE,
- 0, 0, width, height);
-
- dest = pipe_transfer_map(pipe, transfer);
+ dest = pipe_transfer_map(st->pipe, pt, 0, 0,
+ PIPE_TRANSFER_WRITE,
+ 0, 0, width, height, &transfer);
/* Put image into texture transfer */
memset(dest, 0xff, height * transfer->stride);
@@ -321,8 +319,6 @@ make_bitmap_texture(struct gl_context *ctx, GLsizei width, GLsizei height,
/* Release transfer */
pipe_transfer_unmap(pipe, transfer);
- pipe->transfer_destroy(pipe, transfer);
-
return pt;
}
@@ -555,7 +551,6 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
static void
reset_cache(struct st_context *st)
{
- struct pipe_context *pipe = st->pipe;
struct bitmap_cache *cache = st->bitmap.cache;
/*memset(cache->buffer, 0xff, sizeof(cache->buffer));*/
@@ -566,11 +561,6 @@ reset_cache(struct st_context *st)
cache->ymin = 1000000;
cache->ymax = -1000000;
- if (cache->trans) {
- pipe->transfer_destroy(pipe, cache->trans);
- cache->trans = NULL;
- }
-
assert(!cache->texture);
/* allocate a new texture */
@@ -617,11 +607,10 @@ create_cache_trans(struct st_context *st)
/* Map the texture transfer.
* Subsequent glBitmap calls will write into the texture image.
*/
- cache->trans = pipe_get_transfer(st->pipe, cache->texture, 0, 0,
- PIPE_TRANSFER_WRITE, 0, 0,
- BITMAP_CACHE_WIDTH,
- BITMAP_CACHE_HEIGHT);
- cache->buffer = pipe_transfer_map(pipe, cache->trans);
+ cache->buffer = pipe_transfer_map(pipe, cache->texture, 0, 0,
+ PIPE_TRANSFER_WRITE, 0, 0,
+ BITMAP_CACHE_WIDTH,
+ BITMAP_CACHE_HEIGHT, &cache->trans);
/* init image to all 0xff */
memset(cache->buffer, 0xff, cache->trans->stride * BITMAP_CACHE_HEIGHT);
@@ -651,13 +640,11 @@ st_flush_bitmap_cache(struct st_context *st)
/* The texture transfer has been mapped until now.
* So unmap and release the texture transfer before drawing.
*/
- if (cache->trans) {
+ if (cache->trans && cache->buffer) {
if (0)
print_cache(cache);
pipe_transfer_unmap(pipe, cache->trans);
cache->buffer = NULL;
-
- pipe->transfer_destroy(pipe, cache->trans);
cache->trans = NULL;
}
@@ -873,9 +860,8 @@ st_destroy_bitmap(struct st_context *st)
}
if (cache) {
- if (cache->trans) {
+ if (cache->trans && cache->buffer) {
pipe_transfer_unmap(pipe, cache->trans);
- pipe->transfer_destroy(pipe, cache->trans);
}
pipe_resource_reference(&st->bitmap.cache->texture, NULL);
free(st->bitmap.cache);