diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ports/SkScalerContext_win_dw.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/ports/SkScalerContext_win_dw.cpp b/src/ports/SkScalerContext_win_dw.cpp index 8f9a761614..dac3c827c1 100644 --- a/src/ports/SkScalerContext_win_dw.cpp +++ b/src/ports/SkScalerContext_win_dw.cpp @@ -594,7 +594,14 @@ void SkScalerContext_DW::generateColorMetrics(SkGlyph* glyph) { } bounds.join(path.getBounds()); } - HRV(fSkXform.mapRect(&bounds)); + SkMatrix matrix = fSkXform; +#ifndef SK_IGNORE_EMOJI_SUBPIXEL_FIX + if (this->isSubpixel()) { + matrix.postTranslate(SkFixedToScalar(glyph->getSubXFixed()), + SkFixedToScalar(glyph->getSubYFixed())); + } +#endif + matrix.mapRect(&bounds); // Round float bound values into integer. SkIRect ibounds = bounds.roundOut(); @@ -980,6 +987,12 @@ void SkScalerContext_DW::generateColorGlyphImage(const SkGlyph& glyph) { SkMatrix matrix = fSkXform; matrix.postTranslate(-SkIntToScalar(glyph.fLeft), -SkIntToScalar(glyph.fTop)); +#ifndef SK_IGNORE_EMOJI_SUBPIXEL_FIX + if (this->isSubpixel()) { + matrix.postTranslate(SkFixedToScalar(glyph.getSubXFixed()), + SkFixedToScalar(glyph.getSubYFixed())); + } +#endif SkRasterClip rc(SkIRect::MakeWH(glyph.fWidth, glyph.fHeight)); SkDraw draw; draw.fDst = SkPixmap(SkImageInfo::MakeN32(glyph.fWidth, glyph.fHeight, kPremul_SkAlphaType), |