diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-10 15:38:20 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-10 15:38:20 +0000 |
commit | 84e22d847fc84727bc220947162363ee1fe068fc (patch) | |
tree | c6f69922f25e6d08fb70997acc2bf0de3f13c2af /include | |
parent | 9de25e3fd4ff2ed8eed836e0749b978c77741db6 (diff) |
allow createScalerContext to return null, and then have the GDI backend trigger that if we fail to create the necessary GDI resources
BUG=
R=bungeman@google.com
Review URL: https://codereview.chromium.org/18484005
git-svn-id: http://skia.googlecode.com/svn/trunk@9957 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkTypeface.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/core/SkTypeface.h b/include/core/SkTypeface.h index 9c23fb200b..c84ae288a6 100644 --- a/include/core/SkTypeface.h +++ b/include/core/SkTypeface.h @@ -231,7 +231,14 @@ public: * collection. */ SkStream* openStream(int* ttcIndex) const; - SkScalerContext* createScalerContext(const SkDescriptor*) const; + + /** + * Return a scalercontext for the given descriptor. If this fails, then + * if allowFailure is true, this returns NULL, else it returns a + * dummy scalercontext that will not crash, but will draw nothing. + */ + SkScalerContext* createScalerContext(const SkDescriptor*, + bool allowFailure = false) const; // PRIVATE / EXPERIMENTAL -- do not call void filterRec(SkScalerContextRec* rec) const { |