[Piglit] [PATCH 06/23] tests, util: Wrap glutReshapeFunc with piglit_set_reshape_func

Chad Versace chad.versace at linux.intel.com
Fri Sep 28 10:44:52 PDT 2012


I'm trying to transition Piglit from using GLUT to using Waffle. This
requires killing all uses of GLUT functions, one-by-one.

One remaining test called glutReshapeFunc directly: texline.  This patch
replace that call with a new wrapper, piglit_set_reshape_func.

Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 tests/mesa/tests/texline.c    | 2 +-
 tests/util/piglit-framework.c | 7 +++++++
 tests/util/piglit-framework.h | 1 +
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/mesa/tests/texline.c b/tests/mesa/tests/texline.c
index 3389d72..0883201 100644
--- a/tests/mesa/tests/texline.c
+++ b/tests/mesa/tests/texline.c
@@ -165,7 +165,7 @@ piglit_init(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	glutReshapeFunc(Reshape);
+	piglit_set_reshape_func(Reshape);
 
 	for (u = 0; u < 2; u++) {
 		char filename[256];
diff --git a/tests/util/piglit-framework.c b/tests/util/piglit-framework.c
index e8999f4..03a5125 100644
--- a/tests/util/piglit-framework.c
+++ b/tests/util/piglit-framework.c
@@ -163,3 +163,10 @@ piglit_swap_buffers(void)
 	else
 		piglit_framework_glut_swap_buffers();
 }
+
+void
+piglit_set_reshape_func(void (*func)(int w, int h))
+{
+	if (!piglit_use_fbo && !piglit_automatic)
+		glutReshapeFunc(func);
+}
diff --git a/tests/util/piglit-framework.h b/tests/util/piglit-framework.h
index 325d00d..f93fcba 100644
--- a/tests/util/piglit-framework.h
+++ b/tests/util/piglit-framework.h
@@ -132,5 +132,6 @@ void piglit_swap_buffers(void);
 extern void piglit_present_results();
 void piglit_post_redisplay(void);
 void piglit_set_keyboard_func(void (*func)(unsigned char key, int x, int y));
+void piglit_set_reshape_func(void (*func)(int w, int h));
 
 #endif /* PIGLIT_FRAMEWORK_H */
-- 
1.7.12.1



More information about the Piglit mailing list