Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(671)

Unified Diff: src/ports/SkFontHost_FreeType.cpp

Issue 411313002: Colored Emoji not drawn in Chrome if font style is set as Bold (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Comment fixes Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/fonts/SkTestScalerContext.cpp ('k') | src/ports/SkFontHost_win.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_FreeType.cpp
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index 0307d362712104f8dd0bd9c2580ee5c0f3183240..1c0b04e464fd6784665737dd009692698772c3ef 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -1026,6 +1026,7 @@ SkScalerContext_FreeType::SkScalerContext_FreeType(SkTypeface* typeface,
if (fStrikeIndex == -1) {
SkDEBUGF(("no glyphs for font \"%s\" size %f?\n",
fFace->family_name, SkFixedToScalar(fScaleY)));
+ this->setGenerateImageFromPath(true);
} else {
// FreeType does no provide linear metrics for bitmap fonts.
linearMetrics = false;
@@ -1037,6 +1038,7 @@ SkScalerContext_FreeType::SkScalerContext_FreeType(SkTypeface* typeface,
// However, in FreeType 2.5.1 color bitmap only fonts do not ignore this flag.
// Force this flag off for bitmap only fonts.
fLoadGlyphFlags &= ~FT_LOAD_NO_BITMAP;
+ this->setGenerateImageFromPath(false);
}
} else {
SkDEBUGF(("unknown kind of font \"%s\" size %f?\n",
@@ -1264,8 +1266,10 @@ void SkScalerContext_FreeType::generateMetrics(SkGlyph* glyph) {
}
if (fFace->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_BGRA) {
+ this->setGenerateImageFromPath(false);
glyph->fMaskFormat = SkMask::kARGB32_Format;
- }
+ } else
+ this->setGenerateImageFromPath(true);
glyph->fWidth = SkToU16(fFace->glyph->bitmap.width);
glyph->fHeight = SkToU16(fFace->glyph->bitmap.rows);
« no previous file with comments | « src/fonts/SkTestScalerContext.cpp ('k') | src/ports/SkFontHost_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698