summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tim Van Patten <timvp@google.com> 2025-01-03 22:54:05 +0000
committer Tim Van Patten <timvp@google.com> 2025-01-03 22:58:43 +0000
commitca7ced38ae324f1f2e81559aaf302bf974e2b366 (patch)
tree8cd684809bc116c005712da388b102dc131a28bf
parent38a4ab9f6e7a58abefb2f4f0f2672f1cf51885bd (diff)
Cleanup GraphicsEnv::setAngleInfo()
Cleanup some minor nits and performance issues in GraphicsEnv::setAngleInfo(): 1. Make the paramater `eglFeatures` a reference. * This avoids the copy of the std::vector that's currently done every function call. 2. Remove `std::move()` calls on `const` values. * std::move() has no effect on const values, resulting in a copy anyway. Bug: 372694741 Test: CQ Change-Id: Id774e8c5aa06b966d04213251c195055e271687b
-rw-r--r--libs/graphicsenv/GraphicsEnv.cpp8
-rw-r--r--libs/graphicsenv/include/graphicsenv/GraphicsEnv.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/libs/graphicsenv/GraphicsEnv.cpp b/libs/graphicsenv/GraphicsEnv.cpp
index a8d5fe7371..4874dbde9c 100644
--- a/libs/graphicsenv/GraphicsEnv.cpp
+++ b/libs/graphicsenv/GraphicsEnv.cpp
@@ -596,7 +596,7 @@ bool GraphicsEnv::shouldUseAngle() {
// If path is set to nonempty and shouldUseNativeDriver is true, ANGLE will be used regardless.
void GraphicsEnv::setAngleInfo(const std::string& path, const bool shouldUseNativeDriver,
const std::string& packageName,
- const std::vector<std::string> eglFeatures) {
+ const std::vector<std::string>& eglFeatures) {
if (mShouldUseAngle) {
// ANGLE is already set up for this application process, even if the application
// needs to switch from apk to system or vice versa, the application process must
@@ -606,11 +606,11 @@ void GraphicsEnv::setAngleInfo(const std::string& path, const bool shouldUseNati
return;
}
- mAngleEglFeatures = std::move(eglFeatures);
+ mAngleEglFeatures = eglFeatures;
ALOGV("setting ANGLE path to '%s'", path.c_str());
- mAnglePath = std::move(path);
+ mAnglePath = path;
ALOGV("setting app package name to '%s'", packageName.c_str());
- mPackageName = std::move(packageName);
+ mPackageName = packageName;
if (mAnglePath == "system") {
mShouldUseSystemAngle = true;
}
diff --git a/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h b/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h
index b0ab0b9d22..452e48bb75 100644
--- a/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h
+++ b/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h
@@ -114,7 +114,7 @@ public:
// If shouldUseNativeDriver is true, it means native GLES drivers must be used for the process.
// If path is set to nonempty and shouldUseNativeDriver is true, ANGLE will be used regardless.
void setAngleInfo(const std::string& path, const bool shouldUseNativeDriver,
- const std::string& packageName, const std::vector<std::string> eglFeatures);
+ const std::string& packageName, const std::vector<std::string>& eglFeatures);
// Get the ANGLE driver namespace.
android_namespace_t* getAngleNamespace();
// Get the app package name.