Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8bba22be authored by Tim Van Patten's avatar Tim Van Patten
Browse files

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
parent 7ad24b9b
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -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()) {
+1 −0
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ public:
    // Get the app package name.
    std::string& getPackageName();
    const std::vector<std::string>& getAngleEglFeatures();
    void updateAngleFeatureOverrides();
    void getAngleFeatureOverrides(std::vector<const char*>& enabled,
                                  std::vector<const char*>& disabled);
    // Set the persist.graphics.egl system property value.