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

Unified Diff: src/core/SkGlyphCache.cpp

Issue 18484005: allow createScalerContext to return null, and then have the GDI backend trigger that if we fail to … (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 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 | « include/core/SkTypeface.h ('k') | src/core/SkScalerContext.cpp » ('j') | 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 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));
}
« no previous file with comments | « include/core/SkTypeface.h ('k') | src/core/SkScalerContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698