summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/CacheManager.cpp
diff options
context:
space:
mode:
authorScott Lobdell <slobdell@google.com>2021-02-23 11:55:26 -0800
committerDaniel Norman <danielnorman@google.com>2021-03-01 15:24:51 -0800
commit24818fca475a6726f5ef0cae42149615079af6e9 (patch)
tree1a3163ac7ce01c335d8d1c05cacddf47c0a30bfd /libs/hwui/renderthread/CacheManager.cpp
parent8deb6bda58c7ecd95285f4dc934269e0c98c989a (diff)
parent0f50c486e59546c32acf3f2cdf6667897600de5c (diff)
Merge SP1A.210222.001
Change-Id: If3509f3a660e820f4c8c0b29e007faa868e1f089
Diffstat (limited to 'libs/hwui/renderthread/CacheManager.cpp')
-rw-r--r--libs/hwui/renderthread/CacheManager.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/libs/hwui/renderthread/CacheManager.cpp b/libs/hwui/renderthread/CacheManager.cpp
index 85924c5e8939..d998e5031984 100644
--- a/libs/hwui/renderthread/CacheManager.cpp
+++ b/libs/hwui/renderthread/CacheManager.cpp
@@ -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() {