Convert DstTexture to DstProxy (take 2)

The last GrTexture-based TextureSampler::reset call must be removed before the TextureSamplers can become purely GrTextureProxy-backed

Reland of: https://skia-review.googlesource.com/c/16908/ (Convert DstTexture to DstProxy)

Split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler))

Change-Id: I3a497b6a950fad899f23882c0a9552894ef640f8
Reviewed-on: https://skia-review.googlesource.com/17205
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index 537f9e6..0a50f74 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -72,7 +72,7 @@
             GrOpFlushState::DrawOpArgs opArgs = {
                 fTarget.get()->priv().peekRenderTarget(),
                 fRecordedOps[i].fAppliedClip,
-                fRecordedOps[i].fDstTexture
+                fRecordedOps[i].fDstProxy
             };
 
             flushState->setDrawOpArgs(&opArgs);
@@ -142,7 +142,7 @@
         GrOpFlushState::DrawOpArgs opArgs {
             fTarget.get()->priv().peekRenderTarget(),
             fRecordedOps[i].fAppliedClip,
-            fRecordedOps[i].fDstTexture
+            fRecordedOps[i].fDstProxy
         };
 
         flushState->setDrawOpArgs(&opArgs);
@@ -248,7 +248,7 @@
 
 bool GrRenderTargetOpList::combineIfPossible(const RecordedOp& a, GrOp* b,
                                              const GrAppliedClip* bClip,
-                                             const DstTexture* bDstTexture,
+                                             const DstProxy* bDstProxy,
                                              const GrCaps& caps) {
     if (a.fAppliedClip) {
         if (!bClip) {
@@ -260,11 +260,11 @@
     } else if (bClip) {
         return false;
     }
-    if (bDstTexture) {
-        if (a.fDstTexture != *bDstTexture) {
+    if (bDstProxy) {
+        if (a.fDstProxy != *bDstProxy) {
             return false;
         }
-    } else if (a.fDstTexture.texture()) {
+    } else if (a.fDstProxy.proxy()) {
         return false;
     }
     return a.fOp->combineIfPossible(b, caps);
@@ -273,7 +273,7 @@
 GrOp* GrRenderTargetOpList::recordOp(std::unique_ptr<GrOp> op,
                                      GrRenderTargetContext* renderTargetContext,
                                      GrAppliedClip* clip,
-                                     const DstTexture* dstTexture) {
+                                     const DstProxy* dstProxy) {
     SkASSERT(fTarget.get());
     const GrCaps* caps = renderTargetContext->caps();
 
@@ -302,7 +302,7 @@
         while (true) {
             const RecordedOp& candidate = fRecordedOps.fromBack(i);
 
-            if (this->combineIfPossible(candidate, op.get(), clip, dstTexture, *caps)) {
+            if (this->combineIfPossible(candidate, op.get(), clip, dstProxy, *caps)) {
                 GrOP_INFO("\t\tBackward: Combining with (%s, opID: %u)\n", candidate.fOp->name(),
                           candidate.fOp->uniqueID());
                 GrOP_INFO("\t\t\tBackward: Combined op info:\n");
@@ -330,7 +330,7 @@
         clip = fClipAllocator.make<GrAppliedClip>(std::move(*clip));
         SkDEBUGCODE(fNumClips++;)
     }
-    fRecordedOps.emplace_back(std::move(op), clip, dstTexture);
+    fRecordedOps.emplace_back(std::move(op), clip, dstProxy);
     fRecordedOps.back().fOp->wasRecorded(this);
     fLastFullClearOp = nullptr;
     fLastFullClearResourceID.makeInvalid();
@@ -350,7 +350,7 @@
             const RecordedOp& candidate = fRecordedOps[j];
 
             if (this->combineIfPossible(fRecordedOps[i], candidate.fOp.get(),
-                                        candidate.fAppliedClip, &candidate.fDstTexture, caps)) {
+                                        candidate.fAppliedClip, &candidate.fDstProxy, caps)) {
                 GrOP_INFO("\t\tForward: Combining with (%s, opID: %u)\n", candidate.fOp->name(),
                           candidate.fOp->uniqueID());
                 GR_AUDIT_TRAIL_OPS_RESULT_COMBINED(fAuditTrail, op, candidate.fOp.get());