summaryrefslogtreecommitdiff
path: root/libs/graphicsenv/GraphicsEnv.cpp
diff options
context:
space:
mode:
author Tim Van Patten <timvp@google.com> 2019-02-08 10:16:40 -0700
committer Tim Van Patten <timvp@google.com> 2019-02-12 13:53:40 -0700
commit8bd24e969e831a5c86458d33f10eb8981c850842 (patch)
tree6dd24be0dbc718b7af05d4e44e795e29e6417fff /libs/graphicsenv/GraphicsEnv.cpp
parent1603cc25a633eda3e11ffffe90c39fde7323471a (diff)
ANGLE In Use Dialog Box
When ANGLE is enabled for an app, show a dialog box to the user to indicate that ANGLE is in use. This is useful because there are not (or at least shouldn't be) any visual indication that a different OpenGL driver is in use. Bug: 120489005 Test: atest CtsAngleIntegrationHostTestCases Test: Load an app with ANGLE enabled and verify dialog box is shown. Test: Load an app without ANGLE and verify dialog box is not shown. Change-Id: I5d667707841458b4ef63c9f4a5bc07e30cb7c786
Diffstat (limited to 'libs/graphicsenv/GraphicsEnv.cpp')
-rw-r--r--libs/graphicsenv/GraphicsEnv.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/libs/graphicsenv/GraphicsEnv.cpp b/libs/graphicsenv/GraphicsEnv.cpp
index c20d54b7f2..3b42f8093b 100644
--- a/libs/graphicsenv/GraphicsEnv.cpp
+++ b/libs/graphicsenv/GraphicsEnv.cpp
@@ -316,28 +316,28 @@ bool GraphicsEnv::shouldUseAngle() {
return false;
}
- return mUseAngle;
+ return (mUseAngle == YES) ? true : false;
}
void GraphicsEnv::updateUseAngle() {
- mUseAngle = false;
+ mUseAngle = NO;
const char* ANGLE_PREFER_ANGLE = "angle";
const char* ANGLE_PREFER_NATIVE = "native";
if (mAngleDeveloperOptIn == ANGLE_PREFER_ANGLE) {
ALOGV("User set \"Developer Options\" to force the use of ANGLE");
- mUseAngle = true;
+ mUseAngle = YES;
} else if (mAngleDeveloperOptIn == ANGLE_PREFER_NATIVE) {
ALOGV("User set \"Developer Options\" to force the use of Native");
- mUseAngle = false;
+ mUseAngle = NO;
} else {
// The "Developer Options" value wasn't set to force the use of ANGLE. Need to temporarily
// load ANGLE and call the updatable opt-in/out logic:
void* featureSo = loadLibrary("feature_support");
if (featureSo) {
ALOGV("loaded ANGLE's opt-in/out logic from namespace");
- mUseAngle = checkAngleRules(featureSo);
+ mUseAngle = checkAngleRules(featureSo) ? YES : NO;
dlclose(featureSo);
featureSo = nullptr;
} else {
@@ -349,6 +349,13 @@ void GraphicsEnv::updateUseAngle() {
void GraphicsEnv::setAngleInfo(const std::string path, const std::string appName,
const std::string developerOptIn, const int rulesFd,
const long rulesOffset, const long rulesLength) {
+ if (mUseAngle != UNKNOWN) {
+ // We've already figured out an answer for this app, so just return.
+ ALOGV("Already evaluated the rules file for '%s': use ANGLE = %s", appName.c_str(),
+ (mUseAngle == YES) ? "true" : "false");
+ return;
+ }
+
ALOGV("setting ANGLE path to '%s'", path.c_str());
mAnglePath = path;
ALOGV("setting ANGLE app name to '%s'", appName.c_str());