diff options
Diffstat (limited to 'src/core/SkScalerContext.cpp')
-rw-r--r-- | src/core/SkScalerContext.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp index d529db9eb0..600163910a 100644 --- a/src/core/SkScalerContext.cpp +++ b/src/core/SkScalerContext.cpp @@ -158,10 +158,12 @@ void SkScalerContext::getMetrics(SkGlyph* glyph) { SK_ERROR: // draw nothing 'cause we failed - glyph->fLeft = 0; - glyph->fTop = 0; - glyph->fWidth = 0; - glyph->fHeight = 0; + glyph->fLeft = 0; + glyph->fTop = 0; + glyph->fWidth = 0; + glyph->fHeight = 0; + glyph->fLsbDelta = 0; + glyph->fRsbDelta = 0; // put a valid value here, in case it was earlier set to // MASK_FORMAT_JUST_ADVANCE glyph->fMaskFormat = fRec.fMaskFormat; @@ -500,8 +502,8 @@ void SkScalerContext::getImage(const SkGlyph& origGlyph) { } } -void SkScalerContext::getPath(SkPackedGlyphID glyphID, SkPath* path) { - this->internalGetPath(glyphID, nullptr, path, nullptr); +bool SkScalerContext::getPath(SkPackedGlyphID glyphID, SkPath* path) { + return this->internalGetPath(glyphID, nullptr, path, nullptr); } void SkScalerContext::getFontMetrics(SkPaint::FontMetrics* fm) { @@ -518,8 +520,7 @@ SkUnichar SkScalerContext::generateGlyphToChar(uint16_t glyph) { bool SkScalerContext::internalGetPath(SkPackedGlyphID glyphID, SkPath* fillPath, SkPath* devPath, SkMatrix* fillToDevMatrix) { SkPath path; - generatePath(glyphID.code(), &path); - if (path.isEmpty()) { + if (!generatePath(glyphID.code(), &path)) { return false; } @@ -790,7 +791,10 @@ protected: glyph->zeroMetrics(); } void generateImage(const SkGlyph& glyph) override {} - void generatePath(SkGlyphID glyph, SkPath* path) override {} + bool generatePath(SkGlyphID glyph, SkPath* path) override { + path->reset(); + return false; + } void generateFontMetrics(SkPaint::FontMetrics* metrics) override { if (metrics) { sk_bzero(metrics, sizeof(*metrics)); |