Adjust the workaround for non-linear blending of transparent pixels in compositors to hopefully further reduce fringing around text with certain color issues

Fixes #6534
This commit is contained in:
Kovid Goyal
2023-09-17 20:39:56 +05:30
parent 8a211fa689
commit 3a34664483
2 changed files with 6 additions and 2 deletions

View File

@@ -82,6 +82,10 @@ Detailed list of changes
- Wayland: Do not request idle inhibition for full screen windows (:iss:`6613`) - Wayland: Do not request idle inhibition for full screen windows (:iss:`6613`)
- Adjust the workaround for non-linear blending of transparent pixels in
compositors to hopefully further reduce fringing around text with certain
color issues (:iss:`6534`)
0.29.2 [2023-07-27] 0.29.2 [2023-07-27]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -160,8 +160,8 @@ float adjust_alpha_for_incorrect_blending_by_compositor(float text_fg_alpha, flo
// background_opacity non-linear // background_opacity non-linear
// See https://github.com/kovidgoyal/kitty/issues/6209 for discussion. // See https://github.com/kovidgoyal/kitty/issues/6209 for discussion.
const float threshold = 0.000001; const float threshold = 0.000001;
// linear2srgb(final_alpha) if text_fg_alpha >= threshold else final_alpha // ans = text_fg_alpha * linear2srgb(final_alpha) + (1 - text_fg_alpha) * final_alpha
return mix(final_alpha, linear2srgb(final_alpha), step(threshold, text_fg_alpha)); return mix(final_alpha, linear2srgb(final_alpha), text_fg_alpha);
} }
void main() { void main() {