Rename GrAtlasMgr to GrAtlas (and other cleanup)

This CL also renames the old GrAtlas to ClientPlotUsage and moves it into the new GrAtlas.

R=jvanverth@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/355673002
diff --git a/src/gpu/GrTextStrike.cpp b/src/gpu/GrTextStrike.cpp
index b03d14f..fb9d631 100644
--- a/src/gpu/GrTextStrike.cpp
+++ b/src/gpu/GrTextStrike.cpp
@@ -32,7 +32,7 @@
 GrFontCache::GrFontCache(GrGpu* gpu) : fGpu(gpu) {
     gpu->ref();
     for (int i = 0; i < kAtlasCount; ++i) {
-        fAtlasMgr[i] = NULL;
+        fAtlases[i] = NULL;
     }
 
     fHead = fTail = NULL;
@@ -41,7 +41,7 @@
 GrFontCache::~GrFontCache() {
     fCache.deleteAll();
     for (int i = 0; i < kAtlasCount; ++i) {
-        delete fAtlasMgr[i];
+        delete fAtlases[i];
     }
     fGpu->unref();
 #if FONT_CACHE_STATS
@@ -79,17 +79,17 @@
     GrMaskFormat format = scaler->getMaskFormat();
     GrPixelConfig config = mask_format_to_pixel_config(format);
     int atlasIndex = mask_format_to_atlas_index(format);
-    if (NULL == fAtlasMgr[atlasIndex]) {
+    if (NULL == fAtlases[atlasIndex]) {
         SkISize textureSize = SkISize::Make(GR_ATLAS_TEXTURE_WIDTH,
                                             GR_ATLAS_TEXTURE_HEIGHT);
-        fAtlasMgr[atlasIndex] = SkNEW_ARGS(GrAtlasMgr, (fGpu, config,
-                                                        textureSize,
-                                                        GR_NUM_PLOTS_X,
-                                                        GR_NUM_PLOTS_Y,
-                                                        true));
+        fAtlases[atlasIndex] = SkNEW_ARGS(GrAtlas, (fGpu, config,
+                                                    textureSize,
+                                                    GR_NUM_PLOTS_X,
+                                                    GR_NUM_PLOTS_Y,
+                                                    true));
     }
     GrTextStrike* strike = SkNEW_ARGS(GrTextStrike,
-                                      (this, scaler->getKey(), format, fAtlasMgr[atlasIndex]));
+                                      (this, scaler->getKey(), format, fAtlases[atlasIndex]));
     fCache.insert(key, strike);
 
     if (fHead) {
@@ -108,8 +108,8 @@
 void GrFontCache::freeAll() {
     fCache.deleteAll();
     for (int i = 0; i < kAtlasCount; ++i) {
-        delete fAtlasMgr[i];
-        fAtlasMgr[i] = NULL;
+        delete fAtlases[i];
+        fAtlases[i] = NULL;
     }
     fHead = NULL;
     fTail = NULL;
@@ -125,8 +125,8 @@
 bool GrFontCache::freeUnusedPlot(GrTextStrike* preserveStrike) {
     SkASSERT(NULL != preserveStrike);
 
-    GrAtlasMgr* atlasMgr = preserveStrike->fAtlasMgr;
-    GrPlot* plot = atlasMgr->getUnusedPlot();
+    GrAtlas* atlas = preserveStrike->fAtlas;
+    GrPlot* plot = atlas->getUnusedPlot();
     if (NULL == plot) {
         return false;
     }
@@ -145,7 +145,7 @@
         strikeToPurge->removePlot(plot);
 
         // clear out any empty strikes (except this one)
-        if (strikeToPurge != preserveStrike && strikeToPurge->fAtlas.isEmpty()) {
+        if (strikeToPurge != preserveStrike && strikeToPurge->fPlotUsage.isEmpty()) {
             this->purgeStrike(strikeToPurge);
         }
     }
@@ -190,8 +190,8 @@
 void GrFontCache::dump() const {
     static int gDumpCount = 0;
     for (int i = 0; i < kAtlasCount; ++i) {
-        if (NULL != fAtlasMgr[i]) {
-            GrTexture* texture = fAtlasMgr[i]->getTexture();
+        if (NULL != fAtlases[i]) {
+            GrTexture* texture = fAtlases[i]->getTexture();
             if (NULL != texture) {
                 SkString filename;
 #ifdef SK_BUILD_FOR_ANDROID
@@ -222,12 +222,12 @@
 
 GrTextStrike::GrTextStrike(GrFontCache* cache, const GrKey* key,
                            GrMaskFormat format,
-                           GrAtlasMgr* atlasMgr) : fPool(64) {
+                           GrAtlas* atlas) : fPool(64) {
     fFontScalerKey = key;
     fFontScalerKey->ref();
 
     fFontCache = cache;     // no need to ref, it won't go away before we do
-    fAtlasMgr = atlasMgr;   // no need to ref, it won't go away before we do
+    fAtlas = atlas;         // no need to ref, it won't go away before we do
 
     fMaskFormat = format;
 
@@ -278,7 +278,7 @@
         }
     }
 
-    fAtlasMgr->removePlot(&fAtlas, plot);
+    fAtlas->removePlot(&fPlotUsage, plot);
 }
 
 
@@ -314,9 +314,9 @@
         }
     }
 
-    GrPlot* plot  = fAtlasMgr->addToAtlas(&fAtlas, glyph->width(),
-                                          glyph->height(), storage.get(),
-                                          &glyph->fAtlasLocation);
+    GrPlot* plot  = fAtlas->addToAtlas(&fPlotUsage, glyph->width(),
+                                       glyph->height(), storage.get(),
+                                       &glyph->fAtlasLocation);
 
     if (NULL == plot) {
         return false;