diff options
author | Ben Wagner <bungeman@google.com> | 2018-03-29 11:18:06 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-05 22:37:33 +0000 |
commit | 5ddb30862509967eca24ba3831cc11ed5396eee7 (patch) | |
tree | 85e8919cee2be60a66581b137ef861d783c583f4 /src/ports/SkFontHost_mac.cpp | |
parent | b45aac961db511e805525c6d32125e8958983ab4 (diff) |
Distinguish between glyphs with empty path and no path.
BUG=skia:4904
Change-Id: I065e3b4d8596b415ddaf094d7f9a4b65da64d4d4
Reviewed-on: https://skia-review.googlesource.com/117280
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Diffstat (limited to 'src/ports/SkFontHost_mac.cpp')
-rw-r--r-- | src/ports/SkFontHost_mac.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp index fa39d74704..efd74f6f8e 100644 --- a/src/ports/SkFontHost_mac.cpp +++ b/src/ports/SkFontHost_mac.cpp @@ -894,7 +894,7 @@ protected: void generateAdvance(SkGlyph* glyph) override; void generateMetrics(SkGlyph* glyph) override; void generateImage(const SkGlyph& glyph) override; - void generatePath(SkGlyphID glyph, SkPath* path) override; + bool generatePath(SkGlyphID glyph, SkPath* path) override; void generateFontMetrics(SkPaint::FontMetrics*) override; private: @@ -1434,7 +1434,7 @@ void SkScalerContext_Mac::generateImage(const SkGlyph& glyph) { */ #define kScaleForSubPixelPositionHinting (4.0f) -void SkScalerContext_Mac::generatePath(SkGlyphID glyph, SkPath* path) { +bool SkScalerContext_Mac::generatePath(SkGlyphID glyph, SkPath* path) { AUTO_CG_LOCK(); SkScalar scaleX = SK_Scalar1; @@ -1473,10 +1473,11 @@ void SkScalerContext_Mac::generatePath(SkGlyphID glyph, SkPath* path) { UniqueCFRef<CGPathRef> cgPath(CTFontCreatePathForGlyph(fCTFont.get(), cgGlyph, &xform)); path->reset(); - if (cgPath != nullptr) { - CGPathApply(cgPath.get(), path, SkScalerContext_Mac::CTPathElement); + if (!cgPath) { + return false; } + CGPathApply(cgPath.get(), path, SkScalerContext_Mac::CTPathElement); if (fDoSubPosition) { SkMatrix m; m.setScale(SkScalarInvert(scaleX), SkScalarInvert(scaleY)); @@ -1487,6 +1488,7 @@ void SkScalerContext_Mac::generatePath(SkGlyphID glyph, SkPath* path) { getVerticalOffset(cgGlyph, &offset); path->offset(offset.fX, offset.fY); } + return true; } void SkScalerContext_Mac::generateFontMetrics(SkPaint::FontMetrics* metrics) { |