Add method to iterate over a GrOp's GrSurfaceProxies

The extra generality of having a std::function is for MDB reordering. In the current MDB reordering world there is one pass through the surfaceProxies at creation time and a second pass after flush to create the usage intervals.

Change-Id: I3f548417eddc1dad7503d919241301e404255ffe
Reviewed-on: https://skia-review.googlesource.com/46200
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp
index 0415d9d..92278d1 100644
--- a/src/gpu/ops/GrTextureOp.cpp
+++ b/src/gpu/ops/GrTextureOp.cpp
@@ -245,6 +245,13 @@
 
     const char* name() const override { return "TextureOp"; }
 
+    void visitProxies(VisitProxyFunc func) const override {
+        auto proxies = this->proxies();
+        for (int i = 0; i < fProxyCnt; ++i) {
+            func(proxies[i]);
+        }
+    }
+
     SkString dumpInfo() const override {
         SkString str;
         str.appendf("AllowSRGBInputs: %d\n", fAllowSRGBInputs);
@@ -482,6 +489,7 @@
             for (int i = 0; i < that->fProxyCnt; ++i) {
                 if (map[i] < 0) {
                     thatProxies[i]->addPendingRead();
+
                     thisProxies[-map[i]] = thatProxies[i];
                     thisFilters[-map[i]] = thatFilters[i];
                     map[i] = -map[i];