mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-07-10 17:53:23 +00:00
Backport fg override algo change from slang to legacy glsl shaders
This commit is contained in:
parent
d5b1cbf7b5
commit
b22b4431df
2 changed files with 10 additions and 3 deletions
|
|
@ -1,4 +1,3 @@
|
|||
#define DO_FG_OVERRIDE {DO_FG_OVERRIDE}
|
||||
#define FG_OVERRIDE_THRESHOLD {FG_OVERRIDE_THRESHOLD}
|
||||
#define FG_OVERRIDE_ALGO {FG_OVERRIDE_ALGO}
|
||||
#define TEXT_NEW_GAMMA {TEXT_NEW_GAMMA}
|
||||
|
|
@ -25,5 +24,11 @@
|
|||
#define ONLY_FOREGROUND
|
||||
#endif
|
||||
|
||||
#if FG_OVERRIDE_ALGO == 0
|
||||
#define DO_FG_OVERRIDE 0
|
||||
#else
|
||||
#define DO_FG_OVERRIDE 1
|
||||
#endif
|
||||
|
||||
// Linear space luminance values
|
||||
const vec3 Y = vec3(0.2126, 0.7152, 0.0722);
|
||||
|
|
|
|||
|
|
@ -190,11 +190,13 @@ class LoadShaderPrograms:
|
|||
)
|
||||
|
||||
def resolve_cell_defines(only_fg: int, only_bg: int, src: str) -> str:
|
||||
algo = '1' if self.text_fg_override_threshold.unit == '%' else '2'
|
||||
if not self.text_fg_override_threshold.scaled_value:
|
||||
algo = '0'
|
||||
r = self.cell_program_replacer.replacements
|
||||
r['ONLY_FOREGROUND'] = str(only_fg)
|
||||
r['ONLY_BACKGROUND'] = str(only_bg)
|
||||
r['DO_FG_OVERRIDE'] = '1' if self.text_fg_override_threshold.scaled_value else '0'
|
||||
r['FG_OVERRIDE_ALGO'] = '1' if self.text_fg_override_threshold.unit == '%' else '2'
|
||||
r['FG_OVERRIDE_ALGO'] = algo
|
||||
r['FG_OVERRIDE_THRESHOLD'] = str(self.text_fg_override_threshold.scaled_value)
|
||||
r['TEXT_NEW_GAMMA'] = '0' if self.text_old_gamma else '1'
|
||||
return self.cell_program_replacer(src)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue