summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2018-11-01 01:54:26 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-11-01 01:54:26 +0000
commit9ef3e962e148162c84fa250e8aea6c2567c282e6 (patch)
tree9092d1d8ef2d9aa58c7b686a609abdc95f435418
parent1dc3bd5d788a61caf6502725cb9356de10aed9b3 (diff)
parentee768c2d6775fa070b26e151e9c6a2cd7245ea49 (diff)
Merge "Clean up featuresutils library"
-rw-r--r--opengl/libs/EGL/Loader.cpp35
-rw-r--r--opengl/libs/EGL/Loader.h2
-rw-r--r--opengl/libs/EGL/egl_display.cpp3
-rw-r--r--opengl/libs/EGL/egldefs.h1
4 files changed, 23 insertions, 18 deletions
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
index 922be02cda..3d1eb14d06 100644
--- a/opengl/libs/EGL/Loader.cpp
+++ b/opengl/libs/EGL/Loader.cpp
@@ -275,10 +275,24 @@ void* Loader::open(egl_connection_t* cnx)
return (void*)hnd;
}
-void Loader::close(void* driver)
+void Loader::close(egl_connection_t* cnx)
{
- driver_t* hnd = (driver_t*)driver;
+ driver_t* hnd = (driver_t*) cnx->dso;
delete hnd;
+ cnx->dso = nullptr;
+
+ if (cnx->featureSo) {
+ dlclose(cnx->featureSo);
+ cnx->featureSo = nullptr;
+ }
+
+ cnx->angleDecided = false;
+ cnx->useAngle = false;
+
+ if (cnx->vendorEGL) {
+ dlclose(cnx->vendorEGL);
+ cnx->vendorEGL = nullptr;
+ }
}
void Loader::init_api(void* dso,
@@ -553,15 +567,9 @@ static void* load_angle(const char* kind, android_namespace_t* ns, egl_connectio
property_get("ro.product.manufacturer", manufacturer, "UNSET");
property_get("ro.product.model", model, "UNSET");
- // Check if ANGLE is enabled. Workaround for b/118375731
- // We suspect that loading & unloading a library somehow corrupts
- // the process.
- property_get("debug.angle.enable", prop, "0");
- if (atoi(prop)) {
- so = load_angle_from_namespace("feature_support", ns);
- }
- if (so) {
- ALOGV("Temporarily loaded ANGLE's opt-in/out logic from namespace");
+ cnx->featureSo = load_angle_from_namespace("feature_support", ns);
+ if (cnx->featureSo) {
+ ALOGV("loaded ANGLE's opt-in/out logic from namespace");
bool use_version0_API = false;
bool use_version1_API = false;
fpANGLEGetUtilityAPI ANGLEGetUtilityAPI =
@@ -605,14 +613,11 @@ static void* load_angle(const char* kind, android_namespace_t* ns, egl_connectio
ALOGW("Cannot find ANGLEUseForApplication in library");
}
}
- ALOGV("Close temporarily-loaded ANGLE opt-in/out logic");
- dlclose(so);
- so = nullptr;
} else {
// We weren't able to load and call the updateable opt-in/out logic.
// If we can't load the library, there is no ANGLE available.
use_angle = false;
- ALOGV("Could not temporarily-load the ANGLE opt-in/out logic, cannot use ANGLE.");
+ ALOGV("Could not load the ANGLE opt-in/out logic, cannot use ANGLE.");
}
cnx->angleDecided = true;
}
diff --git a/opengl/libs/EGL/Loader.h b/opengl/libs/EGL/Loader.h
index 9cc73f376a..392887d42c 100644
--- a/opengl/libs/EGL/Loader.h
+++ b/opengl/libs/EGL/Loader.h
@@ -51,7 +51,7 @@ public:
~Loader();
void* open(egl_connection_t* cnx);
- void close(void* driver);
+ void close(egl_connection_t* cnx);
private:
Loader();
diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp
index 94af2e7bb0..7cf58b4eee 100644
--- a/opengl/libs/EGL/egl_display.cpp
+++ b/opengl/libs/EGL/egl_display.cpp
@@ -275,8 +275,7 @@ EGLDisplay egl_display_t::getPlatformDisplay(EGLNativeDisplayType display,
disp.dpy = dpy;
if (dpy == EGL_NO_DISPLAY) {
- loader.close(cnx->dso);
- cnx->dso = nullptr;
+ loader.close(cnx);
}
}
diff --git a/opengl/libs/EGL/egldefs.h b/opengl/libs/EGL/egldefs.h
index e19fa387bb..cca0053606 100644
--- a/opengl/libs/EGL/egldefs.h
+++ b/opengl/libs/EGL/egldefs.h
@@ -80,6 +80,7 @@ struct egl_connection_t {
bool useAngle;
EGLint angleBackend;
void* vendorEGL;
+ void* featureSo;
};
// clang-format on