Lines Matching refs:glyph
37 std::tuple<SkGlyph*, size_t> SkScalerCache::glyph(SkPackedGlyphID packedGlyphID) {
49 SkGlyph* glyph = fAlloc.make<SkGlyph>(fScalerContext->makeGlyph(packedGlyphID));
50 return {this->addGlyph(glyph), sizeof(SkGlyph)};
53 SkGlyphDigest SkScalerCache::addGlyph(SkGlyph* glyph) {
55 SkGlyphDigest digest = SkGlyphDigest{index, *glyph};
56 fDigestForPackedGlyphID.set(glyph->getPackedID(), digest);
57 fGlyphForIndex.push_back(glyph);
61 std::tuple<const SkPath*, size_t> SkScalerCache::preparePath(SkGlyph* glyph) {
63 if (glyph->setPath(&fAlloc, fScalerContext.get())) {
64 delta = glyph->path()->approximateBytesUsed();
66 return {glyph->path(), delta};
69 std::tuple<const SkPath*, size_t> SkScalerCache::mergePath(SkGlyph* glyph, const SkPath* path) {
72 if (glyph->setPath(&fAlloc, path)) {
73 pathDelta = glyph->path()->approximateBytesUsed();
75 return {glyph->path(), pathDelta};
88 auto [glyph, size] = this->glyph(SkPackedGlyphID{glyphID});
91 auto [_, pathSize] = this->preparePath(glyph);
94 *cursor++ = glyph;
100 std::tuple<const void*, size_t> SkScalerCache::prepareImage(SkGlyph* glyph) {
102 if (glyph->setImage(&fAlloc, fScalerContext.get())) {
103 delta = glyph->imageSize();
105 return {glyph->image(), delta};
111 // TODO(herb): remove finding the glyph when we are sure there are no glyph collisions.
114 // Since there is no search for replacement glyphs, this glyph should not exist yet.
115 SkDEBUGFAIL("This implies adding to an existing glyph. This should not happen.");
120 SkGlyph* glyph = fAlloc.make<SkGlyph>(toID);
121 size_t delta = glyph->setMetricsAndImage(&fAlloc, from);
122 (void)this->addGlyph(glyph);
123 return {glyph, sizeof(SkGlyph) + delta};
147 auto[glyph, glyphSize] = this->glyph(glyphID);
148 auto[_, imageSize] = this->prepareImage(glyph);
150 *cursor++ = glyph;
176 // If the glyph is too large, then no image is created.
177 SkGlyph* glyph = fGlyphForIndex[digest.index()];
178 auto [image, imageSize] = this->prepareImage(glyph);
180 drawables->push_back(glyph, i);
225 SkGlyph* glyph = fGlyphForIndex[digest.index()];
227 auto [path, pathSize] = this->preparePath(glyph);
234 rejects->reject(i, glyph->maxDimension());
238 rejects->reject(i, glyph->maxDimension());
246 SkGlyph* glyph, SkScalar* array, int* count) {
248 glyph->ensureIntercepts(bounds, scale, xPos, array, count, &fAlloc);