aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-09-29 03:18:37 +0200
committerMarek Olšák <maraeo@gmail.com>2010-09-30 19:12:37 +0200
commitb2b14896a354bc570fc5ce7d8473726d5cc8de6f (patch)
treef74b18d38cd343c5527d041b484bd25271cd22d4
parent6c67f31b147380698ad8bbd76de66aa654c61cda (diff)
general tests: use piglit_probe_rect_* when appropriate
-rw-r--r--tests/general/dlist-clear.c17
-rw-r--r--tests/general/read-front.c15
-rw-r--r--tests/general/scissor-clear.c17
-rw-r--r--tests/general/scissor-depth-clear.c17
-rw-r--r--tests/general/scissor-many.c6
-rw-r--r--tests/general/scissor-stencil-clear.c17
-rw-r--r--tests/general/stencil-drawpixels.c22
7 files changed, 36 insertions, 75 deletions
diff --git a/tests/general/dlist-clear.c b/tests/general/dlist-clear.c
index b6b152a7..0174aa61 100644
--- a/tests/general/dlist-clear.c
+++ b/tests/general/dlist-clear.c
@@ -41,7 +41,6 @@ enum piglit_result
piglit_display(void)
{
GLboolean pass = GL_TRUE;
- int x, y;
static float red[] = {1.0, 0.0, 0.0, 0.0};
static float green[] = {0.0, 1.0, 0.0, 0.0};
static float blue[] = {0.0, 0.0, 1.0, 0.0};
@@ -77,18 +76,14 @@ piglit_display(void)
glCallList(1);
- for (y = 0; y < piglit_height; y++) {
- for (x = 0; x < piglit_width; x++) {
- float *expected;
+ pass &= piglit_probe_rect_rgb(0, 0, piglit_width, 10, green);
- if (x >= 30 && x < 40 && y >= 10 && y < 20)
- expected = blue;
- else
- expected = green;
+ pass &= piglit_probe_rect_rgb(0, 10, 30, 10, green);
+ pass &= piglit_probe_rect_rgb(30, 10, 10, 10, blue);
+ pass &= piglit_probe_rect_rgb(40, 10, piglit_width-40, 10, green);
- pass &= piglit_probe_pixel_rgb(x, y, expected);
- }
- }
+ pass &= piglit_probe_rect_rgb(0, 20, piglit_width, piglit_height - 20,
+ green);
glutSwapBuffers();
diff --git a/tests/general/read-front.c b/tests/general/read-front.c
index 3f602dc8..182d70c4 100644
--- a/tests/general/read-front.c
+++ b/tests/general/read-front.c
@@ -44,7 +44,6 @@ enum piglit_result
piglit_display(void)
{
GLboolean pass = GL_TRUE;
- int x, y;
static float red[] = {1.0, 0.0, 0.0, 0.0};
static float green[] = {0.0, 1.0, 0.0, 0.0};
@@ -57,18 +56,8 @@ piglit_display(void)
glutSwapBuffers();
- for (y = 0; y < piglit_height; y++) {
- for (x = 0; x < piglit_width; x++) {
- float *expected;
-
- if (x >= piglit_width / 2)
- expected = green;
- else
- expected = red;
-
- pass &= piglit_probe_pixel_rgb(x, y, expected);
- }
- }
+ pass &= piglit_probe_rect_rgb(0, 0, piglit_width/2, piglit_height, red);
+ pass &= piglit_probe_rect_rgb(piglit_width/2, 0, piglit_width/2, piglit_height, green);
glReadBuffer(GL_BACK);
diff --git a/tests/general/scissor-clear.c b/tests/general/scissor-clear.c
index 9d53aebe..8ada18fe 100644
--- a/tests/general/scissor-clear.c
+++ b/tests/general/scissor-clear.c
@@ -39,7 +39,6 @@ enum piglit_result
piglit_display(void)
{
GLboolean pass = GL_TRUE;
- int x, y;
static float green[] = {0.0, 1.0, 0.0, 0.0};
static float blue[] = {0.0, 0.0, 1.0, 0.0};
@@ -53,18 +52,14 @@ piglit_display(void)
glClearColor(0.0, 0.0, 1.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
- for (y = 0; y < piglit_height; y++) {
- for (x = 0; x < piglit_width; x++) {
- float *expected;
+ pass &= piglit_probe_rect_rgb(0, 0, piglit_width, 10, green);
- if (x >= 10 && x < 20 && y >= 10 && y < 20)
- expected = blue;
- else
- expected = green;
+ pass &= piglit_probe_rect_rgb(0, 10, 10, 10, green);
+ pass &= piglit_probe_rect_rgb(10, 10, 10, 10, blue);
+ pass &= piglit_probe_rect_rgb(20, 10, piglit_width-20, 10, green);
- pass &= piglit_probe_pixel_rgb(x, y, expected);
- }
- }
+ pass &= piglit_probe_rect_rgb(0, 20, piglit_width, piglit_height - 20,
+ green);
glutSwapBuffers();
diff --git a/tests/general/scissor-depth-clear.c b/tests/general/scissor-depth-clear.c
index a0622632..8d0166e2 100644
--- a/tests/general/scissor-depth-clear.c
+++ b/tests/general/scissor-depth-clear.c
@@ -39,7 +39,6 @@ enum piglit_result
piglit_display(void)
{
GLboolean pass = GL_TRUE;
- int x, y;
static float green[] = {0.0, 1.0, 0.0, 0.0};
static float blue[] = {0.0, 0.0, 1.0, 0.0};
@@ -71,18 +70,14 @@ piglit_display(void)
glColor4fv(blue);
piglit_draw_rect(0, 0, piglit_width, piglit_height);
- for (y = 0; y < piglit_height; y++) {
- for (x = 0; x < piglit_width; x++) {
- float *expected;
+ pass &= piglit_probe_rect_rgb(0, 0, piglit_width, 10, green);
- if (x >= 10 && x < 20 && y >= 10 && y < 20)
- expected = blue;
- else
- expected = green;
+ pass &= piglit_probe_rect_rgb(0, 10, 10, 10, green);
+ pass &= piglit_probe_rect_rgb(10, 10, 10, 10, blue);
+ pass &= piglit_probe_rect_rgb(20, 10, piglit_width-20, 10, green);
- pass &= piglit_probe_pixel_rgb(x, y, expected);
- }
- }
+ pass &= piglit_probe_rect_rgb(0, 20, piglit_width, piglit_height - 20,
+ green);
glutSwapBuffers();
diff --git a/tests/general/scissor-many.c b/tests/general/scissor-many.c
index d8995396..94ba890e 100644
--- a/tests/general/scissor-many.c
+++ b/tests/general/scissor-many.c
@@ -57,11 +57,7 @@ piglit_display(void)
}
}
- for (y = 0; y < piglit_height; y++) {
- for (x = 0; x < piglit_width; x++) {
- pass &= piglit_probe_pixel_rgb(x, y, green);
- }
- }
+ pass &= piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height, green);
glutSwapBuffers();
diff --git a/tests/general/scissor-stencil-clear.c b/tests/general/scissor-stencil-clear.c
index aa96ee71..7027f769 100644
--- a/tests/general/scissor-stencil-clear.c
+++ b/tests/general/scissor-stencil-clear.c
@@ -39,7 +39,6 @@ enum piglit_result
piglit_display(void)
{
GLboolean pass = GL_TRUE;
- int x, y;
static float red[] = {1.0, 0.0, 0.0, 0.0};
static float green[] = {0.0, 1.0, 0.0, 0.0};
static float blue[] = {0.0, 0.0, 1.0, 0.0};
@@ -82,18 +81,14 @@ piglit_display(void)
glColor4fv(red);
piglit_draw_rect(0, 0, piglit_width, piglit_height);
- for (y = 0; y < piglit_height; y++) {
- for (x = 0; x < piglit_width; x++) {
- float *expected;
+ pass &= piglit_probe_rect_rgb(0, 0, piglit_width, 10, green);
- if (x >= 10 && x < 20 && y >= 10 && y < 20)
- expected = blue;
- else
- expected = green;
+ pass &= piglit_probe_rect_rgb(0, 10, 10, 10, green);
+ pass &= piglit_probe_rect_rgb(10, 10, 10, 10, blue);
+ pass &= piglit_probe_rect_rgb(20, 10, piglit_width-20, 10, green);
- pass &= piglit_probe_pixel_rgb(x, y, expected);
- }
- }
+ pass &= piglit_probe_rect_rgb(0, 20, piglit_width, piglit_height - 20,
+ green);
glutSwapBuffers();
diff --git a/tests/general/stencil-drawpixels.c b/tests/general/stencil-drawpixels.c
index 1d8d2103..f8fcd97c 100644
--- a/tests/general/stencil-drawpixels.c
+++ b/tests/general/stencil-drawpixels.c
@@ -39,7 +39,7 @@ enum piglit_result
piglit_display(void)
{
GLboolean pass = GL_TRUE;
- int x, y, i;
+ int i;
static float red[] = {1.0, 0.0, 0.0, 0.0};
static float green[] = {0.0, 1.0, 0.0, 0.0};
static float blue[] = {0.0, 0.0, 1.0, 0.0};
@@ -86,20 +86,16 @@ piglit_display(void)
assert(glGetError() == 0);
- for (y = 0; y < piglit_height; y++) {
- for (x = 0; x < piglit_width; x++) {
- float *expected;
+ pass &= piglit_probe_rect_rgb(0, 0, piglit_width, 10, red);
- if (x >= 10 && x < 20 && y >= 10 && y < 20)
- expected = green;
- else if (x >= 30 && x < 40 && y >= 10 && y < 20)
- expected = blue;
- else
- expected = red;
+ pass &= piglit_probe_rect_rgb(0, 10, 10, 10, red);
+ pass &= piglit_probe_rect_rgb(10, 10, 10, 10, green);
+ pass &= piglit_probe_rect_rgb(20, 10, 10, 10, red);
+ pass &= piglit_probe_rect_rgb(30, 10, 10, 10, blue);
+ pass &= piglit_probe_rect_rgb(40, 10, piglit_width-40, 10, red);
- pass &= piglit_probe_pixel_rgb(x, y, expected);
- }
- }
+ pass &= piglit_probe_rect_rgb(0, 20, piglit_width, piglit_height - 20,
+ red);
glutSwapBuffers();