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

Unified Diff: src/gpu/gl/GrGLPathRendering.cpp

Issue 1185803003: don't rely on fonts having a stream (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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/fonts/SkTestScalerContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLPathRendering.cpp
diff --git a/src/gpu/gl/GrGLPathRendering.cpp b/src/gpu/gl/GrGLPathRendering.cpp
index ae833957405a3dbbd868f0a2d5ab0ad19b49f1ba..e81d54c338250fa16a4331d4a90055bfbfd723ea 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) {
« no previous file with comments | « src/fonts/SkTestScalerContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698