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
This commit is contained in:
parent
1692bd12b5
commit
f5c633f95d
@ -74,7 +74,6 @@ protected:
|
||||
uint32_t glyphIDsCount) const override;
|
||||
|
||||
SkStreamAsset* onOpenStream(int* ttcIndex) const override {
|
||||
SkASSERT(0); // don't expect to get here
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user