diff options
author | Brian Paul <[email protected]> | 2010-02-18 16:56:38 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-02-18 16:58:39 -0700 |
commit | 0c728030ed76d8b79876b8606cb0486bff96750c (patch) | |
tree | 4f9d42a12e19bb8829274e85be9060724b91be5e /src/mesa/state_tracker | |
parent | 86bf224cac4600ad4706ee101ced9e3f1a9886b4 (diff) |
st/mesa: added some bitmap debug code (disabled)
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_bitmap.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 25430bba77d..e029ea7ffce 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -536,9 +536,29 @@ reset_cache(struct st_context *st) st->bitmap.tex_format, 0, BITMAP_CACHE_WIDTH, BITMAP_CACHE_HEIGHT, 1, PIPE_TEXTURE_USAGE_SAMPLER); +} + +/** Print bitmap image to stdout (debug) */ +static void +print_cache(const struct bitmap_cache *cache) +{ + int i, j, k; + + for (i = 0; i < BITMAP_CACHE_HEIGHT; i++) { + k = BITMAP_CACHE_WIDTH * (BITMAP_CACHE_HEIGHT - i - 1); + for (j = 0; j < BITMAP_CACHE_WIDTH; j++) { + if (cache->buffer[k]) + printf("X"); + else + printf(" "); + k++; + } + printf("\n"); + } } + static void create_cache_trans(struct st_context *st) { @@ -588,6 +608,8 @@ st_flush_bitmap_cache(struct st_context *st) * So unmap and release the texture transfer before drawing. */ if (cache->trans) { + if (0) + print_cache(cache); screen->transfer_unmap(screen, cache->trans); cache->buffer = NULL; |