summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Versace <chad.versace@intel.com>2011-02-25 13:16:20 -0800
committerChad Versace <chad.versace@intel.com>2011-02-25 20:44:12 -0800
commit45b8f9d076c08438e1b3ed0496af57f5c2775403 (patch)
tree286e72cc811cf7223a56b8da6a156694c9481c73
parent3d906b5f02ce28c89b61a6b88a2fc53a3a995530 (diff)
util: Remove near-duplicate files
Kill 375 lines of code. "One of my most productive days was throwing away 1000 lines of code." -- Ken Thompson Signed-off-by: Chad Versace <chad.versace@intel.com>
-rw-r--r--tests/util/piglit-egl-gl-framework.c100
-rw-r--r--tests/util/piglit-egl-gl-framework.h31
-rw-r--r--tests/util/piglit-egl-gles2-framework.c100
-rw-r--r--tests/util/piglit-egl-gles2-framework.h31
-rw-r--r--tests/util/piglit-gles2-util.c4
-rw-r--r--tests/util/piglit-gles2-util.h113
6 files changed, 3 insertions, 376 deletions
diff --git a/tests/util/piglit-egl-gl-framework.c b/tests/util/piglit-egl-gl-framework.c
deleted file mode 100644
index 2ca3ce948..000000000
--- a/tests/util/piglit-egl-gl-framework.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-/**
- * Simple test case framework for runing desktop OpenGL through EGL.
- *
- * \author Shuang He <shuang.he@intel.com>
- */
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-
-#include "piglit-gles2-util.h"
-#include "piglit-egl-gl-framework.h"
-#include "glut_egl.h"
-
-int piglit_automatic = 0;
-static int piglit_window;
-static enum piglit_result result;
-
-static void
-display(void)
-{
- result = piglit_display();
-
- if (piglit_automatic) {
- glutDestroyWindow(piglit_window);
- piglit_report_result(result);
- }
-}
-
-static void
-reshape(int w, int h)
-{
- piglit_width = w;
- piglit_height = h;
-
- glViewport(0, 0, w, h);
-}
-
-int main(int argc, char *argv[])
-{
- int j;
-
- glutInit(&argc, argv);
-
- /* Find/remove "-auto" from the argument vector.
- */
- for (j = 1; j < argc; j++) {
- if (!strcmp(argv[j], "-auto")) {
- int i;
-
- piglit_automatic = 1;
-
- for (i = j + 1; i < argc; i++) {
- argv[i - 1] = argv[i];
- }
- argc--;
- j--;
- }
- }
- glutInitDisplayMode(piglit_window_mode);
- glutInitWindowSize(piglit_width, piglit_height);
- glut_eglInitAPIMask(GLUT_EGL_OPENGL_BIT);
- glutCreateWindow(argv[0]);
-
- glutDisplayFunc(display);
- glutReshapeFunc(reshape);
- glutKeyboardFunc((GLUT_EGLkeyboardCB)piglit_escape_exit_key);
-
- piglit_init(argc, argv);
-
- glutMainLoop();
-
- piglit_report_result(result);
- /* UNREACHED */
- return 0;
-}
diff --git a/tests/util/piglit-egl-gl-framework.h b/tests/util/piglit-egl-gl-framework.h
deleted file mode 100644
index c3bdde945..000000000
--- a/tests/util/piglit-egl-gl-framework.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright © 2009 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-extern int piglit_automatic;
-
-extern int piglit_window_mode;
-extern int piglit_width;
-extern int piglit_height;
-
-extern enum piglit_result piglit_display(void);
-extern void piglit_init(int argc, char **argv);
diff --git a/tests/util/piglit-egl-gles2-framework.c b/tests/util/piglit-egl-gles2-framework.c
deleted file mode 100644
index 32fa60534..000000000
--- a/tests/util/piglit-egl-gles2-framework.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-/**
- * Simple test case framework for running OpenGL ES 2.0 through EGL.
- *
- * \author Shuang He <shuang.he@intel.com>
- */
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-
-#include "piglit-gles2-util.h"
-#include "piglit-egl-gles2-framework.h"
-#include "glut_egl.h"
-
-int piglit_automatic = 0;
-static int piglit_window;
-static enum piglit_result result;
-
-static void
-display(void)
-{
- result = piglit_display();
-
- if (piglit_automatic) {
- glutDestroyWindow(piglit_window);
- piglit_report_result(result);
- }
-}
-
-static void
-reshape(int w, int h)
-{
- piglit_width = w;
- piglit_height = h;
-
- glViewport(0, 0, w, h);
-}
-
-int main(int argc, char *argv[])
-{
- int j;
-
- glutInit(&argc, argv);
-
- /* Find/remove "-auto" from the argument vector.
- */
- for (j = 1; j < argc; j++) {
- if (!strcmp(argv[j], "-auto")) {
- int i;
-
- piglit_automatic = 1;
-
- for (i = j + 1; i < argc; i++) {
- argv[i - 1] = argv[i];
- }
- argc--;
- j--;
- }
- }
- glutInitDisplayMode(piglit_window_mode);
- glutInitWindowSize(piglit_width, piglit_height);
- glut_eglInitAPIMask(GLUT_EGL_OPENGL_ES2_BIT);
- glutCreateWindow(argv[0]);
-
- glutDisplayFunc(display);
- glutReshapeFunc(reshape);
- glutKeyboardFunc((GLUT_EGLkeyboardCB)piglit_escape_exit_key);
-
- piglit_init(argc, argv);
-
- glutMainLoop();
-
- piglit_report_result(result);
- /* UNREACHED */
- return 0;
-}
diff --git a/tests/util/piglit-egl-gles2-framework.h b/tests/util/piglit-egl-gles2-framework.h
deleted file mode 100644
index c3bdde945..000000000
--- a/tests/util/piglit-egl-gles2-framework.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright © 2009 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-extern int piglit_automatic;
-
-extern int piglit_window_mode;
-extern int piglit_width;
-extern int piglit_height;
-
-extern enum piglit_result piglit_display(void);
-extern void piglit_init(int argc, char **argv);
diff --git a/tests/util/piglit-gles2-util.c b/tests/util/piglit-gles2-util.c
index f95615ca0..f7de255ed 100644
--- a/tests/util/piglit-gles2-util.c
+++ b/tests/util/piglit-gles2-util.c
@@ -33,8 +33,10 @@
#include <errno.h>
#include <sys/stat.h>
-#include "piglit-gles2-util.h"
+#include "piglit-util.h"
+static const GLint PIGLIT_ATTRIB_POS = 0;
+static const GLint PIGLIT_ATTRIB_TEX = 1;
int
piglit_extension_supported(const char *name)
diff --git a/tests/util/piglit-gles2-util.h b/tests/util/piglit-gles2-util.h
deleted file mode 100644
index 2bbb0ef78..000000000
--- a/tests/util/piglit-gles2-util.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) The Piglit project 2007
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#if defined(_MSC_VER)
-#include <windows.h>
-
-typedef __int32 int32_t;
-typedef __int64 int64_t;
-typedef unsigned __int8 uint8_t;
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int64 uint64_t;
-#define bool BOOL
-#define true 1
-#define false 0
-#else
-#include <stdbool.h>
-#include <stdint.h>
-#endif
-
-#include "glut_egl.h"
-#include <ctype.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GLES2/gl2.h>
-
-#if defined(_MSC_VER)
-
-#define snprintf sprintf_s
-
-#define piglit_get_proc_address(x) wglGetProcAddress(x)
-#else
-#define piglit_get_proc_address(x) glutGetProcAddress(x)
-#endif
-
-enum piglit_result {
- PIGLIT_SUCCESS,
- PIGLIT_FAILURE,
- PIGLIT_SKIP,
- PIGLIT_WARN
-};
-
-enum pigilt_attrib_location {
- PIGLIT_ATTRIB_POS,
- PIGLIT_ATTRIB_TEX
-};
-
-
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
-
-extern const uint8_t fdo_bitmap[];
-extern const unsigned int fdo_bitmap_width;
-extern const unsigned int fdo_bitmap_height;
-
-int FindLine(const char *program, int position);
-void piglit_report_result(enum piglit_result result);
-void piglit_require_extension(const char *name);
-void piglit_require_not_extension(const char *name);
-int piglit_probe_pixel_rgb(int x, int y, const float* expected);
-int piglit_probe_pixel_rgba(int x, int y, const float* expected);
-int piglit_probe_rect_rgb(int x, int y, int w, int h, const float* expected);
-int piglit_probe_rect_rgba(int x, int y, int w, int h, const float* expected);
-
-GLuint piglit_compile_shader(GLenum target, char *filename);
-GLuint piglit_compile_shader_text(GLenum target, const char *text);
-GLboolean piglit_link_check_status(GLint prog);
-GLint piglit_link_simple_program(GLint vs, GLint fs);
-GLvoid piglit_draw_rect(float x, float y, float w, float h);
-GLvoid piglit_draw_rect_back(float x, float y, float w, float h);
-GLvoid piglit_draw_rect_z(float z, float x, float y, float w, float h);
-GLvoid piglit_draw_rect_tex(float x, float y, float w, float h,
- float tx, float ty, float tw, float th);
-void piglit_escape_exit_key(unsigned char key, int x, int y);
-
-char *piglit_load_text_file(const char *file_name, unsigned *size);
-
-GLuint piglit_checkerboard_texture(GLuint tex, unsigned level,
- unsigned width, unsigned height,
- unsigned horiz_square_size, unsigned vert_square_size,
- const float *black, const float *white);
-GLuint piglit_rgbw_texture(GLenum format, int w, int h, GLboolean mip,
- GLboolean alpha);
-void piglit_set_tolerance_for_bits(int rbits, int gbits, int bbits, int abits);
-
-extern GLfloat cube_face_texcoords[6][4][3];
-extern const char *cube_face_names[6];
-extern const GLenum cube_face_targets[6];
-
-#ifndef HAVE_STRCHRNUL
-char *strchrnul(const char *s, int c);
-#endif