Release deferred buffers in GrOpsRenderPass::end()

Moves the sk_sp's for deferred buffers out of the individual
subclasses and into GrOpsRenderPass. Makes sure to release these refs
during end(). This ensures the buffers can actually become purgeable
after the render pass completes.

Bug: skia:10048
Change-Id: I06838e45b85297b17277f625b313b6e07eda124f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278256
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/GrOpsRenderPass.cpp b/src/gpu/GrOpsRenderPass.cpp
index 9d790e0..8c6b559 100644
--- a/src/gpu/GrOpsRenderPass.cpp
+++ b/src/gpu/GrOpsRenderPass.cpp
@@ -20,6 +20,25 @@
 #include "src/gpu/GrSimpleMesh.h"
 #include "src/gpu/GrTexturePriv.h"
 
+void GrOpsRenderPass::begin() {
+    fDrawPipelineStatus = DrawPipelineStatus::kNotConfigured;
+#ifdef SK_DEBUG
+    fScissorStatus = DynamicStateStatus::kDisabled;
+    fTextureBindingStatus = DynamicStateStatus::kDisabled;
+    fHasIndexBuffer = false;
+    fInstanceBufferStatus = DynamicStateStatus::kDisabled;
+    fVertexBufferStatus = DynamicStateStatus::kDisabled;
+#endif
+    this->onBegin();
+}
+
+void GrOpsRenderPass::end() {
+    this->onEnd();
+    fActiveIndexBuffer.reset();
+    fActiveInstanceBuffer.reset();
+    fActiveVertexBuffer.reset();
+}
+
 void GrOpsRenderPass::clear(const GrFixedClip& clip, const SkPMColor4f& color) {
     SkASSERT(fRenderTarget);
     // A clear at this level will always be a true clear, so make sure clears were not supposed to