mirror of
https://github.com/wez/wezterm.git
synced 2024-11-24 07:46:59 +03:00
cleanup: remove bg color from vertex
Now that we have dual-source blending, this is unused
This commit is contained in:
parent
ab6c4777cb
commit
0a5a4cb642
@ -7,7 +7,6 @@ in float o_has_color;
|
||||
in vec2 o_tex;
|
||||
in vec3 o_hsv;
|
||||
in vec4 o_fg_color;
|
||||
in vec4 o_bg_color;
|
||||
|
||||
// The color + alpha
|
||||
layout(location=0, index=0) out vec4 color;
|
||||
|
@ -8,7 +8,6 @@ in vec2 position;
|
||||
in vec2 adjust;
|
||||
in vec2 tex;
|
||||
in vec4 fg_color;
|
||||
in vec4 bg_color;
|
||||
in float has_color;
|
||||
in vec3 hsv;
|
||||
|
||||
@ -18,13 +17,11 @@ out float o_has_color;
|
||||
out vec2 o_tex;
|
||||
out vec3 o_hsv;
|
||||
out vec4 o_fg_color;
|
||||
out vec4 o_bg_color;
|
||||
|
||||
void pass_through_vertex() {
|
||||
o_tex = tex;
|
||||
o_has_color = has_color;
|
||||
o_fg_color = fg_color;
|
||||
o_bg_color = bg_color;
|
||||
o_hsv = hsv;
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,6 @@ pub struct Vertex {
|
||||
// glyph texture
|
||||
pub tex: (f32, f32),
|
||||
pub fg_color: (f32, f32, f32, f32),
|
||||
pub bg_color: (f32, f32, f32, f32),
|
||||
pub hsv: (f32, f32, f32),
|
||||
// We use a float for this because I can't get
|
||||
// bool or integer values to work:
|
||||
@ -38,9 +37,7 @@ pub struct Vertex {
|
||||
// image, we use the solid bg color
|
||||
pub has_color: f32,
|
||||
}
|
||||
::window::glium::implement_vertex!(
|
||||
Vertex, position, adjust, tex, fg_color, bg_color, hsv, has_color
|
||||
);
|
||||
::window::glium::implement_vertex!(Vertex, position, adjust, tex, fg_color, hsv, has_color);
|
||||
|
||||
/// A helper for updating the 4 vertices that compose a glyph cell
|
||||
pub struct Quad<'a> {
|
||||
@ -92,12 +89,6 @@ impl<'a> Quad<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_bg_color(&mut self, color: LinearRgba) {
|
||||
for v in self.vert.iter_mut() {
|
||||
v.bg_color = color.tuple();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_hsv(&mut self, hsv: Option<config::HsbTransform>) {
|
||||
let s = hsv
|
||||
.map(|t| (t.hue, t.saturation, t.brightness))
|
||||
|
@ -575,10 +575,6 @@ impl super::TermWindow {
|
||||
let mut quads = vb.map(&mut vb_mut);
|
||||
let palette = pane.palette();
|
||||
let foreground = rgbcolor_to_window_color(palette.split);
|
||||
let background = rgbcolor_alpha_to_window_color(
|
||||
palette.background,
|
||||
self.config.window_background_opacity,
|
||||
);
|
||||
let cell_width = self.render_metrics.cell_size.width as f32;
|
||||
let cell_height = self.render_metrics.cell_size.height as f32;
|
||||
|
||||
@ -602,7 +598,6 @@ impl super::TermWindow {
|
||||
.texture_coords();
|
||||
|
||||
let mut quad = quads.allocate()?;
|
||||
quad.set_bg_color(background);
|
||||
quad.set_fg_color(foreground);
|
||||
quad.set_hsv(None);
|
||||
quad.set_texture(sprite);
|
||||
@ -753,7 +748,6 @@ impl super::TermWindow {
|
||||
pos_x + cluster_width as f32 * cell_width,
|
||||
pos_y + cell_height,
|
||||
);
|
||||
quad.set_bg_color(bg_color);
|
||||
quad.set_fg_color(bg_color);
|
||||
quad.set_texture(params.white_space);
|
||||
quad.set_texture_adjust(0., 0., 0., 0.);
|
||||
@ -776,7 +770,6 @@ impl super::TermWindow {
|
||||
pos_y + cell_height,
|
||||
);
|
||||
|
||||
quad.set_bg_color(params.selection_bg);
|
||||
quad.set_fg_color(params.selection_bg);
|
||||
quad.set_texture_adjust(0., 0., 0., 0.);
|
||||
quad.set_texture(params.white_space);
|
||||
@ -966,7 +959,6 @@ impl super::TermWindow {
|
||||
pos_x + cursor_width * cell_width,
|
||||
pos_y + cell_height,
|
||||
);
|
||||
quad.set_bg_color(bg_color);
|
||||
quad.set_fg_color(bg_color);
|
||||
quad.set_texture(params.white_space);
|
||||
quad.set_texture_adjust(0., 0., 0., 0.);
|
||||
@ -1000,7 +992,6 @@ impl super::TermWindow {
|
||||
params.cursor_border_color
|
||||
};
|
||||
quad.set_fg_color(color);
|
||||
quad.set_bg_color(bg_color);
|
||||
}
|
||||
|
||||
let images = cluster.attrs.images().unwrap_or_else(|| vec![]);
|
||||
@ -1029,7 +1020,6 @@ impl super::TermWindow {
|
||||
|
||||
quad.set_texture(style_params.underline_tex_rect);
|
||||
quad.set_fg_color(style_params.underline_color);
|
||||
quad.set_bg_color(bg_color);
|
||||
}
|
||||
|
||||
let mut did_custom = false;
|
||||
@ -1046,7 +1036,6 @@ impl super::TermWindow {
|
||||
¶ms,
|
||||
hsv,
|
||||
glyph_color,
|
||||
bg_color,
|
||||
)?;
|
||||
}
|
||||
did_custom = true;
|
||||
@ -1090,7 +1079,6 @@ impl super::TermWindow {
|
||||
pos_x + cell_width,
|
||||
pos_y + cell_height,
|
||||
);
|
||||
quad.set_bg_color(bg_color);
|
||||
quad.set_fg_color(glyph_color);
|
||||
quad.set_texture(texture_rect);
|
||||
quad.set_texture_adjust(left, top, right, bottom);
|
||||
@ -1141,7 +1129,6 @@ impl super::TermWindow {
|
||||
pos_y + cell_height,
|
||||
);
|
||||
|
||||
quad.set_bg_color(params.foreground);
|
||||
quad.set_fg_color(params.foreground);
|
||||
quad.set_texture_adjust(0., 0., 0., 0.);
|
||||
quad.set_texture(params.white_space);
|
||||
@ -1196,7 +1183,6 @@ impl super::TermWindow {
|
||||
quad.set_hsv(hsv);
|
||||
|
||||
quad.set_texture(tex);
|
||||
quad.set_bg_color(bg_color);
|
||||
quad.set_fg_color(if self.config.force_reverse_video_cursor {
|
||||
bg_color
|
||||
} else {
|
||||
@ -1228,7 +1214,6 @@ impl super::TermWindow {
|
||||
params: &RenderScreenLineOpenGLParams,
|
||||
hsv: Option<config::HsbTransform>,
|
||||
glyph_color: LinearRgba,
|
||||
bg_color: LinearRgba,
|
||||
) -> anyhow::Result<()> {
|
||||
let sprite = gl_state
|
||||
.glyph_cache
|
||||
@ -1247,7 +1232,6 @@ impl super::TermWindow {
|
||||
+ self.config.window_padding.left as f32;
|
||||
quad.set_position(pos_x, pos_y, pos_x + cell_width, pos_y + cell_height);
|
||||
quad.set_hsv(hsv);
|
||||
quad.set_bg_color(bg_color);
|
||||
quad.set_fg_color(glyph_color);
|
||||
quad.set_texture(sprite);
|
||||
quad.set_texture_adjust(0., 0., 0., 0.);
|
||||
|
Loading…
Reference in New Issue
Block a user