Upgrade GrRenderTask::makeClosed to take a GrRecordingContext

The tessellation atlas task will need a recording context in order to
record its ops during onMakeClosed.

Bug: b/188794626
Bug: chromium:928984
Change-Id: Ie8719a514899a5748c52ae78a6ecd997b1439ab7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420879
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 3c9b49f..85cea19 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -178,7 +178,7 @@
             onFlushCBObject->preFlush(&onFlushProvider, SkMakeSpan(fFlushingRenderTaskIDs));
         }
         for (const auto& onFlushRenderTask : fOnFlushRenderTasks) {
-            onFlushRenderTask->makeClosed(*fContext->priv().caps());
+            onFlushRenderTask->makeClosed(fContext);
 #ifdef SK_DEBUG
             // OnFlush callbacks are invoked during flush, and are therefore expected to handle
             // resource allocation & usage on their own. (No deferred or lazy proxies!)
@@ -444,10 +444,9 @@
 }
 
 void GrDrawingManager::closeAllTasks() {
-    const GrCaps& caps = *fContext->priv().caps();
     for (auto& task : fDAG) {
         if (task) {
-            task->makeClosed(caps);
+            task->makeClosed(fContext);
         }
     }
 }
@@ -613,7 +612,7 @@
         // reordering so ops that (in the single opsTask world) would've just glommed onto the
         // end of the single opsTask but referred to a far earlier RT need to appear in their
         // own opsTask.
-        fActiveOpsTask->makeClosed(*fContext->priv().caps());
+        fActiveOpsTask->makeClosed(fContext);
         fActiveOpsTask = nullptr;
     }
 
@@ -674,7 +673,7 @@
         // reordering so ops that (in the single opsTask world) would've just glommed onto the
         // end of the single opsTask but referred to a far earlier RT need to appear in their
         // own opsTask.
-        fActiveOpsTask->makeClosed(*fContext->priv().caps());
+        fActiveOpsTask->makeClosed(fContext);
         fActiveOpsTask = nullptr;
     }
 }
@@ -725,8 +724,6 @@
     SkDEBUGCODE(this->validate());
     SkASSERT(fContext);
 
-    const GrCaps& caps = *fContext->priv().caps();
-
     sk_sp<GrWaitRenderTask> waitTask = sk_make_sp<GrWaitRenderTask>(GrSurfaceProxyView(proxy),
                                                                     std::move(semaphores),
                                                                     numSemaphores);
@@ -761,7 +758,7 @@
         this->closeActiveOpsTask();
         this->appendTask(waitTask);
     }
-    waitTask->makeClosed(caps);
+    waitTask->makeClosed(fContext);
 
     SkDEBUGCODE(this->validate());
 }
@@ -786,7 +783,7 @@
     // don't need to make sure the whole mip map chain is valid.
     task->addDependency(this, srcProxy.get(), GrMipmapped::kNo,
                         GrTextureResolveManager(this), caps);
-    task->makeClosed(caps);
+    task->makeClosed(fContext);
 
     // We have closed the previous active oplist but since a new oplist isn't being added there
     // shouldn't be an active one.
@@ -830,7 +827,7 @@
     // We always say GrMipmapped::kNo here since we are always just copying from the base layer to
     // another base layer. We don't need to make sure the whole mip map chain is valid.
     task->addDependency(this, src.get(), GrMipmapped::kNo, GrTextureResolveManager(this), caps);
-    task->makeClosed(caps);
+    task->makeClosed(fContext);
 
     // We have closed the previous active oplist but since a new oplist isn't being added there
     // shouldn't be an active one.
@@ -871,7 +868,7 @@
         return false;
     }
 
-    task->makeClosed(caps);
+    task->makeClosed(fContext);
 
     // We have closed the previous active oplist but since a new oplist isn't being added there
     // shouldn't be an active one.