Loading libs/graphicsenv/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ cc_library_shared { shared_libs: [ "liblog", "libcutils", ], export_include_dirs: ["include"], Loading libs/graphicsenv/GraphicsEnv.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -18,9 +18,12 @@ #define LOG_TAG "GraphicsEnv" #include <graphicsenv/GraphicsEnv.h> #include <sys/prctl.h> #include <mutex> #include <android/dlext.h> #include <cutils/properties.h> #include <log/log.h> // TODO(b/37049319) Get this from a header once one exists Loading @@ -46,6 +49,14 @@ namespace android { return env; } int GraphicsEnv::getCanLoadSystemLibraries() { if (property_get_bool("ro.debuggable", false) && prctl(PR_GET_DUMPABLE, 0, 0, 0, 0)) { // Return an integer value since this crosses library boundaries return 1; } return 0; } void GraphicsEnv::setDriverPath(const std::string path) { if (!mDriverPath.empty()) { ALOGV("ignoring attempt to change driver path from '%s' to '%s'", Loading Loading @@ -181,4 +192,10 @@ bool android_getAngleDeveloperOptIn() { const char* android_getAngleAppPref() { return android::GraphicsEnv::getInstance().getAngleAppPref(); } const char* android_getLayerPaths() { return android::GraphicsEnv::getInstance().getLayerPaths().c_str(); } const char* android_getDebugLayers() { return android::GraphicsEnv::getInstance().getDebugLayers().c_str(); } } libs/graphicsenv/include/graphicsenv/GraphicsEnv.h +9 −5 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ class GraphicsEnv { public: static GraphicsEnv& getInstance(); int getCanLoadSystemLibraries(); // Set a search path for loading graphics drivers. The path is a list of // directories separated by ':'. A directory can be contained in a zip file // (drivers must be stored uncompressed and page aligned); such elements Loading Loading @@ -90,6 +92,8 @@ android_namespace_t* android_getAngleNamespace(); const char* android_getAngleAppName(); const char* android_getAngleAppPref(); bool android_getAngleDeveloperOptIn(); const char* android_getLayerPaths(); const char* android_getDebugLayers(); } #endif // ANDROID_UI_GRAPHICS_ENV_H opengl/libs/Android.bp +5 −0 Original line number Diff line number Diff line Loading @@ -140,8 +140,10 @@ cc_library_shared { "EGL/egl_cache.cpp", "EGL/egl_display.cpp", "EGL/egl_object.cpp", "EGL/egl_layers.cpp", "EGL/egl.cpp", "EGL/eglApi.cpp", "EGL/egl_platform_entries.cpp", "EGL/Loader.cpp", "EGL/egl_angle_platform.cpp", ], Loading @@ -149,8 +151,11 @@ cc_library_shared { "libvndksupport", "android.hardware.configstore@1.0", "android.hardware.configstore-utils", "libbase", "libhidlbase", "libhidltransport", "libnativebridge", "libnativeloader", "libutils", ], static_libs: [ Loading opengl/libs/EGL/Loader.cpp +22 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #endif #include <vndksupport/linker.h> #include "egl_platform_entries.h" #include "egl_trace.h" #include "egldefs.h" Loading Loading @@ -237,12 +238,12 @@ void* Loader::open(egl_connection_t* cnx) setEmulatorGlesValue(); dso = load_driver("GLES", cnx, EGL | GLESv1_CM | GLESv2); dso = load_driver("GLES", cnx, EGL | GLESv1_CM | GLESv2 | PLATFORM); if (dso) { hnd = new driver_t(dso); } else { // Always load EGL first dso = load_driver("EGL", cnx, EGL); dso = load_driver("EGL", cnx, EGL | PLATFORM); if (dso) { hnd = new driver_t(dso); hnd->set( load_driver("GLESv1_CM", cnx, GLESv1_CM), GLESv1_CM ); Loading Loading @@ -623,6 +624,25 @@ void *Loader::load_driver(const char* kind, return nullptr; } if (mask & PLATFORM) { // For each entrypoint tracked by the platform char const* const* entries = platform_names; EGLFuncPointer* curr = reinterpret_cast<EGLFuncPointer*>(&cnx->platform); while (*entries) { const char* name = *entries; EGLFuncPointer f = FindPlatformImplAddr(name); if (f == nullptr) { // If no entry found, update the lookup table: sPlatformImplMap ALOGE("No entry found in platform lookup table for %s", name); } *curr++ = f; entries++; } } if (mask & EGL) { getProcAddress = (getProcAddressType)dlsym(dso, "eglGetProcAddress"); Loading Loading
libs/graphicsenv/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ cc_library_shared { shared_libs: [ "liblog", "libcutils", ], export_include_dirs: ["include"], Loading
libs/graphicsenv/GraphicsEnv.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -18,9 +18,12 @@ #define LOG_TAG "GraphicsEnv" #include <graphicsenv/GraphicsEnv.h> #include <sys/prctl.h> #include <mutex> #include <android/dlext.h> #include <cutils/properties.h> #include <log/log.h> // TODO(b/37049319) Get this from a header once one exists Loading @@ -46,6 +49,14 @@ namespace android { return env; } int GraphicsEnv::getCanLoadSystemLibraries() { if (property_get_bool("ro.debuggable", false) && prctl(PR_GET_DUMPABLE, 0, 0, 0, 0)) { // Return an integer value since this crosses library boundaries return 1; } return 0; } void GraphicsEnv::setDriverPath(const std::string path) { if (!mDriverPath.empty()) { ALOGV("ignoring attempt to change driver path from '%s' to '%s'", Loading Loading @@ -181,4 +192,10 @@ bool android_getAngleDeveloperOptIn() { const char* android_getAngleAppPref() { return android::GraphicsEnv::getInstance().getAngleAppPref(); } const char* android_getLayerPaths() { return android::GraphicsEnv::getInstance().getLayerPaths().c_str(); } const char* android_getDebugLayers() { return android::GraphicsEnv::getInstance().getDebugLayers().c_str(); } }
libs/graphicsenv/include/graphicsenv/GraphicsEnv.h +9 −5 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ class GraphicsEnv { public: static GraphicsEnv& getInstance(); int getCanLoadSystemLibraries(); // Set a search path for loading graphics drivers. The path is a list of // directories separated by ':'. A directory can be contained in a zip file // (drivers must be stored uncompressed and page aligned); such elements Loading Loading @@ -90,6 +92,8 @@ android_namespace_t* android_getAngleNamespace(); const char* android_getAngleAppName(); const char* android_getAngleAppPref(); bool android_getAngleDeveloperOptIn(); const char* android_getLayerPaths(); const char* android_getDebugLayers(); } #endif // ANDROID_UI_GRAPHICS_ENV_H
opengl/libs/Android.bp +5 −0 Original line number Diff line number Diff line Loading @@ -140,8 +140,10 @@ cc_library_shared { "EGL/egl_cache.cpp", "EGL/egl_display.cpp", "EGL/egl_object.cpp", "EGL/egl_layers.cpp", "EGL/egl.cpp", "EGL/eglApi.cpp", "EGL/egl_platform_entries.cpp", "EGL/Loader.cpp", "EGL/egl_angle_platform.cpp", ], Loading @@ -149,8 +151,11 @@ cc_library_shared { "libvndksupport", "android.hardware.configstore@1.0", "android.hardware.configstore-utils", "libbase", "libhidlbase", "libhidltransport", "libnativebridge", "libnativeloader", "libutils", ], static_libs: [ Loading
opengl/libs/EGL/Loader.cpp +22 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #endif #include <vndksupport/linker.h> #include "egl_platform_entries.h" #include "egl_trace.h" #include "egldefs.h" Loading Loading @@ -237,12 +238,12 @@ void* Loader::open(egl_connection_t* cnx) setEmulatorGlesValue(); dso = load_driver("GLES", cnx, EGL | GLESv1_CM | GLESv2); dso = load_driver("GLES", cnx, EGL | GLESv1_CM | GLESv2 | PLATFORM); if (dso) { hnd = new driver_t(dso); } else { // Always load EGL first dso = load_driver("EGL", cnx, EGL); dso = load_driver("EGL", cnx, EGL | PLATFORM); if (dso) { hnd = new driver_t(dso); hnd->set( load_driver("GLESv1_CM", cnx, GLESv1_CM), GLESv1_CM ); Loading Loading @@ -623,6 +624,25 @@ void *Loader::load_driver(const char* kind, return nullptr; } if (mask & PLATFORM) { // For each entrypoint tracked by the platform char const* const* entries = platform_names; EGLFuncPointer* curr = reinterpret_cast<EGLFuncPointer*>(&cnx->platform); while (*entries) { const char* name = *entries; EGLFuncPointer f = FindPlatformImplAddr(name); if (f == nullptr) { // If no entry found, update the lookup table: sPlatformImplMap ALOGE("No entry found in platform lookup table for %s", name); } *curr++ = f; entries++; } } if (mask & EGL) { getProcAddress = (getProcAddressType)dlsym(dso, "eglGetProcAddress"); Loading