Detach op memory pool from recording context

This changes GrOpMemoryPool to no longer extend SkRefCnt, and all usages
either are std::unique_ptr for owners, or GrOpMemoryPool* when ownership
is held somewhere else. The culmination of this is that DDLs explicitly
detach the memory pool from the recording context instead of the GrOpsTask
maintaining a strong ref that preserved the memory somewhat sneakily.

Change-Id: I33e2caebea70cebe8fd7681207c631feeaf2c703
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259424
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 083c128..8284a32 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -581,6 +581,7 @@
         renderTask->prePrepare(fContext);
     }
 
+    ddl->fOpMemoryPool = fContext->priv().detachOpMemoryPool();
     ddl->fRecordTimeData = fContext->priv().detachRecordTimeAllocator();
 
     fContext->priv().detachProgramInfos(&ddl->fProgramInfos);
@@ -680,7 +681,7 @@
     GrSurfaceProxy* proxy = surfaceView.proxy();
     this->closeRenderTasksForNewRenderTask(proxy);
 
-    sk_sp<GrOpsTask> opsTask(new GrOpsTask(fContext->priv().refOpMemoryPool(),
+    sk_sp<GrOpsTask> opsTask(new GrOpsTask(fContext->priv().opMemoryPool(),
                                            std::move(surfaceView), fContext->priv().auditTrail()));
     SkASSERT(proxy->getLastRenderTask() == opsTask.get());