Lines Matching refs:glyph

57 // Set to make glyph bounding boxes visible.
154 const SkGlyph& glyph, CGGlyph glyphID,
168 if (SkMask::kBW_Format != glyph.maskFormat()) {
174 if (!generateA8FromLCD && SkMask::kA8_Format == glyph.maskFormat()) {
182 if (SkMask::kARGB32_Format == glyph.maskFormat()) {
187 if (!fCG || fSize.fWidth < glyph.width() || fSize.fHeight < glyph.height()) {
188 if (fSize.fWidth < glyph.width()) {
189 fSize.fWidth = RoundSize(glyph.width());
191 if (fSize.fHeight < glyph.height()) {
192 fSize.fHeight = RoundSize(glyph.height());
197 const CGImageAlphaInfo alpha = (glyph.isColor())
211 // then CG cannot draw the glyph in the correct location without subpixel positioning.
237 // skip rows based on the glyph's height
238 image += (fSize.fHeight - glyph.height()) * fSize.fWidth;
240 // Erase to white (or transparent black if it's a color glyph, to not composite against white).
241 uint32_t bgColor = (!glyph.isColor()) ? 0xFFFFFFFF : 0x00000000;
242 sk_memset_rect32(image, bgColor, glyph.width(), glyph.height(), rowBytes);
247 subX = SkFixedToFloat(glyph.getSubXFixed());
248 subY = SkFixedToFloat(glyph.getSubYFixed());
251 CGPoint point = CGPointMake(-glyph.left() + subX, glyph.top() + glyph.height() - subY);
253 // 'positions' which are in text space. The glyph location (in device space) must be
268 bool SkScalerContext_Mac::generateAdvance(SkGlyph* glyph) {
272 void SkScalerContext_Mac::generateMetrics(SkGlyph* glyph) {
273 glyph->fMaskFormat = fRec.fMaskFormat;
275 const CGGlyph cgGlyph = (CGGlyph) glyph->getGlyphID();
276 glyph->zeroMetrics();
283 glyph->fAdvanceX = SkFloatFromCGFloat(cgAdvance.width);
284 glyph->fAdvanceY = -SkFloatFromCGFloat(cgAdvance.height);
291 // of CTFontGetVerticalTranslationsForGlyphs to calculate where to draw the glyph for vertical
292 // glyphs. As a result, always get the horizontal bounds of a glyph and translate it if the
293 // glyph is vertical. This avoids any diagreement between the various means of retrieving
326 skBounds.fRight += SkFixedToFloat(glyph->getSubXFixed());
327 skBounds.fBottom += SkFixedToFloat(glyph->getSubYFixed());
343 glyph->fLeft = SkToS16(skIBounds.fLeft);
344 glyph->fTop = SkToS16(skIBounds.fTop);
345 glyph->fWidth = SkToU16(skIBounds.width());
346 glyph->fHeight = SkToU16(skIBounds.height());
389 const SkGlyph& glyph, void* glyphImage, const uint8_t* table8) {
390 const int width = glyph.width();
391 const int height = glyph.height();
392 size_t dstRB = glyph.rowBytes();
420 const SkGlyph& glyph, void* glyphImage,
422 const int width = glyph.width();
423 const int height = glyph.height();
424 size_t dstRB = glyph.rowBytes();
447 void SkScalerContext_Mac::generateImage(const SkGlyph& glyph) {
448 CGGlyph cgGlyph = SkTo<CGGlyph>(glyph.getGlyphID());
453 // Draw the glyph
455 CGRGBPixel* cgPixels = fOffscreen.getCG(*this, glyph, cgGlyph, &cgRowBytes, requestSmooth);
460 // Fix the glyph
461 if ((glyph.fMaskFormat == SkMask::kLCD16_Format) ||
462 (glyph.fMaskFormat == SkMask::kA8_Format
474 for (int y = 0; y < glyph.fHeight; ++y) {
475 for (int x = 0; x < glyph.fWidth; ++x) {
485 // Convert glyph to mask
486 switch (glyph.fMaskFormat) {
489 RGBToLcd16<true>(cgPixels, cgRowBytes, glyph, glyph.fImage,
492 RGBToLcd16<false>(cgPixels, cgRowBytes, glyph, glyph.fImage,
498 RGBToA8<true>(cgPixels, cgRowBytes, glyph, glyph.fImage, fPreBlend.fG);
500 RGBToA8<false>(cgPixels, cgRowBytes, glyph, glyph.fImage, fPreBlend.fG);
504 const int width = glyph.fWidth;
505 size_t dstRB = glyph.rowBytes();
506 uint8_t* dst = (uint8_t*)glyph.fImage;
507 for (int y = 0; y < glyph.fHeight; y++) {
514 const int width = glyph.fWidth;
515 size_t dstRB = glyph.rowBytes();
516 SkPMColor* dst = (SkPMColor*)glyph.fImage;
517 for (int y = 0; y < glyph.fHeight; y++) {
612 bool SkScalerContext_Mac::generatePath(SkGlyphID glyph, SkPath* path) {
646 CGGlyph cgGlyph = SkTo<CGGlyph>(glyph);