Index: src/core/SkGlyphCache.cpp |
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp |
index 9725c0179a73941b1ab5d2757670363e7d2bf577..072541d14681e33f8b41726c9e9b2972ec3cf8da 100644 |
--- a/src/core/SkGlyphCache.cpp |
+++ b/src/core/SkGlyphCache.cpp |
@@ -520,6 +520,16 @@ SkGlyphCache* SkGlyphCache::VisitCache(SkTypeface* typeface, |
} |
SkASSERT(desc); |
+ // Precondition: the typeface id must be the fFontID in the descriptor |
+ SkDEBUGCODE( |
+ uint32_t length; |
+ const SkScalerContext::Rec* rec = static_cast<const SkScalerContext::Rec*>( |
+ desc->findEntry(kRec_SkDescriptorTag, &length)); |
+ SkASSERT(rec); |
+ SkASSERT(length == sizeof(*rec)); |
+ SkASSERT(typeface->uniqueID() == rec->fFontID); |
+ ) |
+ |
SkGlyphCache_Globals& globals = get_globals(); |
SkGlyphCache* cache; |