diff options
author | Nader Jawad <njawad@google.com> | 2021-06-10 18:54:23 -0700 |
---|---|---|
committer | Nader Jawad <njawad@google.com> | 2021-06-15 10:14:04 -0700 |
commit | dd1fcab19a5d02eefd2b38baa680ab4dcef65071 (patch) | |
tree | 19a73a89bcd3b238a512450e3ab3894af4f667b2 /libs/hwui/renderthread/CacheManager.cpp | |
parent | 52a33adf572f099ed5d8b50285a5feb7309df927 (diff) |
Add logic to clean up resources more frequently
Added call to Skia's performDeferredCleanup method
to free resources that were not referenced within
the last 100 frames or 10 seconds whichever is
furthest away
Bug: 188450217
Test: manual
Change-Id: I3f37e1b5bd01330dbbc2da4a84b1259d56be2768
Diffstat (limited to 'libs/hwui/renderthread/CacheManager.cpp')
-rw-r--r-- | libs/hwui/renderthread/CacheManager.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/CacheManager.cpp b/libs/hwui/renderthread/CacheManager.cpp index 46e806081c0c..ded2b06fb3cf 100644 --- a/libs/hwui/renderthread/CacheManager.cpp +++ b/libs/hwui/renderthread/CacheManager.cpp @@ -210,6 +210,14 @@ void CacheManager::onFrameCompleted() { } } +void CacheManager::performDeferredCleanup(nsecs_t cleanupOlderThanMillis) { + if (mGrContext) { + mGrContext->performDeferredCleanup( + std::chrono::milliseconds(cleanupOlderThanMillis), + /* scratchResourcesOnly */true); + } +} + } /* namespace renderthread */ } /* namespace uirenderer */ } /* namespace android */ |