Drop all caches in UI_HIDDEN

Bug: 137853925
Test: none
Change-Id: Idf7002d9b07cc6b71b38ce76e7b6382100279a99
This commit is contained in:
John Reck
2019-10-04 13:30:51 -07:00
parent 781630e4b4
commit 8a207962ec
2 changed files with 4 additions and 4 deletions

View File

@@ -135,7 +135,7 @@ void CacheManager::trimStaleResources() {
return;
}
mGrContext->flush();
mGrContext->purgeResourcesNotUsedInMs(std::chrono::seconds(30));
mGrContext->performDeferredCleanup(std::chrono::seconds(30));
}
sp<skiapipeline::VectorDrawableAtlas> CacheManager::acquireVectorDrawableAtlas() {

View File

@@ -646,11 +646,11 @@ void CanvasContext::trimMemory(RenderThread& thread, int level) {
ATRACE_CALL();
if (!thread.getGrContext()) return;
ATRACE_CALL();
if (level >= TRIM_MEMORY_COMPLETE) {
if (level >= TRIM_MEMORY_UI_HIDDEN) {
thread.cacheManager().trimMemory(CacheManager::TrimMemoryMode::Complete);
}
if (level >= TRIM_MEMORY_COMPLETE) {
thread.destroyRenderingContext();
} else if (level >= TRIM_MEMORY_UI_HIDDEN) {
thread.cacheManager().trimMemory(CacheManager::TrimMemoryMode::UiHidden);
}
}