Index: src/core/SkGlyphCache.cpp |
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp |
index 12e06643fed6434ff1bc6eec9e0e726d7c417a30..d366e1257590f0e1f8e2d405e86fa9af6b986bf1 100644 |
--- a/src/core/SkGlyphCache.cpp |
+++ b/src/core/SkGlyphCache.cpp |
@@ -594,13 +594,13 @@ SkGlyphCache* SkGlyphCache::VisitCache(SkTypeface* typeface, |
// If not, we may have exhausted OS/font resources, so try purging the |
// cache once and try again. |
{ |
- SkScalerContext* ctx = typeface->createScalerContext(desc); |
+ // pass true the first time, to notice if the scalercontext failed, |
+ // so we can try the purge. |
+ SkScalerContext* ctx = typeface->createScalerContext(desc, true); |
if (!ctx) { |
getSharedGlobals().purgeAll(); |
- ctx = typeface->createScalerContext(desc); |
- if (!ctx) { |
- sk_throw(); |
- } |
+ ctx = typeface->createScalerContext(desc, false); |
+ SkASSERT(ctx); |
} |
cache = SkNEW_ARGS(SkGlyphCache, (typeface, desc, ctx)); |
} |