Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(624)

Unified Diff: src/core/SkGlyphCache.cpp

Issue 1992053002: Assert complex precondition in SkGlyphCache::Visit. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698