Commit d2e7ef44 authored by Kenneth Moreland's avatar Kenneth Moreland
Browse files

Change BlankTiles test to check for corrected background color.

parent d4260b94
...@@ -75,8 +75,8 @@ static int BlankTilesDoTest(void) ...@@ -75,8 +75,8 @@ static int BlankTilesDoTest(void)
if (rank == 0) { if (rank == 0) {
/* printrank("Rank == 0, tile should have stuff in it.\n"); */ /* printrank("Rank == 0, tile should have stuff in it.\n"); */
} else if (rank < tile_dim*tile_dim) { } else if (rank < tile_dim*tile_dim) {
IceTUByte *cb; IceTFloat *cb;
int pixel; int color_component;
if ( (my_width != icetImageGetWidth(image)) if ( (my_width != icetImageGetWidth(image))
|| (my_height != icetImageGetHeight(image)) ) { || (my_height != icetImageGetHeight(image)) ) {
...@@ -85,9 +85,11 @@ static int BlankTilesDoTest(void) ...@@ -85,9 +85,11 @@ static int BlankTilesDoTest(void)
} }
/* printrank("Checking returned image data.\n"); */ /* printrank("Checking returned image data.\n"); */
cb = icetImageGetColorub(image); cb = icetImageGetColorf(image);
for (pixel = 0; pixel < my_width*my_height*4; pixel++) { for (color_component = 0;
if (cb[pixel] != 0) { color_component < my_width*my_height*4;
color_component++) {
if (cb[color_component] != 0.25f) {
printrank("Found bad pixel!!!!!!!!\n"); printrank("Found bad pixel!!!!!!!!\n");
result = TEST_FAILED; result = TEST_FAILED;
break; break;
...@@ -106,13 +108,19 @@ static int BlankTilesRun() ...@@ -106,13 +108,19 @@ static int BlankTilesRun()
int result = TEST_PASSED; int result = TEST_PASSED;
int strategy_index; int strategy_index;
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClearColor(0.25f, 0.25f, 0.25f, 0.25f);
icetGLDrawCallback(draw); icetGLDrawCallback(draw);
icetBoundingBoxd(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5); icetBoundingBoxd(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5);
icetSetColorFormat(ICET_IMAGE_COLOR_RGBA_UBYTE); /* Turn on blending and colored background collection. Even though in
icetSetDepthFormat(ICET_IMAGE_DEPTH_FLOAT); general this would not work unless you also ordered the compositing, we
just want to make sure we get the right color in empty tiles for this
test. */
icetSetColorFormat(ICET_IMAGE_COLOR_RGBA_FLOAT);
icetSetDepthFormat(ICET_IMAGE_DEPTH_NONE);
icetCompositeMode(ICET_COMPOSITE_MODE_BLEND);
icetEnable(ICET_CORRECT_COLORED_BACKGROUND);
for (strategy_index = 0; for (strategy_index = 0;
strategy_index < STRATEGY_LIST_SIZE; strategy_index++) { strategy_index < STRATEGY_LIST_SIZE; strategy_index++) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment