diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-06-03 17:45:29 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-06-03 17:45:29 +0000 |
commit | 13e1540f8c0e2cea4b775d5dc3d8105eeaf4e209 (patch) | |
tree | 2398e4b33aec41898acd473402358e3c0611caf0 /gm | |
parent | 59ce1377b1252969bc9accdcfb42ef573c8241b6 (diff) |
if we can't load Times, use default font
git-svn-id: http://skia.googlecode.com/svn/trunk@9412 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm')
-rw-r--r-- | gm/colortype.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gm/colortype.cpp b/gm/colortype.cpp index f8a9522add..a42c008912 100644 --- a/gm/colortype.cpp +++ b/gm/colortype.cpp @@ -27,9 +27,13 @@ public: paint.setAntiAlias(true); paint.setShader(s)->unref(); - SkAutoTUnref<SkTypeface> orig(SkTypeface::CreateFromName("Times", - SkTypeface::kBold)); + SkTypeface* orig = SkTypeface::CreateFromName("Times", + SkTypeface::kBold); + if (NULL == orig) { + orig = SkTypeface::RefDefault(); + } fColorType = SkNEW_ARGS(SkGTypeface, (orig, paint)); + orig->unref(); } virtual ~ColorTypeGM() { |