[Piglit] [PATCH 07/16] Unify piglit_escape_exit_key between GL and GLES

Josh Triplett josh at joshtriplett.org
Thu Jul 3 12:38:04 PDT 2014


Signed-off-by: Josh Triplett <josh at joshtriplett.org>
---
 tests/util/piglit-util-gl-common.c | 14 ++++++++++++++
 tests/util/piglit-util-gl.c        | 13 -------------
 tests/util/piglit-util-gles.c      | 12 ------------
 3 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/tests/util/piglit-util-gl-common.c b/tests/util/piglit-util-gl-common.c
index 9f778c5..3a31e42 100644
--- a/tests/util/piglit-util-gl-common.c
+++ b/tests/util/piglit-util-gl-common.c
@@ -520,6 +520,20 @@ piglit_compressed_pixel_offset(GLenum format, unsigned width,
 	return offset;
 }
 
+void
+piglit_escape_exit_key(unsigned char key, int x, int y)
+{
+	(void) x;
+	(void) y;
+	switch (key) {
+		case 27:
+			exit(0);
+			break;
+	}
+	if (!piglit_is_gles())
+		piglit_post_redisplay();
+}
+
 /**
  * Convenience function to configure an abitrary orthogonal projection matrix
  */
diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index 7c3414c..df81a63 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -416,19 +416,6 @@ GLuint piglit_compile_program(GLenum target, const char* text)
 	return program;
 }
 
-void
-piglit_escape_exit_key(unsigned char key, int x, int y)
-{
-	(void) x;
-	(void) y;
-	switch (key) {
-		case 27:
-			exit(0);
-			break;
-	}
-	piglit_post_redisplay();
-}
-
 /**
  * Convenience function to draw a triangle.
  */
diff --git a/tests/util/piglit-util-gles.c b/tests/util/piglit-util-gles.c
index 7eef8e2..f6d6555 100644
--- a/tests/util/piglit-util-gles.c
+++ b/tests/util/piglit-util-gles.c
@@ -35,18 +35,6 @@
 
 #include "piglit-util-gl-common.h"
 
-void
-piglit_escape_exit_key(unsigned char key, int x, int y)
-{
-	(void) x;
-	(void) y;
-	switch (key) {
-		case 27:
-			exit(0);
-			break;
-	}
-}
-
 /**
  * Generates a texture with the given internalFormat, w, h with a
  * teximage of r, g, b w quadrants.
-- 
2.0.1



More information about the Piglit mailing list