Add support for additional textures in GrDrawOpAtlas

Step two in supporting growable/shrinkable atlases.

Bug: skia:3550
Change-Id: I0cdec2a9f59cc8ced071bfeec2f8ed5a228c4b7a
Reviewed-on: https://skia-review.googlesource.com/43260
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/text/GrAtlasGlyphCache.cpp b/src/gpu/text/GrAtlasGlyphCache.cpp
index 7456a8e..1cf704a 100644
--- a/src/gpu/text/GrAtlasGlyphCache.cpp
+++ b/src/gpu/text/GrAtlasGlyphCache.cpp
@@ -176,16 +176,18 @@
     static int gDumpCount = 0;
     for (int i = 0; i < kMaskFormatCount; ++i) {
         if (fAtlases[i]) {
-            sk_sp<GrTextureProxy> proxy = fAtlases[i]->getProxy();
-            if (proxy) {
-                SkString filename;
+            const sk_sp<GrTextureProxy>* proxies = fAtlases[i]->getProxies();
+            for (int pageIdx = 0; pageIdx < GrDrawOpAtlas::kMaxPages; ++pageIdx) {
+                if (proxies[pageIdx]) {
+                    SkString filename;
 #ifdef SK_BUILD_FOR_ANDROID
-                filename.printf("/sdcard/fontcache_%d%d.png", gDumpCount, i);
+                    filename.printf("/sdcard/fontcache_%d%d%d.png", gDumpCount, i, pageIdx);
 #else
-                filename.printf("fontcache_%d%d.png", gDumpCount, i);
+                    filename.printf("fontcache_%d%d%d.png", gDumpCount, i, pageIdx);
 #endif
 
-                save_pixels(fContext, proxy.get(), filename.c_str());
+                    save_pixels(fContext, proxies[pageIdx].get(), filename.c_str());
+                }
             }
         }
     }