am fbfb73b4: am 0c074ddb: Merge "Setting Renderer default libs to use translator libs"

* commit 'fbfb73b40593389ea91c147da5ee374c841009dd':
  Setting Renderer default libs to use translator libs
This commit is contained in:
David Turner
2011-07-01 03:10:53 -07:00
committed by Android Git Automerger
3 changed files with 29 additions and 4 deletions

View File

@@ -20,17 +20,25 @@
EGLDispatch s_egl;
#ifdef _WIN32
#define DEFAULT_EGL_LIB "libEGL_translator"
#elif defined(__APPLE__)
#define DEFAULT_EGL_LIB "libEGL_translator.dylib"
#else
#define DEFAULT_EGL_LIB "libEGL_translator.so"
#endif
bool init_egl_dispatch()
{
const char *libName = getenv("ANDROID_EGL_LIB");
if (!libName) libName = "libEGL.so";
if (!libName) libName = DEFAULT_EGL_LIB;
osUtils::dynLibrary *lib = osUtils::dynLibrary::open(libName);
if (!lib) {
printf("Failed to open %s\n", libName);
return NULL;
}
s_egl.eglGetError = (eglGetError_t) lib->findSymbol("eglGetError");
s_egl.eglGetDisplay = (eglGetDisplay_t) lib->findSymbol("eglGetDisplay");
s_egl.eglInitialize = (eglInitialize_t) lib->findSymbol("eglInitialize");

View File

@@ -23,6 +23,14 @@ gl2_decoder_context_t s_gl2;
static osUtils::dynLibrary *s_gles2_lib = NULL;
#ifdef _WIN32
#define DEFAULT_GLES_V2_LIB "libGLES_V2_translator"
#elif defined(__APPLE__)
#define DEFAULT_GLES_V2_LIB "libGLES_V2_translator.dylib"
#else
#define DEFAULT_GLES_V2_LIB "libGLES_V2_translator.so"
#endif
//
// This function is called only once during initialiation before
// any thread has been created - hence it should NOT be thread safe.
@@ -30,7 +38,7 @@ static osUtils::dynLibrary *s_gles2_lib = NULL;
bool init_gl2_dispatch()
{
const char *libName = getenv("ANDROID_GLESv2_LIB");
if (!libName) libName = "libGLESv2.so";
if (!libName) libName = DEFAULT_GLES_V2_LIB;
//
// Load the GLES library

View File

@@ -26,10 +26,19 @@ static osUtils::dynLibrary *s_gles_lib = NULL;
// This function is called only once during initialiation before
// any thread has been created - hence it should NOT be thread safe.
//
#ifdef _WIN32
#define DEFAULT_GLES_CM_LIB "libGLES_CM_translator"
#elif defined(__APPLE__)
#define DEFAULT_GLES_CM_LIB "libGLES_CM_translator.dylib"
#else
#define DEFAULT_GLES_CM_LIB "libGLES_CM_translator.so"
#endif
bool init_gl_dispatch()
{
const char *libName = getenv("ANDROID_GLESv1_LIB");
if (!libName) libName = "libGLES_CM.so";
if (!libName) libName = DEFAULT_GLES_CM_LIB;
s_gles_lib = osUtils::dynLibrary::open(libName);
if (!s_gles_lib) return false;