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

Commit 98ad5102 authored by Cody Northrop's avatar Cody Northrop Committed by Android (Google) Code Review
Browse files

Merge "EGL BlobCache: Support multifile cache and flexible size limit"

parents fee18635 c4524997
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -569,6 +569,14 @@ void GraphicsEnv::setDebugLayersGLES(const std::string layers) {
    mDebugLayersGLES = layers;
}

int64_t GraphicsEnv::getBlobCacheQuotaBytes() {
    return mBlobCacheQuotaBytes;
}

void GraphicsEnv::setBlobCacheQuotaBytes(int64_t cacheBytes) {
    mBlobCacheQuotaBytes = cacheBytes;
}

// Return true if all the required libraries from vndk and sphal namespace are
// linked to the updatable gfx driver namespace correctly.
bool GraphicsEnv::linkDriverNamespaceLocked(android_namespace_t* vndkNamespace) {
+5 −0
Original line number Diff line number Diff line
@@ -143,6 +143,9 @@ public:
    // Get the debug layers to load.
    const std::string& getDebugLayersGLES();

    int64_t getBlobCacheQuotaBytes();
    void setBlobCacheQuotaBytes(int64_t cacheBytes);

private:
    enum UseAngle { UNKNOWN, YES, NO };

@@ -188,6 +191,8 @@ private:
    std::string mDebugLayersGLES;
    // Additional debug layers search path.
    std::string mLayerPaths;
    // Blob cache quota bytes
    int64_t mBlobCacheQuotaBytes;
    // This mutex protects the namespace creation.
    std::mutex mNamespaceMutex;
    // Updatable driver namespace.
+1 −0
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@ cc_library_shared {
    srcs: [
        "EGL/egl_tls.cpp",
        "EGL/egl_cache.cpp",
        "EGL/egl_cache_multifile.cpp",
        "EGL/egl_display.cpp",
        "EGL/egl_object.cpp",
        "EGL/egl_layers.cpp",
+6 −0
Original line number Diff line number Diff line
@@ -185,4 +185,10 @@ void FileBlobCache::writeToFile() {
    }
}

size_t FileBlobCache::getSize() {
    if (mFilename.length() > 0) {
        return getFlattenedSize() + cacheFileHeaderSize;
    }
    return 0;
}
}
+3 −0
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@ public:
    // disk.
    void writeToFile();

    // Return the total size of the cache
    size_t getSize();

private:
    // mFilename is the name of the file for storing cache contents.
    std::string mFilename;
Loading