aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLPathRendering.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-06-15 08:05:06 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-15 08:05:06 -0700
commitf5c633f95db6e15da6f443a4f49f534e01edb676 (patch)
treea21c965bf76453b9bb8363c1d4c53f69e7953f5a /src/gpu/gl/GrGLPathRendering.cpp
parent1692bd12b529b573873dd96becce5b0aabf18bbd (diff)
don't rely on fonts having a stream
Portable fonts don't have streams, so expect the stream open to fail. R=bungeman@google.com TBR=cdalton@nvidia.com Review URL: https://codereview.chromium.org/1185803003
Diffstat (limited to 'src/gpu/gl/GrGLPathRendering.cpp')
-rw-r--r--src/gpu/gl/GrGLPathRendering.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGLPathRendering.cpp b/src/gpu/gl/GrGLPathRendering.cpp
index ae83395740..e81d54c338 100644
--- a/src/gpu/gl/GrGLPathRendering.cpp
+++ b/src/gpu/gl/GrGLPathRendering.cpp
@@ -113,7 +113,11 @@ GrPathRange* GrGLPathRendering::createGlyphs(const SkTypeface* typeface,
}
int faceIndex;
- SkAutoTDelete<SkStream> fontStream(typeface->openStream(&faceIndex));
+ SkStreamAsset* asset = typeface->openStream(&faceIndex);
+ if (!asset) {
+ return GrPathRendering::createGlyphs(typeface, NULL, stroke);
+ }
+ SkAutoTDelete<SkStream> fontStream(asset);
const size_t fontDataLength = fontStream->getLength();
if (0 == fontDataLength) {