Revert of Move copy-surface-as-draw fallback to GrGLGpu. (patchset #12 id:220001 of https://codereview.chromium.org/1144433002/)

Reason for revert:
Many GMs changed, some totally busted.

Original issue's description:
> Move copy-surface-as-draw fallback to GrGLGpu.
>
> Committed: https://skia.googlesource.com/skia/+/5df6fee929823f50c55cc50f7c882a309c1b1de9

TBR=joshualitt@google.com,egdaniel@google.com,bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1142003003
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 7565cd1..549ab37 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -100,10 +100,13 @@
         return false;
     }
     SkIPoint dstPoint = {0, 0};
-    this->copySurface(copy, rt, copyRect, dstPoint);
-    dstCopy->setTexture(copy);
-    dstCopy->setOffset(copyRect.fLeft, copyRect.fTop);
-    return true;
+    if (this->copySurface(copy, rt, copyRect, dstPoint)) {
+        dstCopy->setTexture(copy);
+        dstCopy->setOffset(copyRect.fLeft, copyRect.fTop);
+        return true;
+    } else {
+        return false;
+    }
 }
 
 void GrDrawTarget::flush() {
@@ -418,7 +421,7 @@
 }
 }
 
-void GrDrawTarget::copySurface(GrSurface* dst,
+bool GrDrawTarget::copySurface(GrSurface* dst,
                                GrSurface* src,
                                const SkIRect& srcRect,
                                const SkIPoint& dstPoint) {
@@ -434,10 +437,56 @@
                                    dstPoint,
                                    &clippedSrcRect,
                                    &clippedDstPoint)) {
-        return;
+        return true;
     }
 
-    this->onCopySurface(dst, src, clippedSrcRect, clippedDstPoint);
+    if (this->getGpu()->canCopySurface(dst, src, clippedSrcRect, clippedDstPoint)) {
+        this->onCopySurface(dst, src, clippedSrcRect, clippedDstPoint);
+        return true;
+    }
+
+    GrRenderTarget* rt = dst->asRenderTarget();
+    GrTexture* tex = src->asTexture();
+
+    if ((dst == src) || !rt || !tex) {
+        return false;
+    }
+
+    GrPipelineBuilder pipelineBuilder;
+    pipelineBuilder.setRenderTarget(rt);
+    SkMatrix matrix;
+    matrix.setTranslate(SkIntToScalar(clippedSrcRect.fLeft - clippedDstPoint.fX),
+                        SkIntToScalar(clippedSrcRect.fTop - clippedDstPoint.fY));
+    matrix.postIDiv(tex->width(), tex->height());
+    pipelineBuilder.addColorTextureProcessor(tex, matrix);
+    SkIRect dstRect = SkIRect::MakeXYWH(clippedDstPoint.fX,
+                                        clippedDstPoint.fY,
+                                        clippedSrcRect.width(),
+                                        clippedSrcRect.height());
+    this->drawSimpleRect(&pipelineBuilder, GrColor_WHITE, SkMatrix::I(), dstRect);
+    return true;
+}
+
+bool GrDrawTarget::canCopySurface(const GrSurface* dst,
+                                  const GrSurface* src,
+                                  const SkIRect& srcRect,
+                                  const SkIPoint& dstPoint) {
+    SkASSERT(dst);
+    SkASSERT(src);
+
+    SkIRect clippedSrcRect;
+    SkIPoint clippedDstPoint;
+    // If the rect is outside the src or dst then we're guaranteed success
+    if (!clip_srcrect_and_dstpoint(dst,
+                                   src,
+                                   srcRect,
+                                   dstPoint,
+                                   &clippedSrcRect,
+                                   &clippedDstPoint)) {
+        return true;
+    }
+    return ((dst != src) && dst->asRenderTarget() && src->asTexture()) ||
+           this->getGpu()->canCopySurface(dst, src, clippedSrcRect, clippedDstPoint);
 }
 
 void GrDrawTarget::setupPipeline(const PipelineInfo& pipelineInfo,