Revert "Remove support for copyAsDraw in gpu copySurface."

This reverts commit 6565506463db042d3d543a1707f473cdf1ef4e9e.

Reason for revert: seems to break things?

Original change's description:
> Remove support for copyAsDraw in gpu copySurface.
> 
> The major changes on a higher lever are:
> 1) The majority of all copies now go through GrSurfaceProxy::Copy which
> takes in a proxy and returns a new one with the data copied to it. This
> is the most common use case within Ganesh.
> 
> 2) The backend copy calls no longer do draws, require origins to be the
> same, and won't do any swizzling or adjustment of subrects. They are
> all implemented to be dumb copy this data to this other spot.
> 
> 3) The GrSurfaceContext copy call has now been moved to priv and renamed
> copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.
> 
> 4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
> of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
> call the priv methods on GrSurfaceContext.
> 
> Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: Id43aa8aa1451e794342e930441d9975b90e6b59f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218549
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrBackendTextureImageGenerator.cpp b/src/gpu/GrBackendTextureImageGenerator.cpp
index 6320809..4df0bd4 100644
--- a/src/gpu/GrBackendTextureImageGenerator.cpp
+++ b/src/gpu/GrBackendTextureImageGenerator.cpp
@@ -208,10 +208,28 @@
         // because Vulkan will want to do the copy as a draw. All other copies would require a
         // layout change in Vulkan and we do not change the layout of borrowed images.
         GrMipMapped mipMapped = willNeedMipMaps ? GrMipMapped::kYes : GrMipMapped::kNo;
-        SkIRect subset = SkIRect::MakeXYWH(origin.fX, origin.fY, info.width(), info.height());
 
-        return GrSurfaceProxy::Copy(context, proxy.get(), mipMapped, subset, SkBackingFit::kExact,
-                                    SkBudgeted::kYes);
+        GrBackendFormat format = proxy->backendFormat().makeTexture2D();
+        if (!format.isValid()) {
+            return nullptr;
+        }
+
+        sk_sp<GrRenderTargetContext> rtContext(
+            context->priv().makeDeferredRenderTargetContext(
+                format, SkBackingFit::kExact, info.width(), info.height(),
+                proxy->config(), nullptr, 1, mipMapped, proxy->origin(), nullptr,
+                SkBudgeted::kYes));
+
+        if (!rtContext) {
+            return nullptr;
+        }
+
+        SkIRect subset = SkIRect::MakeXYWH(origin.fX, origin.fY, info.width(), info.height());
+        if (!rtContext->copy(proxy.get(), subset, SkIPoint::Make(0, 0))) {
+            return nullptr;
+        }
+
+        return rtContext->asTextureProxyRef();
     }
 }