Loading opengl/libs/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ cc_defaults { "libgraphicsenv", "libnativewindow", "libbacktrace", "libbase", ], target: { vendor: { Loading opengl/libs/EGL/BlobCache.cpp +10 −10 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ #include <errno.h> #include <inttypes.h> #include <cutils/properties.h> #include <android-base/properties.h> #include <log/log.h> #include <chrono> Loading Loading @@ -165,7 +165,8 @@ static inline size_t align4(size_t size) { } size_t BlobCache::getFlattenedSize() const { size_t size = align4(sizeof(Header) + PROPERTY_VALUE_MAX); auto buildId = base::GetProperty("ro.build.id", ""); size_t size = align4(sizeof(Header) + buildId.size()); for (const CacheEntry& e : mCacheEntries) { std::shared_ptr<Blob> const& keyBlob = e.getKey(); std::shared_ptr<Blob> const& valueBlob = e.getValue(); Loading @@ -185,9 +186,9 @@ int BlobCache::flatten(void* buffer, size_t size) const { header->mBlobCacheVersion = blobCacheVersion; header->mDeviceVersion = blobCacheDeviceVersion; header->mNumEntries = mCacheEntries.size(); char buildId[PROPERTY_VALUE_MAX]; header->mBuildIdLength = property_get("ro.build.id", buildId, ""); memcpy(header->mBuildId, buildId, header->mBuildIdLength); auto buildId = base::GetProperty("ro.build.id", ""); header->mBuildIdLength = buildId.size(); memcpy(header->mBuildId, buildId.c_str(), header->mBuildIdLength); // Write cache entries uint8_t* byteBuffer = reinterpret_cast<uint8_t*>(buffer); Loading Loading @@ -238,12 +239,11 @@ int BlobCache::unflatten(void const* buffer, size_t size) { ALOGE("unflatten: bad magic number: %" PRIu32, header->mMagicNumber); return -EINVAL; } char buildId[PROPERTY_VALUE_MAX]; int len = property_get("ro.build.id", buildId, ""); auto buildId = base::GetProperty("ro.build.id", ""); if (header->mBlobCacheVersion != blobCacheVersion || header->mDeviceVersion != blobCacheDeviceVersion || len != header->mBuildIdLength || strncmp(buildId, header->mBuildId, len)) { buildId.size() != header->mBuildIdLength || strncmp(buildId.c_str(), header->mBuildId, buildId.size())) { // We treat version mismatches as an empty cache. return 0; } Loading opengl/libs/EGL/Loader.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -24,8 +24,8 @@ #include <dirent.h> #include <dlfcn.h> #include <android-base/properties.h> #include <android/dlext.h> #include <cutils/properties.h> #include <log/log.h> #include <utils/Timers.h> Loading Loading @@ -241,12 +241,12 @@ void* Loader::open(egl_connection_t* cnx) // i.e.: // libGLES_${prop}.so, or: // libEGL_${prop}.so, libGLESv1_CM_${prop}.so, libGLESv2_${prop}.so char prop[PROPERTY_VALUE_MAX + 1]; for (auto key : HAL_SUBNAME_KEY_PROPERTIES) { if (property_get(key, prop, nullptr) <= 0) { auto prop = base::GetProperty(key, ""); if (prop.empty()) { continue; } hnd = attempt_to_load_system_driver(cnx, prop, true); hnd = attempt_to_load_system_driver(cnx, prop.c_str(), true); if (hnd) { break; } else if (strcmp(key, DRIVER_SUFFIX_PROPERTY) == 0) { Loading Loading @@ -510,9 +510,9 @@ static void* load_updated_driver(const char* kind, android_namespace_t* ns) { .library_namespace = ns, }; void* so = nullptr; char prop[PROPERTY_VALUE_MAX + 1]; for (auto key : HAL_SUBNAME_KEY_PROPERTIES) { if (property_get(key, prop, nullptr) <= 0) { auto prop = base::GetProperty(key, ""); if (prop.empty()) { continue; } std::string name = std::string("lib") + kind + "_" + prop + ".so"; Loading opengl/libs/EGL/egl.cpp +3 −7 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ #include <EGL/egl.h> #include <cutils/properties.h> #include <android-base/properties.h> #include <log/log.h> Loading Loading @@ -58,9 +58,7 @@ static int gl_no_context() { } else { LOG_ALWAYS_FATAL(error); } char value[PROPERTY_VALUE_MAX]; property_get("debug.egl.callstack", value, "0"); if (atoi(value)) { if (base::GetBoolProperty("debug.egl.callstack", false)) { CallStack::log(LOG_TAG); } } Loading Loading @@ -224,9 +222,7 @@ void gl_unimplemented() { pthread_mutex_unlock(&sLogPrintMutex); if (printLog) { ALOGE("called unimplemented OpenGL ES API"); char value[PROPERTY_VALUE_MAX]; property_get("debug.egl.callstack", value, "0"); if (atoi(value)) { if (base::GetBoolProperty("debug.egl.callstack", false)) { CallStack::log(LOG_TAG); } } Loading opengl/libs/EGL/egl_angle_platform.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ #if defined(__ANDROID__) #include <cutils/properties.h> #include "Loader.h" #include "egl_angle_platform.h" Loading Loading
opengl/libs/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ cc_defaults { "libgraphicsenv", "libnativewindow", "libbacktrace", "libbase", ], target: { vendor: { Loading
opengl/libs/EGL/BlobCache.cpp +10 −10 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ #include <errno.h> #include <inttypes.h> #include <cutils/properties.h> #include <android-base/properties.h> #include <log/log.h> #include <chrono> Loading Loading @@ -165,7 +165,8 @@ static inline size_t align4(size_t size) { } size_t BlobCache::getFlattenedSize() const { size_t size = align4(sizeof(Header) + PROPERTY_VALUE_MAX); auto buildId = base::GetProperty("ro.build.id", ""); size_t size = align4(sizeof(Header) + buildId.size()); for (const CacheEntry& e : mCacheEntries) { std::shared_ptr<Blob> const& keyBlob = e.getKey(); std::shared_ptr<Blob> const& valueBlob = e.getValue(); Loading @@ -185,9 +186,9 @@ int BlobCache::flatten(void* buffer, size_t size) const { header->mBlobCacheVersion = blobCacheVersion; header->mDeviceVersion = blobCacheDeviceVersion; header->mNumEntries = mCacheEntries.size(); char buildId[PROPERTY_VALUE_MAX]; header->mBuildIdLength = property_get("ro.build.id", buildId, ""); memcpy(header->mBuildId, buildId, header->mBuildIdLength); auto buildId = base::GetProperty("ro.build.id", ""); header->mBuildIdLength = buildId.size(); memcpy(header->mBuildId, buildId.c_str(), header->mBuildIdLength); // Write cache entries uint8_t* byteBuffer = reinterpret_cast<uint8_t*>(buffer); Loading Loading @@ -238,12 +239,11 @@ int BlobCache::unflatten(void const* buffer, size_t size) { ALOGE("unflatten: bad magic number: %" PRIu32, header->mMagicNumber); return -EINVAL; } char buildId[PROPERTY_VALUE_MAX]; int len = property_get("ro.build.id", buildId, ""); auto buildId = base::GetProperty("ro.build.id", ""); if (header->mBlobCacheVersion != blobCacheVersion || header->mDeviceVersion != blobCacheDeviceVersion || len != header->mBuildIdLength || strncmp(buildId, header->mBuildId, len)) { buildId.size() != header->mBuildIdLength || strncmp(buildId.c_str(), header->mBuildId, buildId.size())) { // We treat version mismatches as an empty cache. return 0; } Loading
opengl/libs/EGL/Loader.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -24,8 +24,8 @@ #include <dirent.h> #include <dlfcn.h> #include <android-base/properties.h> #include <android/dlext.h> #include <cutils/properties.h> #include <log/log.h> #include <utils/Timers.h> Loading Loading @@ -241,12 +241,12 @@ void* Loader::open(egl_connection_t* cnx) // i.e.: // libGLES_${prop}.so, or: // libEGL_${prop}.so, libGLESv1_CM_${prop}.so, libGLESv2_${prop}.so char prop[PROPERTY_VALUE_MAX + 1]; for (auto key : HAL_SUBNAME_KEY_PROPERTIES) { if (property_get(key, prop, nullptr) <= 0) { auto prop = base::GetProperty(key, ""); if (prop.empty()) { continue; } hnd = attempt_to_load_system_driver(cnx, prop, true); hnd = attempt_to_load_system_driver(cnx, prop.c_str(), true); if (hnd) { break; } else if (strcmp(key, DRIVER_SUFFIX_PROPERTY) == 0) { Loading Loading @@ -510,9 +510,9 @@ static void* load_updated_driver(const char* kind, android_namespace_t* ns) { .library_namespace = ns, }; void* so = nullptr; char prop[PROPERTY_VALUE_MAX + 1]; for (auto key : HAL_SUBNAME_KEY_PROPERTIES) { if (property_get(key, prop, nullptr) <= 0) { auto prop = base::GetProperty(key, ""); if (prop.empty()) { continue; } std::string name = std::string("lib") + kind + "_" + prop + ".so"; Loading
opengl/libs/EGL/egl.cpp +3 −7 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ #include <EGL/egl.h> #include <cutils/properties.h> #include <android-base/properties.h> #include <log/log.h> Loading Loading @@ -58,9 +58,7 @@ static int gl_no_context() { } else { LOG_ALWAYS_FATAL(error); } char value[PROPERTY_VALUE_MAX]; property_get("debug.egl.callstack", value, "0"); if (atoi(value)) { if (base::GetBoolProperty("debug.egl.callstack", false)) { CallStack::log(LOG_TAG); } } Loading Loading @@ -224,9 +222,7 @@ void gl_unimplemented() { pthread_mutex_unlock(&sLogPrintMutex); if (printLog) { ALOGE("called unimplemented OpenGL ES API"); char value[PROPERTY_VALUE_MAX]; property_get("debug.egl.callstack", value, "0"); if (atoi(value)) { if (base::GetBoolProperty("debug.egl.callstack", false)) { CallStack::log(LOG_TAG); } } Loading
opengl/libs/EGL/egl_angle_platform.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ #if defined(__ANDROID__) #include <cutils/properties.h> #include "Loader.h" #include "egl_angle_platform.h" Loading