Add backend texture and backend render target versions snapshot GMs

GPU may behave differently depending on whether the SkSurface backing
store is wrapped and whether it is a texture or not.

Bug: skia:11208
Change-Id: I5e9921d56c0840cfe34ed2926a55be7460409b23
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/364639
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 9a30130..91c2b0d 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -835,23 +835,28 @@
     SkDEBUGCODE(this->validate());
     SkASSERT(fContext);
 
-    this->closeActiveOpsTask();
-
-    GrRenderTask* task = this->appendTask(GrCopyRenderTask::Make(this,
-                                                                 src,
-                                                                 srcRect,
-                                                                 std::move(dst),
-                                                                 dstPoint,
-                                                                 origin));
+    sk_sp<GrRenderTask> task = GrCopyRenderTask::Make(this,
+                                                      src,
+                                                      srcRect,
+                                                      std::move(dst),
+                                                      dstPoint,
+                                                      origin);
     if (!task) {
         return false;
     }
 
+    this->closeActiveOpsTask();
+    GrRenderTask* appendedTask = this->appendTask(std::move(task));
+
     const GrCaps& caps = *fContext->priv().caps();
     // 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);
+    appendedTask->addDependency(this,
+                                src.get(),
+                                GrMipmapped::kNo,
+                                GrTextureResolveManager(this),
+                                caps);
+    appendedTask->makeClosed(caps);
 
     // We have closed the previous active oplist but since a new oplist isn't being added there
     // shouldn't be an active one.