diff options
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/libagl/Android.mk | 2 | ||||
-rw-r--r-- | opengl/libagl/Tokenizer.cpp | 4 | ||||
-rw-r--r-- | opengl/libagl/context.h | 8 | ||||
-rw-r--r-- | opengl/libagl/egl.cpp | 12 | ||||
-rw-r--r-- | opengl/libs/EGL/egl.cpp | 13 | ||||
-rw-r--r-- | opengl/libs/EGL/eglApi.cpp | 2 | ||||
-rw-r--r-- | opengl/tools/glgen/src/JniCodeEmitter.java | 1 |
7 files changed, 24 insertions, 18 deletions
diff --git a/opengl/libagl/Android.mk b/opengl/libagl/Android.mk index 9886bf0..95a8ef2 100644 --- a/opengl/libagl/Android.mk +++ b/opengl/libagl/Android.mk @@ -44,7 +44,7 @@ endif # we need to access the private Bionic header <bionic_tls.h> LOCAL_C_INCLUDES += bionic/libc/private -LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl +LOCAL_MODULE_RELATIVE_PATH := egl LOCAL_MODULE:= libGLES_android include $(BUILD_SHARED_LIBRARY) diff --git a/opengl/libagl/Tokenizer.cpp b/opengl/libagl/Tokenizer.cpp index eac8d6d..ac0a48c 100644 --- a/opengl/libagl/Tokenizer.cpp +++ b/opengl/libagl/Tokenizer.cpp @@ -163,9 +163,9 @@ void Tokenizer::dump() const { const run_t* ranges = mRanges.array(); const size_t c = mRanges.size(); - ALOGD("Tokenizer (%p, size = %u)\n", this, c); + ALOGD("Tokenizer (%p, size = %zu)\n", this, c); for (size_t i=0 ; i<c ; i++) { - ALOGD("%u: (%u, %u)\n", i, ranges[i].first, ranges[i].length); + ALOGD("%zu: (%u, %u)\n", i, ranges[i].first, ranges[i].length); } } diff --git a/opengl/libagl/context.h b/opengl/libagl/context.h index 7065a30..c599a55 100644 --- a/opengl/libagl/context.h +++ b/opengl/libagl/context.h @@ -147,7 +147,11 @@ struct vertex_t { vec4_t color; vec4_t texture[GGL_TEXTURE_UNIT_COUNT]; +#ifdef __LP64__ + uint32_t reserved1[2]; +#else uint32_t reserved1[4]; +#endif inline void clear() { flags = index = locked = mru = 0; @@ -578,10 +582,10 @@ private: #ifdef HAVE_ANDROID_OS // We have a dedicated TLS slot in bionic inline void setGlThreadSpecific(ogles_context_t *value) { - ((uint32_t *)__get_tls())[TLS_SLOT_OPENGL] = (uint32_t)value; + __get_tls()[TLS_SLOT_OPENGL] = value; } inline ogles_context_t* getGlThreadSpecific() { - return (ogles_context_t *)(((unsigned *)__get_tls())[TLS_SLOT_OPENGL]); + return static_cast<ogles_context_t*>(__get_tls()[TLS_SLOT_OPENGL]); } #else extern pthread_key_t gGLKey; diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index bbbda76..f925e7d 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -78,20 +78,20 @@ static T setError(GLint error, T returnValue) { pthread_key_create(&gEGLErrorKey, NULL); pthread_mutex_unlock(&gErrorKeyMutex); } - pthread_setspecific(gEGLErrorKey, (void*)error); + pthread_setspecific(gEGLErrorKey, (void*)(uintptr_t)error); return returnValue; } static GLint getError() { if (ggl_unlikely(gEGLErrorKey == -1)) return EGL_SUCCESS; - GLint error = (GLint)pthread_getspecific(gEGLErrorKey); + GLint error = (GLint)(uintptr_t)pthread_getspecific(gEGLErrorKey); if (error == 0) { // The TLS key has been created by another thread, but the value for // this thread has not been initialized. return EGL_SUCCESS; } - pthread_setspecific(gEGLErrorKey, (void*)EGL_SUCCESS); + pthread_setspecific(gEGLErrorKey, (void*)(uintptr_t)EGL_SUCCESS); return error; } @@ -1201,7 +1201,7 @@ static EGLBoolean getConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value) { size_t numConfigs = NELEM(gConfigs); - int index = (int)config; + int index = (int)(uintptr_t)config; if (uint32_t(index) >= numConfigs) return setError(EGL_BAD_CONFIG, EGL_FALSE); @@ -1448,7 +1448,7 @@ EGLBoolean eglGetConfigs( EGLDisplay dpy, } GLint i; for (i=0 ; i<numConfigs && i<config_size ; i++) { - *configs++ = (EGLConfig)i; + *configs++ = (EGLConfig)(uintptr_t)i; } *num_config = i; return EGL_TRUE; @@ -1519,7 +1519,7 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, if (configs) { for (int i=0 ; config_size && i<numConfigs ; i++) { if (possibleMatch & (1<<i)) { - *configs++ = (EGLConfig)i; + *configs++ = (EGLConfig)(uintptr_t)i; config_size--; n++; } diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp index f759e6b..67fbae5 100644 --- a/opengl/libs/EGL/egl.cpp +++ b/opengl/libs/EGL/egl.cpp @@ -27,7 +27,6 @@ #include <cutils/log.h> #include <cutils/atomic.h> #include <cutils/properties.h> -#include <cutils/memory.h> #include <utils/CallStack.h> #include <utils/String8.h> @@ -42,6 +41,8 @@ #include "egl_display.h" #include "egl_object.h" +typedef __eglMustCastToProperFunctionPointerType EGLFuncPointer; + // ---------------------------------------------------------------------------- namespace android { // ---------------------------------------------------------------------------- @@ -234,11 +235,11 @@ static void early_egl_init(void) pthread_key_create(&gGLTraceKey, NULL); initEglTraceLevel(); #endif - uint32_t addr = (uint32_t)((void*)gl_no_context); - android_memset32( - (uint32_t*)(void*)&gHooksNoContext, - addr, - sizeof(gHooksNoContext)); + int numHooks = sizeof(gHooksNoContext) / sizeof(EGLFuncPointer); + EGLFuncPointer *iter = reinterpret_cast<EGLFuncPointer*>(&gHooksNoContext); + for (int hook = 0; hook < numHooks; ++hook) { + *(iter++) = reinterpret_cast<EGLFuncPointer>(gl_no_context); + } setGLHooksThreadSpecific(&gHooksNoContext); } diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index 0cc5265..d96b54f 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -204,7 +204,7 @@ EGLDisplay eglGetDisplay(EGLNativeDisplayType display) { clearError(); - uint32_t index = uint32_t(display); + uintptr_t index = reinterpret_cast<uintptr_t>(display); if (index >= NUM_DISPLAYS) { return setError(EGL_BAD_PARAMETER, EGL_NO_DISPLAY); } diff --git a/opengl/tools/glgen/src/JniCodeEmitter.java b/opengl/tools/glgen/src/JniCodeEmitter.java index d5e2d34..b1bd1fd 100644 --- a/opengl/tools/glgen/src/JniCodeEmitter.java +++ b/opengl/tools/glgen/src/JniCodeEmitter.java @@ -1073,6 +1073,7 @@ public class JniCodeEmitter { String decl = type.getDeclaration(); needsExit = true; out.println(indent + "if (!" + cname + ") {"); + out.println(indent + indent + "_exception = 1;"); out.println(indent + indent + "_exceptionType = \"java/lang/IllegalArgumentException\";"); out.println(indent + indent + |