diff options
Diffstat (limited to 'opengl/tests')
-rw-r--r-- | opengl/tests/EGLTest/Android.mk | 12 | ||||
-rw-r--r-- | opengl/tests/EGLTest/egl_cache_test.cpp | 8 | ||||
-rw-r--r-- | opengl/tests/angeles/app-linux.cpp | 2 | ||||
-rw-r--r-- | opengl/tests/fillrate/fillrate.cpp | 10 | ||||
-rw-r--r-- | opengl/tests/filter/filter.cpp | 9 | ||||
-rw-r--r-- | opengl/tests/hwc/Android.mk | 71 | ||||
-rw-r--r-- | opengl/tests/hwc/hwcColorEquiv.cpp | 3 | ||||
-rw-r--r-- | opengl/tests/hwc/hwcCommit.cpp | 1 | ||||
-rw-r--r-- | opengl/tests/hwc/hwcRects.cpp | 2 | ||||
-rw-r--r-- | opengl/tests/hwc/hwcTestLib.cpp | 19 | ||||
-rw-r--r-- | opengl/tests/lib/Android.mk | 7 | ||||
-rw-r--r-- | opengl/tests/linetex/linetex.cpp | 6 |
12 files changed, 59 insertions, 91 deletions
diff --git a/opengl/tests/EGLTest/Android.mk b/opengl/tests/EGLTest/Android.mk index f37efec..80e4867 100644 --- a/opengl/tests/EGLTest/Android.mk +++ b/opengl/tests/EGLTest/Android.mk @@ -1,6 +1,7 @@ # Build the unit tests. LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) +LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk LOCAL_MODULE := EGL_test @@ -14,27 +15,18 @@ LOCAL_SHARED_LIBRARIES := \ libEGL \ libcutils \ libbinder \ - libstlport \ libutils \ libgui \ -LOCAL_STATIC_LIBRARIES := \ - libgtest \ - libgtest_main \ - LOCAL_C_INCLUDES := \ - bionic \ bionic/libc/private \ - bionic/libstdc++/include \ - external/gtest/include \ - external/stlport/stlport \ frameworks/native/opengl/libs \ frameworks/native/opengl/libs/EGL \ # gold in binutils 2.22 will warn about the usage of mktemp LOCAL_LDFLAGS += -Wl,--no-fatal-warnings -include $(BUILD_EXECUTABLE) +include $(BUILD_NATIVE_TEST) # Include subdirectory makefiles # ============================================================ diff --git a/opengl/tests/EGLTest/egl_cache_test.cpp b/opengl/tests/EGLTest/egl_cache_test.cpp index c7d9e3e..c5bf296 100644 --- a/opengl/tests/EGLTest/egl_cache_test.cpp +++ b/opengl/tests/EGLTest/egl_cache_test.cpp @@ -41,7 +41,7 @@ protected: }; TEST_F(EGLCacheTest, UninitializedCacheAlwaysMisses) { - char buf[4] = { 0xee, 0xee, 0xee, 0xee }; + uint8_t buf[4] = { 0xee, 0xee, 0xee, 0xee }; mCache->setBlob("abcd", 4, "efgh", 4); ASSERT_EQ(0, mCache->getBlob("abcd", 4, buf, 4)); ASSERT_EQ(0xee, buf[0]); @@ -51,7 +51,7 @@ TEST_F(EGLCacheTest, UninitializedCacheAlwaysMisses) { } TEST_F(EGLCacheTest, InitializedCacheAlwaysHits) { - char buf[4] = { 0xee, 0xee, 0xee, 0xee }; + uint8_t buf[4] = { 0xee, 0xee, 0xee, 0xee }; mCache->initialize(egl_display_t::get(EGL_DEFAULT_DISPLAY)); mCache->setBlob("abcd", 4, "efgh", 4); ASSERT_EQ(4, mCache->getBlob("abcd", 4, buf, 4)); @@ -62,7 +62,7 @@ TEST_F(EGLCacheTest, InitializedCacheAlwaysHits) { } TEST_F(EGLCacheTest, TerminatedCacheAlwaysMisses) { - char buf[4] = { 0xee, 0xee, 0xee, 0xee }; + uint8_t buf[4] = { 0xee, 0xee, 0xee, 0xee }; mCache->initialize(egl_display_t::get(EGL_DEFAULT_DISPLAY)); mCache->setBlob("abcd", 4, "efgh", 4); mCache->terminate(); @@ -94,7 +94,7 @@ protected: }; TEST_F(EGLCacheSerializationTest, ReinitializedCacheContainsValues) { - char buf[4] = { 0xee, 0xee, 0xee, 0xee }; + uint8_t buf[4] = { 0xee, 0xee, 0xee, 0xee }; mCache->setCacheFilename(mFilename); mCache->initialize(egl_display_t::get(EGL_DEFAULT_DISPLAY)); mCache->setBlob("abcd", 4, "efgh", 4); diff --git a/opengl/tests/angeles/app-linux.cpp b/opengl/tests/angeles/app-linux.cpp index e490351..ced8786 100644 --- a/opengl/tests/angeles/app-linux.cpp +++ b/opengl/tests/angeles/app-linux.cpp @@ -118,7 +118,7 @@ static void checkEGLErrors() fprintf(stderr, "EGL Error: 0x%04x\n", (int)error); } -static int initGraphics(unsigned samples, const WindowSurface& windowSurface) +static int initGraphics(EGLint samples, const WindowSurface& windowSurface) { EGLint configAttribs[] = { EGL_DEPTH_SIZE, 16, diff --git a/opengl/tests/fillrate/fillrate.cpp b/opengl/tests/fillrate/fillrate.cpp index 1d9b026..2db63d7 100644 --- a/opengl/tests/fillrate/fillrate.cpp +++ b/opengl/tests/fillrate/fillrate.cpp @@ -91,11 +91,13 @@ int main(int argc, char** argv) } } + const GLfloat fh = h; + const GLfloat fw = w; const GLfloat vertices[4][2] = { - { 0, 0 }, - { 0, h }, - { w, h }, - { w, 0 } + { 0, 0 }, + { 0, fh }, + { fw, fh }, + { fw, 0 } }; const GLfloat texCoords[4][2] = { diff --git a/opengl/tests/filter/filter.cpp b/opengl/tests/filter/filter.cpp index 289e6cc..287ee93 100644 --- a/opengl/tests/filter/filter.cpp +++ b/opengl/tests/filter/filter.cpp @@ -140,11 +140,12 @@ int main(int argc, char** argv) //glDrawTexiOES(0, 0, 0, dim, dim); + const GLfloat fdim = dim; const GLfloat vertices[4][2] = { - { 0, 0 }, - { 0, dim }, - { dim, dim }, - { dim, 0 } + { 0, 0 }, + { 0, fdim }, + { fdim, fdim }, + { fdim, 0 } }; const GLfloat texCoords[4][2] = { diff --git a/opengl/tests/hwc/Android.mk b/opengl/tests/hwc/Android.mk index 86e1d46..f83846b 100644 --- a/opengl/tests/hwc/Android.mk +++ b/opengl/tests/hwc/Android.mk @@ -15,24 +15,25 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) +LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk + LOCAL_MODULE_TAGS := tests LOCAL_MODULE:= libhwcTest +LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES +LOCAL_CXX_STL := libc++ LOCAL_SRC_FILES:= hwcTestLib.cpp LOCAL_C_INCLUDES += system/extras/tests/include \ - bionic \ - bionic/libstdc++/include \ - external/stlport/stlport \ - $(call include-path-for, opengl-tests-includes) - -LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES - -LOCAL_SHARED_LIBRARIES += libcutils libutils libstlport -LOCAL_STATIC_LIBRARIES += libglTest - + $(call include-path-for, opengl-tests-includes) \ include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) +LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk + +LOCAL_MODULE:= hwcStress +LOCAL_MODULE_TAGS := tests +LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES +LOCAL_CXX_STL := libc++ LOCAL_SRC_FILES:= hwcStress.cpp LOCAL_SHARED_LIBRARIES := \ @@ -52,19 +53,17 @@ LOCAL_STATIC_LIBRARIES := \ LOCAL_C_INCLUDES += \ system/extras/tests/include \ hardware/libhardware/include \ - $(call include-path-for, opengl-tests-includes) + $(call include-path-for, opengl-tests-includes) \ -LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES +include $(BUILD_NATIVE_TEST) -LOCAL_MODULE:= hwcStress +include $(CLEAR_VARS) +LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk +LOCAL_MODULE:= hwcRects LOCAL_MODULE_TAGS := tests - LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES - -include $(BUILD_NATIVE_TEST) - -include $(CLEAR_VARS) +LOCAL_CXX_STL := libc++ LOCAL_SRC_FILES:= hwcRects.cpp LOCAL_SHARED_LIBRARIES := \ @@ -84,17 +83,17 @@ LOCAL_STATIC_LIBRARIES := \ LOCAL_C_INCLUDES += \ system/extras/tests/include \ hardware/libhardware/include \ - $(call include-path-for, opengl-tests-includes) - -LOCAL_MODULE:= hwcRects - -LOCAL_MODULE_TAGS := tests - -LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES + $(call include-path-for, opengl-tests-includes) \ include $(BUILD_NATIVE_TEST) include $(CLEAR_VARS) +LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk + +LOCAL_MODULE:= hwcColorEquiv +LOCAL_MODULE_TAGS := tests +LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES +LOCAL_CXX_STL := libc++ LOCAL_SRC_FILES:= hwcColorEquiv.cpp LOCAL_SHARED_LIBRARIES := \ @@ -114,17 +113,17 @@ LOCAL_STATIC_LIBRARIES := \ LOCAL_C_INCLUDES += \ system/extras/tests/include \ hardware/libhardware/include \ - $(call include-path-for, opengl-tests-includes) - -LOCAL_MODULE:= hwcColorEquiv - -LOCAL_MODULE_TAGS := tests - -LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES + $(call include-path-for, opengl-tests-includes) \ include $(BUILD_NATIVE_TEST) include $(CLEAR_VARS) +LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk + +LOCAL_MODULE:= hwcCommit +LOCAL_MODULE_TAGS := tests +LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES +LOCAL_CXX_STL := libc++ LOCAL_SRC_FILES:= hwcCommit.cpp LOCAL_SHARED_LIBRARIES := \ @@ -144,12 +143,6 @@ LOCAL_STATIC_LIBRARIES := \ LOCAL_C_INCLUDES += \ system/extras/tests/include \ hardware/libhardware/include \ - $(call include-path-for, opengl-tests-includes) - -LOCAL_MODULE:= hwcCommit - -LOCAL_MODULE_TAGS := tests - -LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES + $(call include-path-for, opengl-tests-includes) \ include $(BUILD_NATIVE_TEST) diff --git a/opengl/tests/hwc/hwcColorEquiv.cpp b/opengl/tests/hwc/hwcColorEquiv.cpp index c4624d2..06a0191 100644 --- a/opengl/tests/hwc/hwcColorEquiv.cpp +++ b/opengl/tests/hwc/hwcColorEquiv.cpp @@ -166,7 +166,6 @@ main(int argc, char *argv[]) int rv, opt; bool error; char *chptr; - unsigned int pass; char cmd[MAXCMD]; string str; @@ -293,14 +292,12 @@ main(int argc, char *argv[]) // Use the upper third of the display for the reference frame and // the middle third for the equivalence frame. unsigned int refHeight = height / 3; - unsigned int refPosY = 0; // Reference frame Y position unsigned int refPosX = 0; // Reference frame X position unsigned int refWidth = width - refPosX; if ((refWidth & refFormat->wMod) != 0) { refWidth += refFormat->wMod - (refWidth % refFormat->wMod); } unsigned int equivHeight = height / 3; - unsigned int equivPosY = refHeight; // Equivalence frame Y position unsigned int equivPosX = 0; // Equivalence frame X position unsigned int equivWidth = width - equivPosX; if ((equivWidth & equivFormat->wMod) != 0) { diff --git a/opengl/tests/hwc/hwcCommit.cpp b/opengl/tests/hwc/hwcCommit.cpp index 1bd5fdf..1bcb860 100644 --- a/opengl/tests/hwc/hwcCommit.cpp +++ b/opengl/tests/hwc/hwcCommit.cpp @@ -338,7 +338,6 @@ int main(int argc, char *argv[]) { int rv, opt; - char *chptr; bool error; string str; char cmd[MAXCMD]; diff --git a/opengl/tests/hwc/hwcRects.cpp b/opengl/tests/hwc/hwcRects.cpp index 9b57623..56c1a2a 100644 --- a/opengl/tests/hwc/hwcRects.cpp +++ b/opengl/tests/hwc/hwcRects.cpp @@ -204,7 +204,6 @@ main(int argc, char *argv[]) { int rv, opt; char *chptr; - bool error; string str; char cmd[MAXCMD]; @@ -367,7 +366,6 @@ static Rectangle parseRect(string rectStr) istringstream in(rectStr); const struct hwcTestGraphicFormat *format; Rectangle rect; - struct hwc_rect hwcRect; // Graphic Format in >> str; diff --git a/opengl/tests/hwc/hwcTestLib.cpp b/opengl/tests/hwc/hwcTestLib.cpp index 7fae5e5..3b0ca74 100644 --- a/opengl/tests/hwc/hwcTestLib.cpp +++ b/opengl/tests/hwc/hwcTestLib.cpp @@ -20,22 +20,22 @@ * Utility library functions for use by the Hardware Composer test cases */ +#include <arpa/inet.h> // For ntohl() and htonl() + +#include <cmath> #include <sstream> #include <string> -#include <arpa/inet.h> // For ntohl() and htonl() - #include "hwcTestLib.h" #include "EGLUtils.h" // Defines -#define NUMA(a) (sizeof(a) / sizeof(a [0])) +#define NUMA(a) (sizeof(a) / sizeof((a)[0])) // Function Prototypes static void printGLString(const char *name, GLenum s); static void checkEglError(const char* op, EGLBoolean returnVal = EGL_TRUE); -static void checkGlError(const char* op); static void printEGLConfiguration(EGLDisplay dpy, EGLConfig config); using namespace std; @@ -51,8 +51,6 @@ void hwcTestInitDisplay(bool verbose, EGLDisplay *dpy, EGLSurface *surface, { static EGLContext context; - int rv; - EGLBoolean returnValue; EGLConfig myConfig = {0}; EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; @@ -668,7 +666,6 @@ void hwcTestFillColor(GraphicBuffer *gBuf, ColorFract color, float alpha) for (unsigned int x = 0; x < gBuf->getStride(); x++) { for (unsigned int y = 0; y < gBuf->getHeight(); y++) { - uint32_t val = pixel; hwcTestSetPixel(gBuf, buf, x, y, (x < gBuf->getWidth()) ? pixel : testRand()); } @@ -965,14 +962,6 @@ static void checkEglError(const char* op, EGLBoolean returnVal) } } -static void checkGlError(const char* op) -{ - for (GLint error = glGetError(); error; error - = glGetError()) { - testPrintE("after %s() glError (0x%x)", op, error); - } -} - static void printEGLConfiguration(EGLDisplay dpy, EGLConfig config) { diff --git a/opengl/tests/lib/Android.mk b/opengl/tests/lib/Android.mk index a2752cd..e5124ad 100644 --- a/opengl/tests/lib/Android.mk +++ b/opengl/tests/lib/Android.mk @@ -15,18 +15,13 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) +LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk LOCAL_MODULE_TAGS := tests LOCAL_MODULE:= libglTest LOCAL_SRC_FILES:= glTestLib.cpp WindowSurface.cpp LOCAL_C_INCLUDES += system/extras/tests/include \ - bionic \ - bionic/libstdc++/include \ - external/stlport/stlport \ $(call include-path-for, opengl-tests-includes) LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES -LOCAL_SHARED_LIBRARIES += libcutils libutils libstlport - - include $(BUILD_STATIC_LIBRARY) diff --git a/opengl/tests/linetex/linetex.cpp b/opengl/tests/linetex/linetex.cpp index 7921f80..5ad695b 100644 --- a/opengl/tests/linetex/linetex.cpp +++ b/opengl/tests/linetex/linetex.cpp @@ -80,9 +80,11 @@ int main(int argc, char** argv) // default pack-alignment is 4 const uint16_t t16[64] = { 0xFFFF, 0, 0xF800, 0, 0x07E0, 0, 0x001F, 0 }; + const GLfloat fh = h; + const GLfloat fw2 = w/2; const GLfloat vertices[4][2] = { - { w/2, 0 }, - { w/2, h } + { fw2, 0 }, + { fw2, fh } }; const GLfloat texCoords[4][2] = { |