Bump version to 24.04.3.4
[LibreOffice.git] / external / skia / windows-text-gamma.patch.0
blob624636b7da9936757dedad0db370808cdea88220
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);
10 -        } else {
11 +        } else
12 +#endif
13 +        {
14              RGBToA8<false>(src, srcRB, glyph, fPreBlend.fG);
15          }
16      } else {    // LCD16
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);
22 -        } else {
23 +        } else
24 +#endif
25 +        {
26              RGBToLcd16<false>(src, srcRB, glyph, fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
27          }
28      }
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);
38 -            } else {
39 +            } else
40 +#endif
41 +            {
42                  GrayscaleToA8<false>(src, glyph, fPreBlend.fG);
43              }
44          } else {
45 +#if defined(SK_GAMMA_APPLY_TO_A8)
46              if (fPreBlend.isApplicable()) {
47                  RGBToA8<true>(src, glyph, fPreBlend.fG);
48 -            } else {
49 +            } else
50 +#endif
51 +            {
52                  RGBToA8<false>(src, glyph, fPreBlend.fG);
53              }
54          }
55      } else {
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);
61              } else {
62                  RGBToLcd16<true, true>(src, glyph, fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
63              }
64 -        } else {
65 +        } else
66 +#endif
67 +        {
68              if (fRec.fFlags & SkScalerContext::kLCD_BGROrder_Flag) {
69                  RGBToLcd16<false, false>(src, glyph, fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
70              } else {