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

This patch replaces all-but-one instance of glutPostRedisplay with a new
wrapper, piglit_post_redisplay. The sole remaining test that uses
glutPostRedisplay is windowoverlap; but that test doesn't use
piglit-framework, anyway.

Since piglit_escape_exit_key() calls piglit_post_redisplay() which is
defined in piglitutil_gl*, we must now link piglitutil_gl
into piglitglxutil to prevent link errors.

Signed-off-by: Chad Versace <chad.vers...@linux.intel.com>
---
 tests/general/texgen.c        | 2 +-
 tests/texturing/lodbias.c     | 2 +-
 tests/texturing/texdepth.c    | 2 +-
 tests/util/CMakeLists.gl.txt  | 3 +++
 tests/util/piglit-framework.c | 7 +++++++
 tests/util/piglit-framework.h | 1 +
 tests/util/piglit-util-gl.c   | 2 +-
 7 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/tests/general/texgen.c b/tests/general/texgen.c
index 5543833..7ba5d74 100644
--- a/tests/general/texgen.c
+++ b/tests/general/texgen.c
@@ -204,7 +204,7 @@ static void Key(unsigned char key, int x, int y)
                exit(0);
                break;
        }
-       glutPostRedisplay();
+       piglit_post_redisplay();
 }
 
 void piglit_init(int argc, char *argv[])
diff --git a/tests/texturing/lodbias.c b/tests/texturing/lodbias.c
index bc13e4e..838c075 100644
--- a/tests/texturing/lodbias.c
+++ b/tests/texturing/lodbias.c
@@ -289,7 +289,7 @@ static void Key(unsigned char key, int x, int y)
                break;
        }
        printf("Current LOD bias: 1st tex: %i  2nd tex: %i\n", CurrentBias, 
CurrentBias2);
-       glutPostRedisplay();
+       piglit_post_redisplay();
 }
 
 void
diff --git a/tests/texturing/texdepth.c b/tests/texturing/texdepth.c
index a655ef0..9111b35 100644
--- a/tests/texturing/texdepth.c
+++ b/tests/texturing/texdepth.c
@@ -365,7 +365,7 @@ static void Key(unsigned char key, int x, int y)
                exit(0);
                break;
        }
-       glutPostRedisplay();
+       piglit_post_redisplay();
 }
 
 void
diff --git a/tests/util/CMakeLists.gl.txt b/tests/util/CMakeLists.gl.txt
index 02c6d3a..2cd4ecd 100644
--- a/tests/util/CMakeLists.gl.txt
+++ b/tests/util/CMakeLists.gl.txt
@@ -37,6 +37,9 @@ IF(BUILD_GLX_TESTS)
                    piglit-dispatch.c
                    piglit-dispatch-init.c
        )
+       target_link_libraries(piglitglxutil
+               piglitutil_${piglit_target_api}
+               )
        set (UTIL_GL_SOURCES
                ${UTIL_GL_SOURCES}
                piglit-glx-util.c
diff --git a/tests/util/piglit-framework.c b/tests/util/piglit-framework.c
index 301226c..d252452 100644
--- a/tests/util/piglit-framework.c
+++ b/tests/util/piglit-framework.c
@@ -140,3 +140,10 @@ piglit_gl_test_run(int argc, char *argv[],
 
        assert(false);
 }
+
+void
+piglit_post_redisplay(void)
+{
+       if (!piglit_use_fbo && !piglit_automatic)
+               glutPostRedisplay();
+}
diff --git a/tests/util/piglit-framework.h b/tests/util/piglit-framework.h
index e1a2a98..d11e04f 100644
--- a/tests/util/piglit-framework.h
+++ b/tests/util/piglit-framework.h
@@ -129,5 +129,6 @@ extern bool piglit_use_fbo;
 extern unsigned int piglit_winsys_fbo;
 
 extern void piglit_present_results();
+void piglit_post_redisplay(void);
 
 #endif /* PIGLIT_FRAMEWORK_H */
diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index cfdf3fd..8d96238 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -798,7 +798,7 @@ piglit_escape_exit_key(unsigned char key, int x, int y)
                        exit(0);
                        break;
        }
-       glutPostRedisplay();
+       piglit_post_redisplay();
 }
 
 /**
-- 
1.7.12.1

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to