graw: fix logic error in pixel format selection
authorBrian Paul <brianp@vmware.com>
Thu, 20 Jan 2011 20:32:35 +0000 (13:32 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 20 Jan 2011 20:37:26 +0000 (13:37 -0700)
commit4ef955a12a526dcad388133b6dc8426a51054cdd
treee76e5fa219a1d7cef0d20bacef102a56979ad951
parent22eeb1b331767abb29d03be2f11cfe9d8626c440
graw: fix logic error in pixel format selection

The loop to choose a pixel format for the window was incrementing
'i' after we succeeded in creating the window so if we chose format[0]
for graw_create_window_and_screen() we were putting format[1] in
the pipe_resource template for creating the render target.

This only worked because of the order of the elements in the formats[]
array.

The graw_xlib.c code now properly compares the requested gallium pixel
format against the visual's color layout.

Update all the graw demos to fix the off-by-one-i error.
src/gallium/targets/graw-xlib/graw_xlib.c
src/gallium/tests/graw/clear.c
src/gallium/tests/graw/fs-test.c
src/gallium/tests/graw/gs-test.c
src/gallium/tests/graw/quad-tex.c
src/gallium/tests/graw/shader-leak.c
src/gallium/tests/graw/tri-gs.c
src/gallium/tests/graw/tri-instanced.c
src/gallium/tests/graw/tri.c
src/gallium/tests/graw/vs-test.c