Disabling validation of the glyph cache for standard debug builds.
authordjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 30 Nov 2012 16:19:32 +0000 (16:19 +0000)
committerdjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 30 Nov 2012 16:19:32 +0000 (16:19 +0000)
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

include/config/SkUserConfig.h
src/core/SkGlyphCache.cpp

index 430b4dd..2b1be9f 100644 (file)
@@ -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
index ae213e9..b878df8 100644 (file)
@@ -693,6 +693,7 @@ size_t SkGlyphCache::InternalFreeCache(SkGlyphCache_Globals* globals,
 
 #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 @@ void SkGlyphCache::validate() const {
             SkASSERT(fImageAlloc.contains(glyph->fImage));
         }
     }
+#endif
 }
 #endif