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

Commit 2ccc7c7d authored by Solti Ho's avatar Solti Ho Committed by Automerger Merge Worker
Browse files

Merge "include system ANGLE usage as ANGLE usage" into main am: 5f66ad6c

parents 43f451c7 5f66ad6c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ public:
        GL_UPDATED = 2,
        VULKAN = 3,
        VULKAN_UPDATED = 4,
        ANGLE = 5,
        ANGLE = 5, // cover both system ANGLE and ANGLE APK
    };

    enum Stats {
+9 −1
Original line number Diff line number Diff line
@@ -591,6 +591,8 @@ Loader::driver_t* Loader::attempt_to_load_angle(egl_connection_t* cnx) {
        return nullptr;
    }

    // use ANGLE APK driver
    android::GraphicsEnv::getInstance().setDriverToLoad(android::GpuStatsInfo::Driver::ANGLE);
    driver_t* hnd = nullptr;

    // ANGLE doesn't ship with GLES library, and thus we skip GLES driver.
@@ -661,7 +663,13 @@ Loader::driver_t* Loader::attempt_to_load_updated_driver(egl_connection_t* cnx)
Loader::driver_t* Loader::attempt_to_load_system_driver(egl_connection_t* cnx, const char* suffix,
                                                        const bool exact) {
    ATRACE_CALL();
    if (suffix && strcmp(suffix, "angle") == 0) {
        // use system ANGLE driver
        android::GraphicsEnv::getInstance().setDriverToLoad(android::GpuStatsInfo::Driver::ANGLE);
    } else {
        android::GraphicsEnv::getInstance().setDriverToLoad(android::GpuStatsInfo::Driver::GL);
    }

    driver_t* hnd = nullptr;
    void* dso = load_system_driver("GLES", suffix, exact);
    if (dso) {
+4 −2
Original line number Diff line number Diff line
@@ -163,11 +163,13 @@ void GpuStats::insertDriverStats(const std::string& driverPackageName,
        addLoadingTime(driver, driverLoadingTime, &appInfo);
        appInfo.appPackageName = appPackageName;
        appInfo.driverVersionCode = driverVersionCode;
        appInfo.angleInUse = driverPackageName == "angle";
        appInfo.angleInUse =
                driver == GpuStatsInfo::Driver::ANGLE || driverPackageName == "angle";
        appInfo.lastAccessTime = std::chrono::system_clock::now();
        mAppStats.insert({appStatsKey, appInfo});
    } else {
        mAppStats[appStatsKey].angleInUse = driverPackageName == "angle";
        mAppStats[appStatsKey].angleInUse =
                driver == GpuStatsInfo::Driver::ANGLE || driverPackageName == "angle";
        addLoadingTime(driver, driverLoadingTime, &mAppStats[appStatsKey]);
        mAppStats[appStatsKey].lastAccessTime = std::chrono::system_clock::now();
    }