mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 22:28:24 +02:00
Revert "Fix a regression when tinting of background images was introduced that caused window borders to have background_opacity applied to them"
This reverts commit 33e4a0f9cc.
Fixes #7895
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
uniform uvec2 viewport;
|
||||
uniform uint colors[9];
|
||||
uniform float background_opacity;
|
||||
uniform float tint_opacity, tint_premult;
|
||||
uniform float gamma_lut[256];
|
||||
in vec4 rect; // left, top, right, bottom
|
||||
@@ -41,7 +42,7 @@ void main() {
|
||||
float is_window_bg = is_integer_value(rc, 3.);
|
||||
float is_default_bg = is_integer_value(rc, 0.);
|
||||
color3 = is_window_bg * window_bg + (1. - is_window_bg) * color3;
|
||||
float final_opacity = is_default_bg * tint_opacity + (1. - is_default_bg);
|
||||
float final_premult_opacity = is_default_bg * tint_premult + (1. - is_default_bg);
|
||||
float final_opacity = is_default_bg * tint_opacity + (1. - is_default_bg) * background_opacity;
|
||||
float final_premult_opacity = is_default_bg * tint_premult + (1. - is_default_bg) * background_opacity;
|
||||
color = vec4(color3 * final_premult_opacity, final_opacity);
|
||||
}
|
||||
|
||||
@@ -1087,13 +1087,15 @@ create_border_vao(void) {
|
||||
|
||||
void
|
||||
draw_borders(ssize_t vao_idx, unsigned int num_border_rects, BorderRect *rect_buf, bool rect_data_is_dirty, uint32_t viewport_width, uint32_t viewport_height, color_type active_window_bg, unsigned int num_visible_windows, bool all_windows_have_same_bg, OSWindow *w) {
|
||||
float tint_opacity = w->is_semi_transparent ? w->background_opacity: 1.0f;
|
||||
float tint_premult = tint_opacity;
|
||||
float background_opacity = w->is_semi_transparent ? w->background_opacity: 1.0f;
|
||||
float tint_opacity = background_opacity;
|
||||
float tint_premult = background_opacity;
|
||||
if (has_bgimage(w)) {
|
||||
glEnable(GL_BLEND);
|
||||
BLEND_ONTO_OPAQUE;
|
||||
draw_background_image(w);
|
||||
BLEND_ONTO_OPAQUE;
|
||||
background_opacity = 1.0f;
|
||||
tint_opacity = OPT(background_tint) * OPT(background_tint_gaps);
|
||||
tint_premult = w->is_semi_transparent ? OPT(background_tint) : 1.0f;
|
||||
}
|
||||
@@ -1114,6 +1116,7 @@ draw_borders(ssize_t vao_idx, unsigned int num_border_rects, BorderRect *rect_bu
|
||||
w->tab_bar_edge_color.left, w->tab_bar_edge_color.right
|
||||
};
|
||||
glUniform1uiv(border_program_layout.uniforms.colors, arraysz(colors), colors);
|
||||
glUniform1f(border_program_layout.uniforms.background_opacity, background_opacity);
|
||||
glUniform1f(border_program_layout.uniforms.tint_opacity, tint_opacity);
|
||||
glUniform1f(border_program_layout.uniforms.tint_premult, tint_premult);
|
||||
glUniform2ui(border_program_layout.uniforms.viewport, viewport_width, viewport_height);
|
||||
|
||||
Reference in New Issue
Block a user