void generatePath(int glyphID, SkPath* out) override { SkGlyph skGlyph; skGlyph.initWithGlyphID(glyphID); fScalerContext->getMetrics(&skGlyph); fScalerContext->getPath(skGlyph, out); }
void generatePath(int glyphID, SkPath* out) override { SkGlyph skGlyph; skGlyph.initWithGlyphID(glyphID); fScalerContext->getMetrics(&skGlyph); fScalerContext->getPath(skGlyph, out); out->transform(fFlipMatrix); // Load glyphs with the inverted y-direction. }
SkGlyph* SkGlyphCache::allocateNewGlyph(SkPackedGlyphID packedGlyphID, MetricsType mtype) { fMemoryUsed += sizeof(SkGlyph); SkGlyph* glyphPtr; { SkGlyph glyph; glyph.initWithGlyphID(packedGlyphID); glyphPtr = fGlyphMap.set(glyph); } if (kNothing_MetricsType == mtype) { return glyphPtr; } else if (kJustAdvance_MetricsType == mtype) { fScalerContext->getAdvance(glyphPtr); } else { SkASSERT(kFull_MetricsType == mtype); fScalerContext->getMetrics(glyphPtr); } SkASSERT(glyphPtr->fID != SkPackedGlyphID()); return glyphPtr; }