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

Commit 1ca25ba9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "GpuStats: track whether the app creates ES1 context"

parents 337513b7 011538f1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ status_t GpuStatsAppInfo::writeToParcel(Parcel* parcel) const {
    if ((status = parcel->writeInt64Vector(angleDriverLoadingTime)) != OK) return status;
    if ((status = parcel->writeBool(cpuVulkanInUse)) != OK) return status;
    if ((status = parcel->writeBool(falsePrerotation)) != OK) return status;
    if ((status = parcel->writeBool(gles1InUse)) != OK) return status;
    return OK;
}

@@ -99,6 +100,7 @@ status_t GpuStatsAppInfo::readFromParcel(const Parcel* parcel) {
    if ((status = parcel->readInt64Vector(&angleDriverLoadingTime)) != OK) return status;
    if ((status = parcel->readBool(&cpuVulkanInUse)) != OK) return status;
    if ((status = parcel->readBool(&falsePrerotation)) != OK) return status;
    if ((status = parcel->readBool(&gles1InUse)) != OK) return status;
    return OK;
}

@@ -108,6 +110,7 @@ std::string GpuStatsAppInfo::toString() const {
    StringAppendF(&result, "driverVersionCode = %" PRIu64 "\n", driverVersionCode);
    StringAppendF(&result, "cpuVulkanInUse = %d\n", cpuVulkanInUse);
    StringAppendF(&result, "falsePrerotation = %d\n", falsePrerotation);
    StringAppendF(&result, "gles1InUse = %d\n", gles1InUse);
    result.append("glDriverLoadingTime:");
    for (int32_t loadingTime : glDriverLoadingTime) {
        StringAppendF(&result, " %d", loadingTime);
+2 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ public:
    std::vector<int64_t> angleDriverLoadingTime = {};
    bool cpuVulkanInUse = false;
    bool falsePrerotation = false;
    bool gles1InUse = false;
};

/*
@@ -95,6 +96,7 @@ public:
    enum Stats {
        CPU_VULKAN_IN_USE = 0,
        FALSE_PREROTATION = 1,
        GLES_1_IN_USE = 2,
    };

    GpuStatsInfo() = default;
+2 −0
Original line number Diff line number Diff line
@@ -984,6 +984,8 @@ EGLContext eglCreateContextImpl(EGLDisplay dpy, EGLConfig config,
                    if (attr == EGL_CONTEXT_CLIENT_VERSION) {
                        if (value == 1) {
                            version = egl_connection_t::GLESv1_INDEX;
                            android::GraphicsEnv::getInstance().setTargetStats(
                                    android::GpuStatsInfo::Stats::GLES_1_IN_USE);
                        } else if (value == 2 || value == 3) {
                            version = egl_connection_t::GLESv2_INDEX;
                        }
+3 −0
Original line number Diff line number Diff line
@@ -145,6 +145,9 @@ void GpuStats::insertTargetStats(const std::string& appPackageName,
        case GpuStatsInfo::Stats::FALSE_PREROTATION:
            mAppStats[appStatsKey].falsePrerotation = true;
            break;
        case GpuStatsInfo::Stats::GLES_1_IN_USE:
            mAppStats[appStatsKey].gles1InUse = true;
            break;
        default:
            break;
    }