Commit 35f9a9c5c99d0d723bb9361fc5018cf2fdec1fce
- Diff rendering mode:
- inline
- side by side
src/egl/Android.mk
(1 / 1)
|   | |||
| 32 | 32 | external/mesa/src/mesa \ | |
| 33 | 33 | external/drm/shared-core | |
| 34 | 34 | ||
| 35 | LOCAL_CFLAGS += -DPTHREADS -D_EGL_PLATFORM_X=1 | ||
| 35 | LOCAL_CFLAGS += -DPTHREADS | ||
| 36 | 36 | LOCAL_SHARED_LIBRARIES := libdl libui libutils | |
| 37 | 37 | LOCAL_STATIC_LIBRARIES := libes1api | |
| 38 | 38 |
src/egl/main/egldriver.c
(72 / 53)
|   | |||
| 23 | 23 | ||
| 24 | 24 | #if defined(_EGL_PLATFORM_X) | |
| 25 | 25 | #include <dlfcn.h> | |
| 26 | #elif defined(_EGL_PLATFORM_WINDOWS) | ||
| 27 | /* Use static linking on Windows for now */ | ||
| 28 | #define WINDOWS_STATIC_LINK | ||
| 29 | 26 | #endif | |
| 30 | 27 | ||
| 28 | |||
| 31 | 29 | /** | |
| 32 | 30 | * Wrappers for dlopen/dlclose() | |
| 33 | 31 | */ | |
| 34 | 32 | #if defined(_EGL_PLATFORM_WINDOWS) | |
| 35 | #ifdef WINDOWS_STATIC_LINK | ||
| 36 | static const char *DefaultDriverName = "Windows EGL Static Library"; | ||
| 37 | #else | ||
| 38 | /* XXX Need to decide how to do dynamic name lookup on Windows */ | ||
| 39 | static const char *DefaultDriverName = "TBD"; | ||
| 40 | #endif | ||
| 41 | typedef HMODULE lib_handle; | ||
| 42 | 33 | ||
| 43 | static HMODULE | ||
| 44 | open_library(const char *filename) | ||
| 45 | { | ||
| 46 | #ifdef WINDOWS_STATIC_LINK | ||
| 47 | return 0; | ||
| 48 | #else | ||
| 49 | return LoadLibrary(filename); | ||
| 50 | #endif | ||
| 51 | } | ||
| 52 | 34 | ||
| 53 | static void | ||
| 54 | close_library(HMODULE lib) | ||
| 55 | { | ||
| 56 | #ifdef WINDOWS_STATIC_LINK | ||
| 57 | #else | ||
| 58 | FreeLibrary(lib); | ||
| 59 | #endif | ||
| 60 | } | ||
| 35 | /* XXX Need to decide how to do dynamic name lookup on Windows */ | ||
| 36 | static const char DefaultDriverName[] = "TBD"; | ||
| 61 | 37 | ||
| 38 | typedef HMODULE lib_handle; | ||
| 39 | |||
| 40 | static HMODULE | ||
| 41 | open_library(const char *filename) | ||
| 42 | { | ||
| 43 | return LoadLibrary(filename); | ||
| 44 | } | ||
| 45 | |||
| 46 | static void | ||
| 47 | close_library(HMODULE lib) | ||
| 48 | { | ||
| 49 | FreeLibrary(lib); | ||
| 50 | } | ||
| 51 | |||
| 52 | |||
| 62 | 53 | #elif defined(_EGL_PLATFORM_X) | |
| 63 | static const char *DefaultDriverName = "egl_softpipe"; | ||
| 64 | 54 | ||
| 65 | typedef void * lib_handle; | ||
| 66 | 55 | ||
| 67 | static void * | ||
| 68 | open_library(const char *filename) | ||
| 69 | { | ||
| 70 | return dlopen(filename, RTLD_LAZY); | ||
| 71 | } | ||
| 56 | static const char DefaultDriverName[] = "egl_softpipe"; | ||
| 72 | 57 | ||
| 73 | static void | ||
| 74 | close_library(void *lib) | ||
| 75 | { | ||
| 76 | dlclose(lib); | ||
| 77 | } | ||
| 78 | |||
| 58 | typedef void * lib_handle; | ||
| 59 | |||
| 60 | static void * | ||
| 61 | open_library(const char *filename) | ||
| 62 | { | ||
| 63 | return dlopen(filename, RTLD_LAZY); | ||
| 64 | } | ||
| 65 | |||
| 66 | static void | ||
| 67 | close_library(void *lib) | ||
| 68 | { | ||
| 69 | dlclose(lib); | ||
| 70 | } | ||
| 71 | |||
| 72 | #else /* _EGL_PLATFORM_NO_OS */ | ||
| 73 | |||
| 74 | static const char DefaultDriverName[] = "builtin"; | ||
| 75 | |||
| 76 | typedef void *lib_handle; | ||
| 77 | |||
| 78 | static INLINE void * | ||
| 79 | open_library(const char *filename) | ||
| 80 | { | ||
| 81 | return (void *) filename; | ||
| 82 | } | ||
| 83 | |||
| 84 | static INLINE void | ||
| 85 | close_library(void *lib) | ||
| 86 | { | ||
| 87 | } | ||
| 88 | |||
| 89 | |||
| 79 | 90 | #endif | |
| 80 | 91 | ||
| 81 | 92 | ||
| … | … | ||
| 107 | 107 | path = _eglstrdup(path); | |
| 108 | 108 | ||
| 109 | 109 | #if defined(_EGL_PLATFORM_X) | |
| 110 | if (!path && dpy->NativeDisplay) { | ||
| 110 | if (!path && dpy && dpy->NativeDisplay) { | ||
| 111 | 111 | /* assume (wrongly!) that the native display is a display string */ | |
| 112 | 112 | path = _eglSplitDisplayString((const char *) dpy->NativeDisplay, &args); | |
| 113 | 113 | } | |
| 114 | 114 | suffix = "so"; | |
| 115 | 115 | #elif defined(_EGL_PLATFORM_WINDOWS) | |
| 116 | 116 | suffix = "dll"; | |
| 117 | #endif /* _EGL_PLATFORM_X */ | ||
| 117 | #else /* _EGL_PLATFORM_NO_OS */ | ||
| 118 | if (path) { | ||
| 119 | free(path); | ||
| 120 | path = NULL; | ||
| 121 | } | ||
| 122 | suffix = NULL; | ||
| 123 | #endif | ||
| 118 | 124 | ||
| 119 | 125 | if (!path) | |
| 120 | 126 | path = _eglstrdup(DefaultDriverName); | |
| … | … | ||
| 160 | 160 | assert(driverPath); | |
| 161 | 161 | ||
| 162 | 162 | #if defined(_EGL_PLATFORM_WINDOWS) | |
| 163 | /* Use static linking on Windows for now */ | ||
| 164 | #ifdef WINDOWS_STATIC_LINK | ||
| 165 | lib = 0; | ||
| 166 | mainFunc = (_EGLMain_t)_eglMain; | ||
| 167 | #else | ||
| 168 | 163 | /* XXX untested */ | |
| 169 | 164 | _eglLog(_EGL_DEBUG, "dlopen(%s)", driverPath); | |
| 170 | 165 | lib = open_library(driverPath); | |
| … | … | ||
| 169 | 169 | return NULL; | |
| 170 | 170 | } | |
| 171 | 171 | mainFunc = (_EGLMain_t) GetProcAddress(lib, "_eglMain"); | |
| 172 | #endif | ||
| 173 | 172 | #elif defined(_EGL_PLATFORM_X) | |
| 174 | 173 | _eglLog(_EGL_DEBUG, "dlopen(%s)", driverPath); | |
| 175 | 174 | lib = open_library(driverPath); | |
| … | … | ||
| 181 | 181 | return NULL; | |
| 182 | 182 | } | |
| 183 | 183 | mainFunc = (_EGLMain_t) dlsym(lib, "_eglMain"); | |
| 184 | #else /* _EGL_PLATFORM_NO_OS */ | ||
| 185 | lib = 0; | ||
| 186 | /* must be default driver name */ | ||
| 187 | if (strcmp(driverPath, DefaultDriverName) == 0) | ||
| 188 | mainFunc = (_EGLMain_t) _eglMain; | ||
| 189 | else | ||
| 190 | mainFunc = NULL; | ||
| 184 | 191 | #endif | |
| 185 | 192 | ||
| 186 | 193 | if (!mainFunc) { | |
| … | … | ||
| 213 | 213 | lib_handle lib; | |
| 214 | 214 | _EGLDriver *drv = NULL; | |
| 215 | 215 | ||
| 216 | /* temporary hack */ | ||
| 217 | (void) _eglOpenLibrary; | ||
| 218 | mainFunc = _eglMain; | ||
| 219 | lib = (lib_handle) 0; | ||
| 220 | |||
| 216 | mainFunc = _eglOpenLibrary(path, &lib); | ||
| 221 | 217 | if (!mainFunc) | |
| 222 | 218 | return NULL; | |
| 223 | 219 | ||
| … | … | ||
| 452 | 452 | const char *es2_libname = "libGLESv2.so"; | |
| 453 | 453 | const char *gl_libname = "libGL.so"; | |
| 454 | 454 | const char *vg_libname = "libOpenVG.so"; | |
| 455 | #else /* _EGL_PLATFORM_NO_OS */ | ||
| 456 | const char *es1_libname = NULL; | ||
| 457 | const char *es2_libname = NULL; | ||
| 458 | const char *gl_libname = NULL; | ||
| 459 | const char *vg_libname = NULL; | ||
| 455 | 460 | #endif | |
| 456 | 461 | ||
| 457 | 462 | if ((lib = open_library(es1_libname))) { |
src/egl/main/egllog.c
(0 / 4)
|   | |||
| 21 | 21 | static void | |
| 22 | 22 | log_level_initialize(void) | |
| 23 | 23 | { | |
| 24 | #if defined(_EGL_PLATFORM_X) | ||
| 25 | 24 | char *log_env = getenv("EGL_LOG_LEVEL"); | |
| 26 | #else | ||
| 27 | char *log_env = NULL; | ||
| 28 | #endif | ||
| 29 | 25 | ||
| 30 | 26 | if (log_env == NULL) { | |
| 31 | 27 | ReportingLevel = FALLBACK_LOG_LEVEL; |

