diff options
author | Mathias Agopian <mathias@google.com> | 2009-04-30 14:43:18 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-04-30 14:43:18 -0700 |
commit | fa6eda01a9f3df0102ce6a65302c8674cc9c7e50 (patch) | |
tree | a0c1b31bd8e162132c54a2ef8521b3ed6cf8cad1 /opengl/libs/EGL | |
parent | d504605919a62902e10cd13536390ffce84a3326 (diff) | |
parent | 072868a4d33740ee023b7364dcb38f4fc14bd8b0 (diff) | |
download | frameworks_base-fa6eda01a9f3df0102ce6a65302c8674cc9c7e50.zip frameworks_base-fa6eda01a9f3df0102ce6a65302c8674cc9c7e50.tar.gz frameworks_base-fa6eda01a9f3df0102ce6a65302c8674cc9c7e50.tar.bz2 |
Merge commit 'goog/master' into merge_master
Conflicts:
libs/surfaceflinger/Layer.cpp
libs/surfaceflinger/SurfaceFlinger.cpp
opengl/libagl/egl.cpp
opengl/libs/EGL/egl.cpp
opengl/libs/GLES_CM/gl.cpp
opengl/libs/GLES_CM/gl_api.in
opengl/libs/gl_entries.in
opengl/libs/tools/glapigen
Diffstat (limited to 'opengl/libs/EGL')
-rw-r--r-- | opengl/libs/EGL/egl.cpp | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp index c58fff8..74aed20 100644 --- a/opengl/libs/EGL/egl.cpp +++ b/opengl/libs/EGL/egl.cpp @@ -156,6 +156,7 @@ static void gl_unimplemented() { static char const * const gl_names[] = { #include "gl_entries.in" + #include "glext_entries.in" NULL }; @@ -279,6 +280,8 @@ EGLContext getContext() { static __attribute__((noinline)) void *load_driver(const char* driver, gl_hooks_t* hooks) { + //LOGD("%s", driver); + char scrap[256]; void* dso = dlopen(driver, RTLD_NOW | RTLD_LOCAL); LOGE_IF(!dso, "couldn't load <%s> library (%s)", @@ -316,26 +319,42 @@ void *load_driver(const char* driver, gl_hooks_t* hooks) *curr++ = f; api++; } - gl_hooks_t::gl_t* gl = &hooks->gl; curr = (__eglMustCastToProperFunctionPointerType*)gl; api = gl_names; while (*api) { char const * name = *api; - // if the function starts with '__' it's a special case that - // uses a wrapper. skip the '__' when looking into the real lib. - if (name[0] == '_' && name[1] == '_') { - name += 2; - } __eglMustCastToProperFunctionPointerType f = (__eglMustCastToProperFunctionPointerType)dlsym(dso, name); if (f == NULL) { // couldn't find the entry-point, use eglGetProcAddress() f = getProcAddress(name); - if (f == NULL) { - f = (__eglMustCastToProperFunctionPointerType)gl_unimplemented; + } + if (f == NULL) { + // Try without the OES postfix + ssize_t index = ssize_t(strlen(name)) - 3; + if ((index>0 && (index<255)) && (!strcmp(name+index, "OES"))) { + strncpy(scrap, name, index); + scrap[index] = 0; + f = (__eglMustCastToProperFunctionPointerType)dlsym(dso, scrap); + //LOGD_IF(f, "found <%s> instead", scrap); } } + if (f == NULL) { + // Try with the OES postfix + ssize_t index = ssize_t(strlen(name)) - 3; + if ((index>0 && (index<252)) && (strcmp(name+index, "OES"))) { + strncpy(scrap, name, index); + scrap[index] = 0; + strcat(scrap, "OES"); + f = (__eglMustCastToProperFunctionPointerType)dlsym(dso, scrap); + //LOGD_IF(f, "found <%s> instead", scrap); + } + } + if (f == NULL) { + //LOGD("%s", name); + f = (__eglMustCastToProperFunctionPointerType)gl_unimplemented; + } *curr++ = f; api++; } |