Revert "Make sure to visit clips and dst proxies during gather"

This reverts commit c666502bc6975a73ef352d673b151017a21e8562.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Make sure to visit clips and dst proxies during gather
> 
> Bug: skia:7190
> Change-Id: I6ba5bad6e155e9092dff9c2ad3241f603c333b4d
> Reviewed-on: https://skia-review.googlesource.com/76460
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=robertphillips@google.com,csmartdalton@google.com

Change-Id: I4839594bb97472f5ac2057600a0889c8a9dff5f9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7190
Reviewed-on: https://skia-review.googlesource.com/77781
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h
index 49051f2..23f6219 100644
--- a/include/private/GrSurfaceProxy.h
+++ b/include/private/GrSurfaceProxy.h
@@ -428,10 +428,6 @@
     // This pointer is unreffed. OpLists own a ref on their surface proxies.
     GrOpList* fLastOpList;
 
-    // Notifies the resource allocator when a proxy is a direct read from the render target itself
-    // (via texture barrier). This information is necessary for certain assertions.
-    SkDEBUGCODE(bool fIsDirectDstRead = false;)
-
     typedef GrIORefProxy INHERITED;
 };
 
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index dc37c27..2310ebd 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -1833,8 +1833,6 @@
             // will be responsible to detect this situation and request a texture barrier.
             dstProxy->setProxy(sk_ref_sp(texProxy));
             dstProxy->setOffset(0, 0);
-            // Notify the resource allocator that this will be a direct read from the render target.
-            SkDEBUGCODE(dstProxy->proxy()->priv().markAsDirectDstRead_debugOnly();)
             return true;
         }
     }
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index 6ec8496..4bdfe58 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -274,8 +274,11 @@
     auto gather = [ alloc ] (GrSurfaceProxy* p) {
         alloc->addInterval(p);
     };
-    for (const RecordedOp& recordedOp : fRecordedOps) {
-        recordedOp.visitProxies(gather); // only diff from the GrTextureOpList version
+    for (int i = 0; i < fRecordedOps.count(); ++i) {
+        const GrOp* op = fRecordedOps[i].fOp.get(); // only diff from the GrTextureOpList version
+        if (op) {
+            op->visitProxies(gather);
+        }
 
         // Even though the op may have been moved we still need to increment the op count to
         // keep all the math consistent.
diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h
index 7e600d4..e9797db 100644
--- a/src/gpu/GrRenderTargetOpList.h
+++ b/src/gpu/GrRenderTargetOpList.h
@@ -136,19 +136,6 @@
                 fDstProxy = *dstProxy;
             }
         }
-
-        void visitProxies(const GrOp::VisitProxyFunc& func) const {
-            if (fOp) {
-                fOp->visitProxies(func);
-            }
-            if (fDstProxy.proxy()) {
-                func(fDstProxy.proxy());
-            }
-            if (fAppliedClip) {
-                fAppliedClip->visitProxies(func);
-            }
-        }
-
         std::unique_ptr<GrOp> fOp;
         DstProxy fDstProxy;
         GrAppliedClip* fAppliedClip;
diff --git a/src/gpu/GrResourceAllocator.cpp b/src/gpu/GrResourceAllocator.cpp
index 11fa7ea..5cb882f 100644
--- a/src/gpu/GrResourceAllocator.cpp
+++ b/src/gpu/GrResourceAllocator.cpp
@@ -50,14 +50,7 @@
 
     if (Interval* intvl = fIntvlHash.find(proxy->uniqueID().asUInt())) {
         // Revise the interval for an existing use
-#ifdef SK_DEBUG
-        if (proxy->priv().isDirectDstRead_debugOnly()) {
-            // Direct reads from the render target itself should occur w/in the existing interval
-            SkASSERT(intvl->start() <= start && intvl->end() >= end);
-        } else {
-            SkASSERT(intvl->end() <= start && intvl->end() <= end);
-        }
-#endif
+        SkASSERT(intvl->end() <= start && intvl->end() <= end);
         intvl->extendEnd(end);
         return;
     }
diff --git a/src/gpu/GrResourceAllocator.h b/src/gpu/GrResourceAllocator.h
index dde7519..f576649 100644
--- a/src/gpu/GrResourceAllocator.h
+++ b/src/gpu/GrResourceAllocator.h
@@ -120,9 +120,8 @@
         void setNext(Interval* next) { fNext = next; }
 
         void extendEnd(unsigned int newEnd) {
-            if (newEnd > fEnd) {
-                fEnd = newEnd;
-            }
+            SkASSERT(newEnd >= fEnd);
+            fEnd = newEnd;
         }
 
         void assign(sk_sp<GrSurface>);
diff --git a/src/gpu/GrSurfaceProxyPriv.h b/src/gpu/GrSurfaceProxyPriv.h
index 0e05972..a93a20c 100644
--- a/src/gpu/GrSurfaceProxyPriv.h
+++ b/src/gpu/GrSurfaceProxyPriv.h
@@ -70,11 +70,6 @@
 
     static bool AttachStencilIfNeeded(GrResourceProvider*, GrSurface*, bool needsStencil);
 
-    // These are used to notify the resource allocator when a proxy is a direct read from the render
-    // target itself (via texture barrier). This information is necessary for certain assertions.
-    SkDEBUGCODE(void markAsDirectDstRead_debugOnly() { fProxy->fIsDirectDstRead = true; })
-    SkDEBUGCODE(bool isDirectDstRead_debugOnly() const { return fProxy->fIsDirectDstRead; })
-
 private:
     explicit GrSurfaceProxyPriv(GrSurfaceProxy* proxy) : fProxy(proxy) {}
     GrSurfaceProxyPriv(const GrSurfaceProxyPriv&) {} // unimpl