diff options
Diffstat (limited to 'opengl')
| -rw-r--r-- | opengl/libagl/context.h | 4 | ||||
| -rw-r--r-- | opengl/libagl/egl.cpp | 6 | ||||
| -rw-r--r-- | opengl/libs/Android.mk | 5 | ||||
| -rw-r--r-- | opengl/libs/EGL/Loader.cpp | 21 | ||||
| -rw-r--r-- | opengl/tests/gl_perfapp/jni/gl_code.cpp | 2 |
5 files changed, 22 insertions, 16 deletions
diff --git a/opengl/libagl/context.h b/opengl/libagl/context.h index c599a55aaf..d23f43568e 100644 --- a/opengl/libagl/context.h +++ b/opengl/libagl/context.h @@ -21,7 +21,7 @@ #include <stddef.h> #include <sys/types.h> #include <pthread.h> -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ #include <bionic_tls.h> #endif @@ -579,7 +579,7 @@ private: // state // ---------------------------------------------------------------------------- -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ // We have a dedicated TLS slot in bionic inline void setGlThreadSpecific(ogles_context_t *value) { __get_tls()[TLS_SLOT_OPENGL] = value; diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index 593d0c2d05..7560d8fdf0 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -64,7 +64,7 @@ const unsigned int NUM_DISPLAYS = 1; static pthread_mutex_t gInitMutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t gErrorKeyMutex = PTHREAD_MUTEX_INITIALIZER; static pthread_key_t gEGLErrorKey = -1; -#ifndef HAVE_ANDROID_OS +#ifndef __ANDROID__ namespace gl { pthread_key_t gGLKey = -1; }; // namespace gl @@ -1373,7 +1373,7 @@ static EGLSurface createPbufferSurface(EGLDisplay dpy, EGLConfig config, int32_t w = 0; int32_t h = 0; - while (attrib_list[0]) { + while (attrib_list[0] != EGL_NONE) { if (attrib_list[0] == EGL_WIDTH) w = attrib_list[1]; if (attrib_list[0] == EGL_HEIGHT) h = attrib_list[1]; attrib_list+=2; @@ -1403,7 +1403,7 @@ using namespace android; EGLDisplay eglGetDisplay(NativeDisplayType display) { -#ifndef HAVE_ANDROID_OS +#ifndef __ANDROID__ // this just needs to be done once if (gGLKey == -1) { pthread_mutex_lock(&gInitMutex); diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk index 18ad3003e1..8d426907fd 100644 --- a/opengl/libs/Android.mk +++ b/opengl/libs/Android.mk @@ -59,6 +59,11 @@ ifneq ($(MAX_EGL_CACHE_SIZE),) LOCAL_CFLAGS += -DMAX_EGL_CACHE_SIZE=$(MAX_EGL_CACHE_SIZE) endif +ifeq (address, $(strip $(SANITIZE_TARGET))) + LOCAL_CFLAGS_32 += -DEGL_WRAPPER_DIR=\"/$(TARGET_COPY_OUT_DATA)/lib\" + LOCAL_CFLAGS_64 += -DEGL_WRAPPER_DIR=\"/$(TARGET_COPY_OUT_DATA)/lib64\" +endif + LOCAL_REQUIRED_MODULES := $(egl.cfg_config_module) egl.cfg_config_module := diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp index 1fcc048b28..8df9af3e44 100644 --- a/opengl/libs/EGL/Loader.cpp +++ b/opengl/libs/EGL/Loader.cpp @@ -167,6 +167,14 @@ static void* load_wrapper(const char* path) { return so; } +#ifndef EGL_WRAPPER_DIR +#if defined(__LP64__) +#define EGL_WRAPPER_DIR "/system/lib64" +#else +#define EGL_WRAPPER_DIR "/system/lib" +#endif +#endif + void* Loader::open(egl_connection_t* cnx) { void* dso; @@ -187,15 +195,10 @@ void* Loader::open(egl_connection_t* cnx) LOG_ALWAYS_FATAL_IF(!hnd, "couldn't find an OpenGL ES implementation"); -#if defined(__LP64__) - cnx->libEgl = load_wrapper("/system/lib64/libEGL.so"); - cnx->libGles2 = load_wrapper("/system/lib64/libGLESv2.so"); - cnx->libGles1 = load_wrapper("/system/lib64/libGLESv1_CM.so"); -#else - cnx->libEgl = load_wrapper("/system/lib/libEGL.so"); - cnx->libGles2 = load_wrapper("/system/lib/libGLESv2.so"); - cnx->libGles1 = load_wrapper("/system/lib/libGLESv1_CM.so"); -#endif + cnx->libEgl = load_wrapper(EGL_WRAPPER_DIR "/libEGL.so"); + cnx->libGles2 = load_wrapper(EGL_WRAPPER_DIR "/libGLESv2.so"); + cnx->libGles1 = load_wrapper(EGL_WRAPPER_DIR "/libGLESv1_CM.so"); + LOG_ALWAYS_FATAL_IF(!cnx->libEgl, "couldn't load system EGL wrapper libraries"); diff --git a/opengl/tests/gl_perfapp/jni/gl_code.cpp b/opengl/tests/gl_perfapp/jni/gl_code.cpp index 2f0418373a..378c8e88db 100644 --- a/opengl/tests/gl_perfapp/jni/gl_code.cpp +++ b/opengl/tests/gl_perfapp/jni/gl_code.cpp @@ -26,8 +26,6 @@ uint32_t h; // The stateClock starts at zero and increments by 1 every time we draw a frame. It is used to control which phase of the test we are in. int stateClock; -const int doLoopStates = 2; -const int doSingleTestStates = 2; bool done; // Saves the parameters of the test (so we can print them out when we finish the timing.) |