summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/CacheManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/renderthread/CacheManager.cpp')
-rw-r--r--libs/hwui/renderthread/CacheManager.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/hwui/renderthread/CacheManager.cpp b/libs/hwui/renderthread/CacheManager.cpp
index d177855e5a7d..2bd52d4d8990 100644
--- a/libs/hwui/renderthread/CacheManager.cpp
+++ b/libs/hwui/renderthread/CacheManager.cpp
@@ -101,7 +101,7 @@ void CacheManager::trimMemory(TrimMemoryMode mode) {
return;
}
- mGrContext->flush();
+ mGrContext->flushAndSubmit();
switch (mode) {
case TrimMemoryMode::Complete:
@@ -122,14 +122,17 @@ void CacheManager::trimMemory(TrimMemoryMode mode) {
// We must sync the cpu to make sure deletions of resources still queued up on the GPU actually
// happen.
- mGrContext->flush(kSyncCpu_GrFlushFlag, 0, nullptr);
+ GrFlushInfo info;
+ info.fFlags = kSyncCpu_GrFlushFlag;
+ mGrContext->flush(info);
+ mGrContext->submit(true);
}
void CacheManager::trimStaleResources() {
if (!mGrContext) {
return;
}
- mGrContext->flush();
+ mGrContext->flushAndSubmit();
mGrContext->purgeResourcesNotUsedInMs(std::chrono::seconds(30));
}