Just skip uninstantiated GrOps instead of delete them on flush.

Change-Id: I4e1755872979b635ad993cfba6b17d7b79ee2c54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238179
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrOpsTask.cpp b/src/gpu/GrOpsTask.cpp
index c06a7ae..69f5780 100644
--- a/src/gpu/GrOpsTask.cpp
+++ b/src/gpu/GrOpsTask.cpp
@@ -396,7 +396,7 @@
 
     // Loop over the ops that haven't yet been prepared.
     for (const auto& chain : fOpChains) {
-        if (chain.head()) {
+        if (chain.shouldExecute()) {
 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
             TRACE_EVENT0("skia.gpu", chain.head()->name());
 #endif
@@ -472,7 +472,7 @@
 
     // Draw all the generated geometry.
     for (const auto& chain : fOpChains) {
-        if (!chain.head()) {
+        if (!chain.shouldExecute()) {
             continue;
         }
 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
@@ -616,8 +616,7 @@
         hasUninstantiatedProxy = false;
         recordedOp.visitProxies(checkInstantiation);
         if (hasUninstantiatedProxy) {
-            // When instantiation of the proxy fails we drop the Op
-            recordedOp.deleteOps(fOpMemoryPool.get());
+            recordedOp.setSkipExecuteFlag();
         }
     }
 }