[Piglit] [PATCH 11/18] util: Refactor piglit-framework-fbo.c, move functions

Chad Versace chad.versace at linux.intel.com
Tue May 22 18:01:51 PDT 2012


Move the functions piglit_framework_fbo_{init,destroy} to the bottom of
the file. This will allow all GLX functions to reside in one #ifdef at the
top of the file, all the Waffle functions in an #ifdef below that, and the
platform-independent code at the bottom.

CC: Pauli Nieminen <pauli.nieminen at linux.intel.com>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 tests/util/piglit-framework-fbo.c |   35 ++++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 13 deletions(-)

diff --git a/tests/util/piglit-framework-fbo.c b/tests/util/piglit-framework-fbo.c
index eec58db..a4943a1 100644
--- a/tests/util/piglit-framework-fbo.c
+++ b/tests/util/piglit-framework-fbo.c
@@ -71,25 +71,13 @@ piglit_framework_fbo_glx_destroy()
 #endif
 }
 
-static void
-piglit_framework_fbo_destroy()
-{
-#ifdef USE_OPENGL
-	glDeleteFramebuffers(1, &piglit_winsys_fbo);
-#endif
-	piglit_winsys_fbo = 0;
-	piglit_framework_fbo_glx_destroy();
-}
-
 static bool
-piglit_framework_fbo_init()
+piglit_framework_fbo_gl_init()
 {
 #ifdef USE_GLX
 	GLuint tex, depth = 0;
 	GLenum status;
 
-	piglit_framework_fbo_glx_init();
-
 #ifdef USE_OPENGL
 	glewInit();
 
@@ -158,3 +146,24 @@ piglit_framework_fbo_init()
 	return false;
 #endif /* USE_GLX */
 }
+
+static bool
+piglit_framework_fbo_init(void)
+{
+#ifdef USE_GLX
+	piglit_framework_fbo_glx_init();
+#endif
+
+	return piglit_framework_fbo_gl_init();
+}
+
+static void
+piglit_framework_fbo_destroy(void)
+{
+#ifdef USE_OPENGL
+	glDeleteFramebuffers(1, &piglit_winsys_fbo);
+#endif
+
+	piglit_winsys_fbo = 0;
+	piglit_framework_fbo_glx_destroy();
+}
-- 
1.7.10.1



More information about the Piglit mailing list