1 --- ./src/ports/SkFontHost_win.cpp.sav 2020-03-18 10:26:52.470184300 +0100
2 +++ ./src/ports/SkFontHost_win.cpp 2020-03-18 12:08:04.598406700 +0100
3 @@ -1215,17 +1215,23 @@
4 // since the caller may require A8 for maskfilters, we can't check for BW
5 // ... until we have the caller tell us that explicitly
6 const SkGdiRGB* src = (const SkGdiRGB*)bits;
7 +#if defined(SK_GAMMA_APPLY_TO_A8)
8 if (fPreBlend.isApplicable()) {
9 RGBToA8<true>(src, srcRB, glyph, fPreBlend.fG);
14 RGBToA8<false>(src, srcRB, glyph, fPreBlend.fG);
17 const SkGdiRGB* src = (const SkGdiRGB*)bits;
18 SkASSERT(SkMask::kLCD16_Format == glyph.fMaskFormat);
19 +#if defined(SK_GAMMA_APPLY_TO_A8)
20 if (fPreBlend.isApplicable()) {
21 RGBToLcd16<true>(src, srcRB, glyph, fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
26 RGBToLcd16<false>(src, srcRB, glyph, fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
29 --- ./src/ports/SkScalerContext_win_dw.cpp
30 +++ ./src/ports/SkScalerContext_win_dw.cpp
31 @@ -1132,27 +1132,36 @@ void SkScalerContext_DW::generateImage(const SkGlyph& glyph) {
32 BilevelToBW(src, glyph);
33 } else if (!isLCD(fRec)) {
34 if (textureType == DWRITE_TEXTURE_ALIASED_1x1) {
35 +#if defined(SK_GAMMA_APPLY_TO_A8)
36 if (fPreBlend.isApplicable()) {
37 GrayscaleToA8<true>(src, glyph, fPreBlend.fG);
42 GrayscaleToA8<false>(src, glyph, fPreBlend.fG);
45 +#if defined(SK_GAMMA_APPLY_TO_A8)
46 if (fPreBlend.isApplicable()) {
47 RGBToA8<true>(src, glyph, fPreBlend.fG);
52 RGBToA8<false>(src, glyph, fPreBlend.fG);
56 SkASSERT(SkMask::kLCD16_Format == glyph.fMaskFormat);
57 +#if defined(SK_GAMMA_APPLY_TO_A8)
58 if (fPreBlend.isApplicable()) {
59 if (fRec.fFlags & SkScalerContext::kLCD_BGROrder_Flag) {
60 RGBToLcd16<true, false>(src, glyph, fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
62 RGBToLcd16<true, true>(src, glyph, fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
68 if (fRec.fFlags & SkScalerContext::kLCD_BGROrder_Flag) {
69 RGBToLcd16<false, false>(src, glyph, fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);