Lift GrRenderTarget::transferFrom to GrSurfaceContext.

Added virtual transferFrom to GrOpList and implemented in both
subclasses.

Bug: skia:9269
Change-Id: Ic930e46b172879e592897512c81a0cfe79f20d19
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230129
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index f45cd18..381539c 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -5,6 +5,8 @@
  * found in the LICENSE file.
  */
 
+#include "src/gpu/GrRenderTargetOpList.h"
+
 #include "include/private/GrRecordingContext.h"
 #include "src/core/SkExchange.h"
 #include "src/core/SkRectPriv.h"
@@ -16,11 +18,11 @@
 #include "src/gpu/GrMemoryPool.h"
 #include "src/gpu/GrRecordingContextPriv.h"
 #include "src/gpu/GrRenderTargetContext.h"
-#include "src/gpu/GrRenderTargetOpList.h"
 #include "src/gpu/GrResourceAllocator.h"
 #include "src/gpu/geometry/GrRect.h"
 #include "src/gpu/ops/GrClearOp.h"
 #include "src/gpu/ops/GrCopySurfaceOp.h"
+#include "src/gpu/ops/GrTransferFromOp.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -587,6 +589,15 @@
     return true;
 }
 
+void GrRenderTargetOpList::transferFrom(GrRecordingContext* context,
+                                        const SkIRect& srcRect,
+                                        GrColorType dstColorType,
+                                        sk_sp<GrGpuBuffer> dst,
+                                        size_t dstOffset) {
+    auto op = GrTransferFromOp::Make(context, srcRect, dstColorType, std::move(dst), dstOffset);
+    this->addOp(std::move(op), *context->priv().caps());
+}
+
 void GrRenderTargetOpList::purgeOpsWithUninstantiatedProxies() {
     bool hasUninstantiatedProxy = false;
     auto checkInstantiation = [&hasUninstantiatedProxy](GrSurfaceProxy* p, GrMipMapped) {