Lines Matching defs:glyph
208 const void* DWriteOffscreen::draw(const SkGlyph& glyph, bool isBW) {
212 if (fWidth < glyph.fWidth || fHeight < glyph.fHeight) {
213 fWidth = SkMax32(fWidth, glyph.fWidth);
214 fHeight = SkMax32(fHeight, glyph.fHeight);
226 fXform.dx = SkFixedToFloat(glyph.getSubXFixed());
227 fXform.dy = SkFixedToFloat(glyph.getSubYFixed());
231 UINT16 index = glyph.getGlyphID();
265 "Could not create glyph run analysis.");
267 //NOTE: this assumes that the glyph has already been measured
268 //with an exact same glyph run analysis.
270 bbox.left = glyph.fLeft;
271 bbox.top = glyph.fTop;
272 bbox.right = glyph.fLeft + glyph.fWidth;
273 bbox.bottom = glyph.fTop + glyph.fHeight;
589 virtual void generateAdvance(SkGlyph* glyph) SK_OVERRIDE;
590 virtual void generateMetrics(SkGlyph* glyph) SK_OVERRIDE;
591 virtual void generateImage(const SkGlyph& glyph) SK_OVERRIDE;
592 virtual void generatePath(const SkGlyph& glyph, SkPath* path) SK_OVERRIDE;
748 void SkScalerContext_DW::generateAdvance(SkGlyph* glyph) {
752 glyph->fRsbDelta = 0;
753 glyph->fLsbDelta = 0;
755 glyph->fAdvanceX = 0;
756 glyph->fAdvanceY = 0;
758 uint16_t glyphId = glyph->getGlyphID();
779 glyph->fAdvanceX = SkScalarToFixed(vecs[0].fX);
780 glyph->fAdvanceY = SkScalarToFixed(vecs[0].fY);
783 void SkScalerContext_DW::generateMetrics(SkGlyph* glyph) {
784 glyph->fWidth = 0;
786 this->generateAdvance(glyph);
789 fXform.dx = SkFixedToFloat(glyph->getSubXFixed());
790 fXform.dy = SkFixedToFloat(glyph->getSubYFixed());
794 UINT16 glyphId = glyph->getGlyphID();
833 "Could not create glyph run analysis.");
839 glyph->fWidth = SkToU16(bbox.right - bbox.left);
840 glyph->fHeight = SkToU16(bbox.bottom - bbox.top);
841 glyph->fLeft = SkToS16(bbox.left);
842 glyph->fTop = SkToS16(bbox.top);
884 static void bilevel_to_bw(const uint8_t* SK_RESTRICT src, const SkGlyph& glyph) {
885 const int width = glyph.fWidth;
887 uint8_t* SK_RESTRICT dst = static_cast<uint8_t*>(glyph.fImage);
892 for (int y = 0; y < glyph.fHeight; ++y) {
923 static void rgb_to_a8(const uint8_t* SK_RESTRICT src, const SkGlyph& glyph, const uint8_t* table8) {
924 const size_t dstRB = glyph.rowBytes();
925 const U16CPU width = glyph.fWidth;
926 uint8_t* SK_RESTRICT dst = static_cast<uint8_t*>(glyph.fImage);
928 for (U16CPU y = 0; y < glyph.fHeight; y++) {
940 static void rgb_to_lcd16(const uint8_t* SK_RESTRICT src, const SkGlyph& glyph,
942 const size_t dstRB = glyph.rowBytes();
943 const U16CPU width = glyph.fWidth;
944 uint16_t* SK_RESTRICT dst = static_cast<uint16_t*>(glyph.fImage);
946 for (U16CPU y = 0; y < glyph.fHeight; y++) {
958 static void rgb_to_lcd32(const uint8_t* SK_RESTRICT src, const SkGlyph& glyph,
960 const size_t dstRB = glyph.rowBytes();
961 const U16CPU width = glyph.fWidth;
962 SkPMColor* SK_RESTRICT dst = static_cast<SkPMColor*>(glyph.fImage);
964 for (U16CPU y = 0; y < glyph.fHeight; y++) {
975 void SkScalerContext_DW::generateImage(const SkGlyph& glyph) {
980 const void* bits = fOffscreen.draw(glyph, isBW);
982 sk_bzero(glyph.fImage, glyph.computeImageSize());
986 //Copy the mask into the glyph.
989 bilevel_to_bw(src, glyph);
992 rgb_to_a8<true>(src, glyph, fPreBlend.fG);
994 rgb_to_a8<false>(src, glyph, fPreBlend.fG);
996 } else if (SkMask::kLCD16_Format == glyph.fMaskFormat) {
998 rgb_to_lcd16<true>(src, glyph, fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
1000 rgb_to_lcd16<false>(src, glyph, fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
1003 SkASSERT(SkMask::kLCD32_Format == glyph.fMaskFormat);
1005 rgb_to_lcd32<true>(src, glyph, fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
1007 rgb_to_lcd32<false>(src, glyph, fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
1012 void SkScalerContext_DW::generatePath(const SkGlyph& glyph, SkPath* path) {
1013 SkASSERT(&glyph && path);
1020 uint16_t glyphId = glyph.getGlyphID();
1031 "Could not create glyph outline.");
1398 // Construct Glyph to Unicode table.
1414 UINT16 glyph;
1415 hr = fontFace->GetGlyphIndices(&c, 1, &glyph);
1416 if (glyph > 0) {
1424 UINT16 glyph;
1425 hr = fontFace->GetGlyphIndices(&c, 1, &glyph);
1426 if (glyph > 0) {
1432 SkAutoTArray<UINT16> glyph(count);
1433 fontFace->GetGlyphIndices(chars.get(), count, glyph.get());
1437 if (glyph[j] > maxGlyph) maxGlyph = glyph[j];
1447 if (glyph[j] < glyphCount && (*glyphToUnicode)[glyph[j]] == 0) {
1448 (*glyphToUnicode)[glyph[j]] = chars[j];