Chromium Code Reviews| Index: src/ports/SkFontHost_FreeType_common.cpp |
| diff --git a/src/ports/SkFontHost_FreeType_common.cpp b/src/ports/SkFontHost_FreeType_common.cpp |
| index 065a83a41c2d4c3546363d311ec501cdb57b40ab..df7d8a44be2e6dba8aaa630d01f7fe21ab211e4f 100644 |
| --- a/src/ports/SkFontHost_FreeType_common.cpp |
| +++ b/src/ports/SkFontHost_FreeType_common.cpp |
| @@ -344,11 +344,6 @@ void SkScalerContext_FreeType_Base::generateGlyphImage(FT_Face face, const SkGly |
| FT_BBox bbox; |
| FT_Bitmap target; |
| - if (fRec.fFlags & SkScalerContext::kEmbolden_Flag && |
| - !(face->style_flags & FT_STYLE_FLAG_BOLD)) { |
| - emboldenOutline(face, outline); |
| - } |
| - |
| int dx = 0, dy = 0; |
| if (fRec.fFlags & SkScalerContext::kSubpixelPositioning_Flag) { |
| dx = SkFixedToFDot6(glyph.getSubXFixed()); |
| @@ -547,10 +542,6 @@ static int cubic_proc(const FT_Vector* pt0, const FT_Vector* pt1, |
| void SkScalerContext_FreeType_Base::generateGlyphPath(FT_Face face, |
| SkPath* path) |
| { |
| - if (fRec.fFlags & SkScalerContext::kEmbolden_Flag) { |
|
bungeman-skia
2013/12/16 16:33:36
I am of two minds about removing this from here an
zheng.xu
2013/12/17 10:02:51
Moving this to SkFontHost_FreeType changes the beh
|
| - emboldenOutline(face, &face->glyph->outline); |
| - } |
| - |
| FT_Outline_Funcs funcs; |
| funcs.move_to = move_proc; |
| @@ -577,3 +568,20 @@ void SkScalerContext_FreeType_Base::emboldenOutline(FT_Face face, FT_Outline* ou |
| / 24; |
| FT_Outline_Embolden(outline, strength); |
| } |
| + |
| +void SkScalerContext_FreeType_Base::emboldenIfNeeded(FT_Face face, FT_GlyphSlot glyph) |
|
bungeman-skia
2013/12/16 16:33:36
Having this here seems a bit silly if it's only ca
zheng.xu
2013/12/17 10:02:51
Done.
|
| +{ |
| + if (fRec.fFlags & SkScalerContext::kEmbolden_Flag) { |
| + switch ( glyph->format ) { |
| + case FT_GLYPH_FORMAT_OUTLINE: |
| + emboldenOutline(face, &glyph->outline); |
| + break; |
| + case FT_GLYPH_FORMAT_BITMAP: |
| + FT_GlyphSlot_Own_Bitmap(glyph); |
| + FT_Bitmap_Embolden(glyph->library, &glyph->bitmap, kBitmapEmboldenStrength, 0); |
| + break; |
| + default: |
| + SkDEBUGFAIL("unknown glyph format"); |
| + } |
| + } |
| +} |