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

Unified Diff: src/core/SkScalerContext.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 | « src/core/SkGlyphCache.cpp ('k') | src/ports/SkFontHost_win.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkScalerContext.cpp
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index 521cb9b6b1ae28e70c6bcf9d97186650b5692c25..65873c683f7cd771854e25a5bc895d11d6df772c 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -852,14 +852,14 @@ protected:
extern SkScalerContext* SkCreateColorScalerContext(const SkDescriptor* desc);
-SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc) const {
- SkScalerContext* c = NULL; //SkCreateColorScalerContext(desc);
- if (NULL == c) {
- c = this->onCreateScalerContext(desc);
- }
- if (NULL == c) {
+SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc,
+ bool allowFailure) const {
+ SkScalerContext* c = this->onCreateScalerContext(desc);
+
+ if (!c && !allowFailure) {
c = SkNEW_ARGS(SkScalerContext_Empty,
(const_cast<SkTypeface*>(this), desc));
}
return c;
}
+
« no previous file with comments | « src/core/SkGlyphCache.cpp ('k') | src/ports/SkFontHost_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698