config_host/config_skia.h.in | 13 +++++++++++++ 1 file changed, 13 insertions(+)
New commits: commit bb524f6e95c70021463a72de106bf4348f660acd Author: Jonathan Clark <jonat...@libreoffice.org> AuthorDate: Fri Jul 4 10:45:43 2025 -0600 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Jul 4 22:43:07 2025 +0200 tdf#166339 skia: Tune font gamma to improve contrast Added platform-specific adjustments for font gamma curve and contrast. For most platforms, the default values from BUILD.gn are used. For Windows, the values are based on manual testing to subjectively recover as much contrast as possible while still reducing subpixel antialiasing artifacts to a reasonable level. Change-Id: If6898ed6eff3766bbb0ce3032fe7bb1fea13128a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187416 Reviewed-by: Jonathan Clark <jonat...@libreoffice.org> Tested-by: Jenkins (cherry picked from commit 3a14edb8b3fd295190291c1371b76399aef50303) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187427 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/config_host/config_skia.h.in b/config_host/config_skia.h.in index 500b7391b73c..322dedb18440 100644 --- a/config_host/config_skia.h.in +++ b/config_host/config_skia.h.in @@ -51,6 +51,19 @@ are the same. // backends, but that is because the other backends don't handle gamma correctly. #define SK_GAMMA_APPLY_TO_A8 1 +// Platform-specific font gamma tuning to recover some contrast while still +// reducing artifacts. Most values are from BUILD.gn. +#if defined(_WIN32) +#define SK_GAMMA_SRGB 1 +#define SK_GAMMA_CONTRAST 0.75 +#elif defined(__APPLE__) +#define SK_GAMMA_SRGB 1 +#define SK_GAMMA_CONTRAST 0.0 +#else +#define SK_GAMMA_EXPONENT 1.2 +#define SK_GAMMA_CONTRAST 0.2 +#endif + // These are just to avoid warnings (some headers use them even with GL disabled). #define SK_ASSUME_GL 1 #define SK_ASSUME_GL_ES 0