[v2,2/6] texturing: use piglit_draw_rect_tex instead of glBegin/glEnd

Submitted by Erik Faye-Lund on Oct. 26, 2018, 1:03 p.m.

Details

Message ID 20181026130308.12519-3-erik.faye-lund@collabora.com
State New
Headers show

Not browsing as part of any series.

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;
 	}
 }