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

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

Merge "Change CacheManager to not flush and submit at end of trimMemory." into sc-dev

parents 02151de4 41ef5662
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -101,7 +101,8 @@ void CacheManager::trimMemory(TrimMemoryMode mode) {
        return;
    }

    mGrContext->flushAndSubmit();
    // flush and submit all work to the gpu and wait for it to finish
    mGrContext->flushAndSubmit(/*syncCpu=*/true);

    switch (mode) {
        case TrimMemoryMode::Complete:
@@ -119,11 +120,6 @@ void CacheManager::trimMemory(TrimMemoryMode mode) {
            SkGraphics::SetFontCacheLimit(mMaxCpuFontCacheBytes);
            break;
    }

    // We must sync the cpu to make sure deletions of resources still queued up on the GPU actually
    // happen.
    mGrContext->flush({});
    mGrContext->submit(true);
}

void CacheManager::trimStaleResources() {