diff options
author | Ben Skeggs <[email protected]> | 2008-06-29 12:16:13 +1000 |
---|---|---|
committer | Ben Skeggs <[email protected]> | 2008-06-29 12:16:13 +1000 |
commit | 01de2293d5449ab6ca1d99b007c9ea4f0037fef5 (patch) | |
tree | 8560aab576c3d8504f8d7935ab6fcd46ea35182e /src/gallium/winsys/gdi/wmesa.c | |
parent | b831aa06dc0d099185bcaa180683ad10942feaa0 (diff) | |
parent | 9d94d133b019ef23ee03cc691fcb5602451604ae (diff) |
Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/gallium/winsys/gdi/wmesa.c')
-rw-r--r-- | src/gallium/winsys/gdi/wmesa.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/winsys/gdi/wmesa.c b/src/gallium/winsys/gdi/wmesa.c index 0b93f8c4c32..86b085ab841 100644 --- a/src/gallium/winsys/gdi/wmesa.c +++ b/src/gallium/winsys/gdi/wmesa.c @@ -477,13 +477,15 @@ wm_surface_alloc_storage(struct pipe_winsys *winsys, surf->width = width; surf->height = height; surf->format = format; - surf->cpp = pf_get_size(format); - surf->pitch = round_up(width, alignment / surf->cpp); + pf_get_block(format, &surf->block); + surf->nblocksx = pf_get_nblocksx(&surf->block, width); + surf->nblocksy = pf_get_nblocksy(&surf->block, height); + surf->stride = round_up(surf->nblocksx * surf->block.size, alignment); assert(!surf->buffer); surf->buffer = winsys->buffer_create(winsys, alignment, PIPE_BUFFER_USAGE_PIXEL, - surf->pitch * surf->cpp * height); + surf->nblocksy * surf->stride); if(!surf->buffer) return -1; |