clean up debug diagnostics in SkTestFont

We're going to be using this more often to the point that the extra
SkDebugf() calls are going to be annoying.

May also fix a crash?

Change-Id: I796037568cce720ecb3d0b4f4272af5d700760ea
Reviewed-on: https://skia-review.googlesource.com/70180
Reviewed-by: Ben Wagner <bungeman@google.com>
diff --git a/tools/SkTestScalerContext.cpp b/tools/SkTestScalerContext.cpp
index 8a3c304..7797ebf 100644
--- a/tools/SkTestScalerContext.cpp
+++ b/tools/SkTestScalerContext.cpp
@@ -30,10 +30,6 @@
     , fPaths(nullptr)
 {
     init(fontData.fPoints, fontData.fVerbs);
-#ifdef SK_DEBUG
-    sk_bzero(fDebugBits, sizeof(fDebugBits));
-    sk_bzero(fDebugOverage, sizeof(fDebugOverage));
-#endif
 }
 
 SkTestFont::~SkTestFont() {
@@ -43,42 +39,12 @@
     delete[] fPaths;
 }
 
-#ifdef SK_DEBUG
-
-#include "SkMutex.h"
-SK_DECLARE_STATIC_MUTEX(gUsedCharsMutex);
-
-#endif
-
 int SkTestFont::codeToIndex(SkUnichar charCode) const {
-#ifdef SK_DEBUG  // detect missing test font data
-    {
-        SkAutoMutexAcquire ac(gUsedCharsMutex);
-        if (charCode >= ' ' && charCode <= '~') {
-            int bitOffset = charCode - ' ';
-            fDebugBits[bitOffset >> 3] |= 1 << (bitOffset & 7);
-        } else {
-            int index = 0;
-            while (fDebugOverage[index] != 0 && fDebugOverage[index] != charCode
-                    && index < (int) sizeof(fDebugOverage)) {
-                ++index;
-            }
-            SkASSERT(index < (int) sizeof(fDebugOverage));
-            if (fDebugOverage[index] == 0) {
-                fDebugOverage[index] = charCode;
-            }
-        }
-    }
-#endif
     for (unsigned index = 0; index < fCharCodesCount; ++index) {
         if (fCharCodes[index] == (unsigned) charCode) {
             return (int) index;
         }
     }
-
-    SkDEBUGF(("missing '%c' (%d) from %s (weight %d, width %d, slant %d)\n",
-              (char) charCode, charCode, fDebugName,
-              fDebugStyle.weight(), fDebugStyle.width(), fDebugStyle.slant()));
     return 0;
 }
 
diff --git a/tools/SkTestScalerContext.h b/tools/SkTestScalerContext.h
index 1d36290..e62210b 100644
--- a/tools/SkTestScalerContext.h
+++ b/tools/SkTestScalerContext.h
@@ -35,13 +35,6 @@
     virtual ~SkTestFont();
     int codeToIndex(SkUnichar charCode) const;
     void init(const SkScalar* pts, const unsigned char* verbs);
-#ifdef SK_DEBUG  // detect missing test font data
-    mutable unsigned char fDebugBits[16];
-    mutable SkUnichar fDebugOverage[8];
-    const char* fDebugName;
-    SkFontStyle fDebugStyle;
-    const char* debugFontName() const { return fName; }
-#endif
 private:
     const unsigned* fCharCodes;
     const size_t fCharCodesCount;
diff --git a/tools/sk_tool_utils_font.cpp b/tools/sk_tool_utils_font.cpp
index 4d82368..8b2041a 100644
--- a/tools/sk_tool_utils_font.cpp
+++ b/tools/sk_tool_utils_font.cpp
@@ -61,8 +61,6 @@
             font = fontData->fCachedFont;
         } else {
             font = sk_make_sp<SkTestFont>(*fontData);
-            SkDEBUGCODE(font->fDebugName = sub->fName);
-            SkDEBUGCODE(font->fDebugStyle = sub->fStyle);
             fontData->fCachedFont = font;
         }
     }