Lines Matching refs:glyph

128         // this ID is based on the glyph index
139 SkGlyph* glyph = fGlyphHash[index];
141 if (NULL == glyph || glyph->fID != id) {
142 glyph = this->lookupMetrics(glyphID, kJustAdvance_MetricsType);
143 fGlyphHash[index] = glyph;
145 return *glyph;
159 // this ID is based on the glyph index
182 // this ID is based on the glyph index
199 SkGlyph* glyph = fGlyphHash[index];
201 if (NULL == glyph || glyph->fID != id) {
202 RecordHashCollisionIf(glyph != NULL);
203 glyph = this->lookupMetrics(glyphID, kFull_MetricsType);
204 fGlyphHash[index] = glyph;
207 if (glyph->isJustAdvance()) {
208 fScalerContext->getMetrics(glyph);
211 SkASSERT(glyph->isFullMetrics());
212 return *glyph;
220 SkGlyph* glyph = fGlyphHash[index];
222 if (NULL == glyph || glyph->fID != id) {
223 RecordHashCollisionIf(glyph != NULL);
224 glyph = this->lookupMetrics(id, kFull_MetricsType);
225 fGlyphHash[index] = glyph;
228 if (glyph->isJustAdvance()) {
229 fScalerContext->getMetrics(glyph);
232 SkASSERT(glyph->isFullMetrics());
233 return *glyph;
237 SkGlyph* glyph;
255 glyph = gptr[hi];
256 if (glyph->fID == id) {
257 if (kFull_MetricsType == mtype && glyph->isJustAdvance()) {
258 fScalerContext->getMetrics(glyph);
260 return glyph;
264 if (glyph->fID < id) {
269 // not found, but hi tells us where to inser the new glyph
272 glyph = (SkGlyph*)fGlyphAlloc.alloc(sizeof(SkGlyph),
274 glyph->init(id);
275 *fGlyphArray.insert(hi) = glyph;
278 fScalerContext->getAdvance(glyph);
282 fScalerContext->getMetrics(glyph);
286 return glyph;
289 const void* SkGlyphCache::findImage(const SkGlyph& glyph) {
290 if (glyph.fWidth > 0 && glyph.fWidth < kMaxGlyphWidth) {
291 if (glyph.fImage == NULL) {
292 size_t size = glyph.computeImageSize();
293 const_cast<SkGlyph&>(glyph).fImage = fImageAlloc.alloc(size,
296 if (glyph.fImage) {
297 fScalerContext->getImage(glyph);
306 return glyph.fImage;
309 const SkPath* SkGlyphCache::findPath(const SkGlyph& glyph) {
310 if (glyph.fWidth) {
311 if (glyph.fPath == NULL) {
312 const_cast<SkGlyph&>(glyph).fPath = SkNEW(SkPath);
313 fScalerContext->getPath(glyph, glyph.fPath);
315 glyph.fPath->getPoints(NULL, 0x7FFFFFFF) * sizeof(SkPoint);
318 return glyph.fPath;
658 const SkGlyph* glyph = fGlyphArray[i];
659 SkASSERT(glyph);
660 SkASSERT(fGlyphAlloc.contains(glyph));
661 if (glyph->fImage) {
662 SkASSERT(fImageAlloc.contains(glyph->fImage));