summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2020-04-27 17:51:44 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-04-27 17:51:44 +0000
commit0f1eb7d4517a207d06ce64e4ad8cacda219ca11b (patch)
treeda6973db8dce047dc249b6ce959ffc5374b4d849
parent2a6961746d67c1ec55fdbc8820d5a8cad6176163 (diff)
parent09d2771d37822f3450e097f02383986da664ef8a (diff)
Merge changes I9ea20221,I81b7546c into rvc-dev
* changes: Clean up egl_connection_t::shouldUseAngle Remove unused egl_connection_t::angleDecided
-rw-r--r--opengl/libs/EGL/Loader.cpp24
-rw-r--r--opengl/libs/EGL/egldefs.h2
2 files changed, 6 insertions, 20 deletions
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
index e19802b32f..39bf329e81 100644
--- a/opengl/libs/EGL/Loader.cpp
+++ b/opengl/libs/EGL/Loader.cpp
@@ -222,13 +222,6 @@ void* Loader::open(egl_connection_t* cnx)
return cnx->dso;
}
- // Check if we should use ANGLE early, so loading each driver doesn't require repeated queries.
- if (android::GraphicsEnv::getInstance().shouldUseAngle()) {
- cnx->shouldUseAngle = true;
- } else {
- cnx->shouldUseAngle = false;
- }
-
// Firstly, try to load ANGLE driver.
driver_t* hnd = attempt_to_load_angle(cnx);
if (!hnd) {
@@ -317,8 +310,6 @@ void Loader::close(egl_connection_t* cnx)
delete hnd;
cnx->dso = nullptr;
- cnx->shouldUseAngle = false;
- cnx->angleDecided = false;
cnx->useAngle = false;
if (cnx->vendorEGL) {
@@ -512,14 +503,7 @@ static void* load_angle_from_namespace(const char* kind, android_namespace_t* ns
}
static void* load_angle(const char* kind, android_namespace_t* ns, egl_connection_t* cnx) {
- void* so = nullptr;
-
- if ((cnx->shouldUseAngle) || android::GraphicsEnv::getInstance().shouldUseAngle()) {
- so = load_angle_from_namespace(kind, ns);
- cnx->shouldUseAngle = true;
- } else {
- cnx->shouldUseAngle = false;
- }
+ void* so = load_angle_from_namespace(kind, ns);
if (so) {
ALOGV("Loaded ANGLE %s library for '%s' (instead of native)", kind,
@@ -569,7 +553,6 @@ static void* load_angle(const char* kind, android_namespace_t* ns, egl_connectio
android::GraphicsEnv::getInstance().getAngleAppName().c_str());
cnx->useAngle = false;
}
- cnx->angleDecided = true;
return so;
}
@@ -597,6 +580,11 @@ static void* load_updated_driver(const char* kind, android_namespace_t* ns) {
Loader::driver_t* Loader::attempt_to_load_angle(egl_connection_t* cnx) {
ATRACE_CALL();
+
+ if (!android::GraphicsEnv::getInstance().shouldUseAngle()) {
+ return nullptr;
+ }
+
android_namespace_t* ns = android::GraphicsEnv::getInstance().getAngleNamespace();
if (!ns) {
return nullptr;
diff --git a/opengl/libs/EGL/egldefs.h b/opengl/libs/EGL/egldefs.h
index 7bb9b59ea4..18a39497d1 100644
--- a/opengl/libs/EGL/egldefs.h
+++ b/opengl/libs/EGL/egldefs.h
@@ -81,8 +81,6 @@ struct egl_connection_t {
void* libGles2;
bool systemDriverUnloaded;
- bool shouldUseAngle; // Should we attempt to load ANGLE
- bool angleDecided; // Have we tried to load ANGLE
bool useAngle; // Was ANGLE successfully loaded
EGLint angleBackend;
void* vendorEGL;