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
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
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`)
- 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]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

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