diff options
author | 2025-01-13 14:41:59 -0700 | |
---|---|---|
committer | 2025-02-19 10:04:14 -0700 | |
commit | 8bba22be40afdb7f7fcfd5a663be6fc0856c899e (patch) | |
tree | a9184d7d0b220c04e5596319c5a324ad055c7f1f /libs/graphicsenv/GraphicsEnv.cpp | |
parent | 7ad24b9b794b282aa25d28c42832fd50815f0816 (diff) |
GraphicsEnv: Get feature overrides from GpuService
Query GpuService for the latest ANGLE feature overrides and store them
in GraphicsEnv. This must be done separately, because Zygote cannot
perform Binder calls and GraphicsEnv must be able to handle being called
at Zygote creation and App launch. This also helps minimize the boot time
impact of this feature.
Bug: 372694741
Test: CQ, Manual verification
Flag: com.android.graphics.graphicsenv.flags.feature_overrides
Change-Id: I9bfd295e57593074262a77fc8e2abe91b5d18791
Diffstat (limited to 'libs/graphicsenv/GraphicsEnv.cpp')
-rw-r--r-- | libs/graphicsenv/GraphicsEnv.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/graphicsenv/GraphicsEnv.cpp b/libs/graphicsenv/GraphicsEnv.cpp index 4bc261106a..626581cc2a 100644 --- a/libs/graphicsenv/GraphicsEnv.cpp +++ b/libs/graphicsenv/GraphicsEnv.cpp @@ -621,6 +621,10 @@ void GraphicsEnv::setAngleInfo(const std::string& path, const bool shouldUseNati mShouldUseAngle = true; } mShouldUseNativeDriver = shouldUseNativeDriver; + + if (mShouldUseAngle) { + updateAngleFeatureOverrides(); + } } std::string& GraphicsEnv::getPackageName() { @@ -632,6 +636,22 @@ const std::vector<std::string>& GraphicsEnv::getAngleEglFeatures() { return mAngleEglFeatures; } +// List of ANGLE features to override (enabled or disable). +// The list of overrides is loaded and parsed by GpuService. +void GraphicsEnv::updateAngleFeatureOverrides() { + if (!graphicsenv_flags::feature_overrides()) { + return; + } + + const sp<IGpuService> gpuService = getGpuService(); + if (!gpuService) { + ALOGE("No GPU service"); + return; + } + + mFeatureOverrides = gpuService->getFeatureOverrides(); +} + void GraphicsEnv::getAngleFeatureOverrides(std::vector<const char*>& enabled, std::vector<const char*>& disabled) { if (!graphicsenv_flags::feature_overrides()) { |