diff options
author | Eric Anholt <eric@anholt.net> | 2008-08-21 08:37:08 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2008-08-21 08:37:08 -0700 |
commit | 6e01207dd195744ee97b2d33cfc634258572a13d (patch) | |
tree | 6e18cea257fcd4a49df7d800d58c05cda532666c | |
parent | 9449827cc9a6132c7dcf267ba84d41cd3147b734 (diff) |
Clean up gen-texsubimage: remove sleep in auto case, and use probe util func.
-rw-r--r-- | tests/texturing/gen-texsubimage.c | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/tests/texturing/gen-texsubimage.c b/tests/texturing/gen-texsubimage.c index e4f11d6c3..5626862ec 100644 --- a/tests/texturing/gen-texsubimage.c +++ b/tests/texturing/gen-texsubimage.c @@ -63,44 +63,14 @@ static void display_mipmaps(int start_x, int start_y) } } -/** - * Returns whether the pixel at the coordinates matches the referenced color. - * - * Only the RGB channels are considered. - */ -static GLboolean -probe_pixel(int x, int y, const GLfloat *color) -{ - GLfloat probe[4], delta[3]; - GLfloat dmax = 0; - int i; - - glReadPixels(x, y, 1, 1, GL_RGBA, GL_FLOAT, probe); - for (i = 0; i < 3; i++) { - delta[i] = probe[i] - color[i]; - - if (dmax < fabs(delta[i])) - dmax = fabs(delta[i]); - } - - if (dmax > .02) { - printf("Expected at (%d,%d): %f,%f,%f\n", - x, y, color[0], color[1], color[2]); - printf("Probed at (%d,%d): %f,%f,%f\n", - x, y, probe[0], probe[1], probe[2]); - return GL_FALSE; - } - - return GL_TRUE; -} - static GLboolean check_resulting_mipmaps(int x, int y, const GLfloat *color) { GLboolean pass = GL_TRUE; int i; for (i = 256; i > 4; i /= 2) { - pass = pass && probe_pixel(x + i / 2, y + i / 2, color); + pass = pass && piglit_probe_pixel_rgb(x + i / 2, y + i / 2, + color); x += i; } @@ -175,7 +145,6 @@ static void display() if (Automatic) printf("PIGLIT: {'result': '%s' }\n", pass ? "pass" : "fail"); - sleep(5); exit(pass ? 0 : 1); } } |