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

Commit 50098249 authored by Tim Van Patten's avatar Tim Van Patten Committed by Android (Google) Code Review
Browse files

Merge "GraphicsEnv: Get feature overrides from GpuService" into main

parents 15769b52 8bba22be
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.