Update skia flush call APIs.

Test: manual
Change-Id: I72fa57b04f1b4ea594063ddb4ce6af9507b1fcdb
diff --git a/libs/hwui/renderthread/CacheManager.cpp b/libs/hwui/renderthread/CacheManager.cpp
index d177855..2bd52d4 100644
--- a/libs/hwui/renderthread/CacheManager.cpp
+++ b/libs/hwui/renderthread/CacheManager.cpp
@@ -101,7 +101,7 @@
         return;
     }
 
-    mGrContext->flush();
+    mGrContext->flushAndSubmit();
 
     switch (mode) {
         case TrimMemoryMode::Complete:
@@ -122,14 +122,17 @@
 
     // 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));
 }