[2/5] texturing: use piglit_draw_rect_tex instead of glBegin/glEnd

Submitted by Erik Faye-Lund on Oct. 24, 2018, 4:29 p.m.

Details

Message ID 20181024162948.27305-3-erik.faye-lund@collabora.com
State Accepted
Commit f653e12d1acffb82a64ec58e674f0d151998a210
Headers show
Series "port s3tc tests to gles2" ( rev: 1 ) in Piglit

Browsing this patch as part of:
"port s3tc tests to gles2" rev 1 in Piglit
<< prev patch [2/6] next patch >>

Commit Message

Erik Faye-Lund Oct. 24, 2018, 4:29 p.m.
This will make it easier to port these tests to gles2.
---
 tests/texturing/s3tc-teximage.c    | 9 ++-------
 tests/texturing/s3tc-texsubimage.c | 9 ++-------
 2 files changed, 4 insertions(+), 14 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/texturing/s3tc-teximage.c b/tests/texturing/s3tc-teximage.c
index a08feaa69..a7225f6f0 100644
--- a/tests/texturing/s3tc-teximage.c
+++ b/tests/texturing/s3tc-teximage.c
@@ -61,13 +61,8 @@  display_mipmaps(int start_x, int start_y)
 
 	/* Disply all the mipmap levels */
 	for (i = SIZE; i > 0; i /= 2) {
-		glBegin(GL_QUADS);
-		glTexCoord2f(0.0, 0.0); glVertex2f(start_x + 0, start_y + 0);
-		glTexCoord2f(1.0, 0.0); glVertex2f(start_x + i, start_y + 0);
-		glTexCoord2f(1.0, 1.0); glVertex2f(start_x + i, start_y + i);
-		glTexCoord2f(0.0, 1.0); glVertex2f(start_x + 0, start_y + i);
-		glEnd();
-
+		piglit_draw_rect_tex(start_x, start_y, i, i,
+		                     0.0f, 0.0f, 1.0f, 1.0f);
 		start_x += i + 5;
 	}
 }
diff --git a/tests/texturing/s3tc-texsubimage.c b/tests/texturing/s3tc-texsubimage.c
index 39b94938e..3e2260139 100644
--- a/tests/texturing/s3tc-texsubimage.c
+++ b/tests/texturing/s3tc-texsubimage.c
@@ -61,13 +61,8 @@  display_mipmaps(int start_x, int start_y)
 
 	/* Disply all the mipmap levels */
 	for (i = SIZE; i > 0; i /= 2) {
-		glBegin(GL_QUADS);
-		glTexCoord2f(0.0, 0.0); glVertex2f(start_x + 0, start_y + 0);
-		glTexCoord2f(1.0, 0.0); glVertex2f(start_x + i, start_y + 0);
-		glTexCoord2f(1.0, 1.0); glVertex2f(start_x + i, start_y + i);
-		glTexCoord2f(0.0, 1.0); glVertex2f(start_x + 0, start_y + i);
-		glEnd();
-
+		piglit_draw_rect_tex(start_x, start_y, i, i,
+		                     0.0f, 0.0f, 1.0f, 1.0f);
 		start_x += i + 5;
 	}
 }