summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2014-04-21 18:51:18 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-04-21 18:51:18 +0000
commit3f0d5669eb437ce1f9ce599e196d045534ec3d4f (patch)
tree50629eb4ebab6f105d6b90fd5f68d6ce6f961ea5 /opengl
parent85085cd6dd5ffed556e0a044ccf4080fbe7c5981 (diff)
parentc0ec5e2333b6350480851b8b48f000c78ea3f88a (diff)
downloadframeworks_native-3f0d5669eb437ce1f9ce599e196d045534ec3d4f.zip
frameworks_native-3f0d5669eb437ce1f9ce599e196d045534ec3d4f.tar.gz
frameworks_native-3f0d5669eb437ce1f9ce599e196d045534ec3d4f.tar.bz2
Merge "Expose core EGL entry points to eglGetProcAddress"
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libs/EGL/Loader.cpp5
-rw-r--r--opengl/libs/EGL/eglApi.cpp7
-rw-r--r--opengl/libs/EGL/egldefs.h1
3 files changed, 11 insertions, 2 deletions
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
index e528831..1fcc048 100644
--- a/opengl/libs/EGL/Loader.cpp
+++ b/opengl/libs/EGL/Loader.cpp
@@ -188,12 +188,17 @@ 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
+ LOG_ALWAYS_FATAL_IF(!cnx->libEgl,
+ "couldn't load system EGL wrapper libraries");
+
LOG_ALWAYS_FATAL_IF(!cnx->libGles2 || !cnx->libGles1,
"couldn't load system OpenGL ES wrapper libraries");
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index d96b54f..22990f3 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -877,11 +877,14 @@ EGLint eglGetError(void)
return err;
}
-static __eglMustCastToProperFunctionPointerType findBuiltinGLWrapper(
+static __eglMustCastToProperFunctionPointerType findBuiltinWrapper(
const char* procname) {
const egl_connection_t* cnx = &gEGLImpl;
void* proc = NULL;
+ proc = dlsym(cnx->libEgl, procname);
+ if (proc) return (__eglMustCastToProperFunctionPointerType)proc;
+
proc = dlsym(cnx->libGles2, procname);
if (proc) return (__eglMustCastToProperFunctionPointerType)proc;
@@ -912,7 +915,7 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
addr = findProcAddress(procname, sExtensionMap, NELEM(sExtensionMap));
if (addr) return addr;
- addr = findBuiltinGLWrapper(procname);
+ addr = findBuiltinWrapper(procname);
if (addr) return addr;
// this protects accesses to sGLExtentionMap and sGLExtentionSlot
diff --git a/opengl/libs/EGL/egldefs.h b/opengl/libs/EGL/egldefs.h
index b905ea0..9858276 100644
--- a/opengl/libs/EGL/egldefs.h
+++ b/opengl/libs/EGL/egldefs.h
@@ -44,6 +44,7 @@ struct egl_connection_t {
EGLint minor;
egl_t egl;
+ void* libEgl;
void* libGles1;
void* libGles2;
};