Commit 6ff0ee80 authored by Chad Versace's avatar Chad Versace

tests,util: Wrap glutPostRedisplay with piglit_post_redisplay

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.
Acked-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Jordan Justen's avatarJordan Justen <jordan.l.justen@intel.com>
Tested-by: Paul Berry's avatarPaul Berry <stereotype441@gmail.com>
Signed-off-by: default avatarChad Versace <chad.versace@linux.intel.com>
parent 54a5e50c
...@@ -204,7 +204,7 @@ static void Key(unsigned char key, int x, int y) ...@@ -204,7 +204,7 @@ static void Key(unsigned char key, int x, int y)
exit(0); exit(0);
break; break;
} }
glutPostRedisplay(); piglit_post_redisplay();
} }
void piglit_init(int argc, char *argv[]) void piglit_init(int argc, char *argv[])
......
...@@ -289,7 +289,7 @@ static void Key(unsigned char key, int x, int y) ...@@ -289,7 +289,7 @@ static void Key(unsigned char key, int x, int y)
break; break;
} }
printf("Current LOD bias: 1st tex: %i 2nd tex: %i\n", CurrentBias, CurrentBias2); printf("Current LOD bias: 1st tex: %i 2nd tex: %i\n", CurrentBias, CurrentBias2);
glutPostRedisplay(); piglit_post_redisplay();
} }
void void
......
...@@ -365,7 +365,7 @@ static void Key(unsigned char key, int x, int y) ...@@ -365,7 +365,7 @@ static void Key(unsigned char key, int x, int y)
exit(0); exit(0);
break; break;
} }
glutPostRedisplay(); piglit_post_redisplay();
} }
void void
......
...@@ -37,6 +37,9 @@ IF(BUILD_GLX_TESTS) ...@@ -37,6 +37,9 @@ IF(BUILD_GLX_TESTS)
piglit-dispatch.c piglit-dispatch.c
piglit-dispatch-init.c piglit-dispatch-init.c
) )
target_link_libraries(piglitglxutil
piglitutil_${piglit_target_api}
)
set (UTIL_GL_SOURCES set (UTIL_GL_SOURCES
${UTIL_GL_SOURCES} ${UTIL_GL_SOURCES}
piglit-glx-util.c piglit-glx-util.c
......
...@@ -140,3 +140,10 @@ piglit_gl_test_run(int argc, char *argv[], ...@@ -140,3 +140,10 @@ piglit_gl_test_run(int argc, char *argv[],
assert(false); assert(false);
} }
void
piglit_post_redisplay(void)
{
if (!piglit_use_fbo && !piglit_automatic)
glutPostRedisplay();
}
...@@ -129,5 +129,6 @@ extern bool piglit_use_fbo; ...@@ -129,5 +129,6 @@ extern bool piglit_use_fbo;
extern unsigned int piglit_winsys_fbo; extern unsigned int piglit_winsys_fbo;
extern void piglit_present_results(); extern void piglit_present_results();
void piglit_post_redisplay(void);
#endif /* PIGLIT_FRAMEWORK_H */ #endif /* PIGLIT_FRAMEWORK_H */
...@@ -798,7 +798,7 @@ piglit_escape_exit_key(unsigned char key, int x, int y) ...@@ -798,7 +798,7 @@ piglit_escape_exit_key(unsigned char key, int x, int y)
exit(0); exit(0);
break; break;
} }
glutPostRedisplay(); piglit_post_redisplay();
} }
/** /**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment