Disabling validation of the glyph cache for standard debug builds.

The validation step is adding 50% overhead to the rendering of
text heavy SkPicture files.

Review URL: https://codereview.appspot.com/6856123

git-svn-id: http://skia.googlecode.com/svn/trunk@6635 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/config/SkUserConfig.h b/include/config/SkUserConfig.h
index 430b4dd..2b1be9f 100644
--- a/include/config/SkUserConfig.h
+++ b/include/config/SkUserConfig.h
@@ -71,6 +71,7 @@
     the performance impact. By default these flags are undefined, but can be
     enabled by uncommenting them below.
  */
+//#define SK_DEBUG_GLYPH_CACHE
 //#define SK_DEBUG_PATH
 
 /*  To assist debugging, Skia provides an instance counting utility in
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp
index ae213e9..b878df8 100644
--- a/src/core/SkGlyphCache.cpp
+++ b/src/core/SkGlyphCache.cpp
@@ -693,6 +693,7 @@
 
 #ifdef SK_DEBUG
 void SkGlyphCache::validate() const {
+#ifdef SK_DEBUG_GLYPH_CACHE
     int count = fGlyphArray.count();
     for (int i = 0; i < count; i++) {
         const SkGlyph* glyph = fGlyphArray[i];
@@ -702,6 +703,7 @@
             SkASSERT(fImageAlloc.contains(glyph->fImage));
         }
     }
+#endif
 }
 #endif