tdf#154285 Check upper bound of arguments in SbRtl_Minute function
[LibreOffice.git] / external / skia / windows-text-gamma.patch.0
blobaad89597a4479672b12434ebe9eca4c08e79c73e
1 --- ./src/ports/SkFontHost_win.cpp      2024-10-04 15:24:40.448100018 +0200
2 +++ ./src/ports/SkFontHost_win.cpp      2024-10-04 15:26:22.284624363 +0200
3 @@ -1149,18 +1149,24 @@
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, imageBuffer, fPreBlend.fG);
10 -        } else {
11 +        } else
12 +#endif
13 +        {
14              RGBToA8<false>(src, srcRB, glyph, imageBuffer, fPreBlend.fG);
15          }
16      } else {    // LCD16
17          const SkGdiRGB* src = (const SkGdiRGB*)bits;
18          SkASSERT(SkMask::kLCD16_Format == glyph.maskFormat());
19 +#if defined(SK_GAMMA_APPLY_TO_A8)
20          if (fPreBlend.isApplicable()) {
21              RGBToLcd16<true>(src, srcRB, glyph, imageBuffer,
22                               fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
23 -        } else {
24 +        } else
25 +#endif
26 +        {
27              RGBToLcd16<false>(src, srcRB, glyph, imageBuffer,
28                                fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
29          }
30 --- ./src/ports/SkScalerContext_win_dw.cpp      2024-10-04 15:24:40.448100018 +0200
31 +++ ./src/ports/SkScalerContext_win_dw.cpp      2024-10-04 15:29:29.810572073 +0200
32 @@ -2127,20 +2127,27 @@
33          BilevelToBW(src, glyph, imageBuffer);
34      } else if (!isLCD(fRec)) {
35          if (textureType == DWRITE_TEXTURE_ALIASED_1x1) {
36 +#if defined(SK_GAMMA_APPLY_TO_A8)
37              if (fPreBlend.isApplicable()) {
38                  GrayscaleToA8<true>(src, glyph, imageBuffer, fPreBlend.fG);
39 -            } else {
40 +            } else
41 +#endif
42 +            {
43                  GrayscaleToA8<false>(src, glyph, imageBuffer, fPreBlend.fG);
44              }
45          } else {
46 +#if defined(SK_GAMMA_APPLY_TO_A8)
47              if (fPreBlend.isApplicable()) {
48                  RGBToA8<true>(src, glyph, imageBuffer, fPreBlend.fG);
49 -            } else {
50 +            } else
51 +#endif
52 +            {
53                  RGBToA8<false>(src, glyph, imageBuffer, fPreBlend.fG);
54              }
55          }
56      } else {
57          SkASSERT(SkMask::kLCD16_Format == glyph.maskFormat());
58 +#if defined(SK_GAMMA_APPLY_TO_A8)
59          if (fPreBlend.isApplicable()) {
60              if (fRec.fFlags & SkScalerContext::kLCD_BGROrder_Flag) {
61                  RGBToLcd16<true, false>(src, glyph, imageBuffer,
62 @@ -2149,7 +2156,9 @@
63                  RGBToLcd16<true, true>(src, glyph, imageBuffer,
64                                         fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
65              }
66 -        } else {
67 +        } else
68 +#endif
69 +        {
70              if (fRec.fFlags & SkScalerContext::kLCD_BGROrder_Flag) {
71                  RGBToLcd16<false, false>(src, glyph, imageBuffer,
72                                           fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);