aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-30 16:19:32 +0000
committerGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-30 16:19:32 +0000
commit000dea7573e5c902c3e04e93ad6a1aaf83c44d88 (patch)
tree50ebcd7add100bf5c1a982bdbc075f6f0aeee920
parent70ffc9a82b4c1bff106d9633d6297e1d8be9c065 (diff)
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
-rw-r--r--include/config/SkUserConfig.h1
-rw-r--r--src/core/SkGlyphCache.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/include/config/SkUserConfig.h b/include/config/SkUserConfig.h
index 430b4dd5fe..2b1be9f49d 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 ae213e94b5..b878df8b77 100644
--- a/src/core/SkGlyphCache.cpp
+++ b/src/core/SkGlyphCache.cpp
@@ -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