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

Commit 328ff437 authored by Tim Murray's avatar Tim Murray
Browse files

hwui: change TRIM_COMPLETE to TRIM_BACKGROUND

In preparation for lifecycle-consistent TRIM_MEMORY callbacks, be more
aggressive with TRIM_BACKGROUND.

Test: android.platform.test.scenario.launcher.FlingAllAppsMicrobenchmark
Bug: 253914117
Change-Id: I4c8b3331312f198dbf3f74495b8412873d1ca302
parent 6555162b
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -117,12 +117,8 @@ void CacheManager::trimMemory(TrimLevel mode) {
    // flush and submit all work to the gpu and wait for it to finish
    mGrContext->flushAndSubmit(/*syncCpu=*/true);

    if (!Properties::isHighEndGfx && mode >= TrimLevel::MODERATE) {
        mode = TrimLevel::COMPLETE;
    }

    switch (mode) {
        case TrimLevel::COMPLETE:
        case TrimLevel::BACKGROUND:
            mGrContext->freeGpuResources();
            SkGraphics::PurgeAllCaches();
            mRenderThread.destroyRenderingContext();