refactor: remove opengl and OpenGL from names

It's not opengl specific any more and those names are overly
long and slightly misleading, so fix them up.
This commit is contained in:
Wez Furlong committed 2023-04-01 07:06:26 -07:00
1 parent aa51468e28
commit ed67d0449a
6 files changed
+29 -29

No files matched your search

+4 -4
View File
@@ -121,11 +121,11 @@ pub struct LineToElementShape {
pub cluster: CellCluster,
}
pub struct RenderScreenLineOpenGLResult {
pub struct RenderScreenLineResult {
pub invalidate_on_hover_change: bool,
}
pub struct RenderScreenLineOpenGLParams<'a> {
pub struct RenderScreenLineParams<'a> {
/// zero-based offset from top of the window viewport to the line that
/// needs to be rendered, measured in pixels
pub top_pixel_y: f32,
@@ -382,7 +382,7 @@ impl crate::TermWindow {
gl_state: &RenderState,
quads: &mut dyn QuadAllocator,
pos_x: f32,
params: &RenderScreenLineOpenGLParams,
params: &RenderScreenLineParams,
hsv: Option<config::HsbTransform>,
glyph_color: LinearRgba,
) -> anyhow::Result<()> {
@@ -412,7 +412,7 @@ impl crate::TermWindow {
layers: &mut TripleLayerQuadAllocator,
layer_num: usize,
cell_idx: usize,
params: &RenderScreenLineOpenGLParams,
params: &RenderScreenLineParams,
hsv: Option<config::HsbTransform>,
glyph_color: LinearRgba,
) -> anyhow::Result<()> {
+7 -7
View File
@@ -27,7 +27,7 @@ impl crate::TermWindow {
}
'pass: for pass in 0.. {
match self.paint_opengl_pass() {
match self.paint_pass() {
Ok(_) => match self.render_state.as_mut().unwrap().allocated_more_quads() {
Ok(allocated) => {
if !allocated {
@@ -83,7 +83,7 @@ impl crate::TermWindow {
self.shape_cache.borrow_mut().clear();
self.line_to_ele_shape_cache.borrow_mut().clear();
} else {
log::error!("paint_opengl_pass failed: {:#}", err);
log::error!("paint_pass failed: {:#}", err);
break 'pass;
}
}
@@ -98,8 +98,8 @@ impl crate::TermWindow {
self.last_frame_duration,
self.fps
);
metrics::histogram!("gui.paint.opengl", self.last_frame_duration);
metrics::histogram!("gui.paint.opengl.rate", 1.);
metrics::histogram!("gui.paint.impl", self.last_frame_duration);
metrics::histogram!("gui.paint.impl.rate", 1.);
self.update_title_post_status();
// If self.has_animation is some, then the last render detected
@@ -145,7 +145,7 @@ impl crate::TermWindow {
Ok(())
}
pub fn paint_opengl_pass(&mut self) -> anyhow::Result<()> {
pub fn paint_pass(&mut self) -> anyhow::Result<()> {
{
let gl_state = self.render_state.as_ref().unwrap();
for layer in gl_state.layers.borrow().iter() {
@@ -224,13 +224,13 @@ impl crate::TermWindow {
mux::Mux::get().record_focus_for_current_identity(pos.pane.pane_id());
}
}
self.paint_pane_opengl(&pos, num_panes, &mut layers)?;
self.paint_pane(&pos, num_panes, &mut layers)?;
}
if let Some(pane) = self.get_active_pane_or_overlay() {
let splits = self.get_splits();
for split in &splits {
self.paint_split_opengl(&mut layers, split, &pane)?;
self.paint_split(&mut layers, split, &pane)?;
}
}
+7 -7
View File
@@ -3,7 +3,7 @@ use crate::selection::SelectionRange;
use crate::termwindow::box_model::*;
use crate::termwindow::render::{
same_hyperlink, CursorProperties, LineQuadCacheKey, LineQuadCacheValue, LineToEleShapeCacheKey,
RenderScreenLineOpenGLParams,
RenderScreenLineParams,
};
use crate::termwindow::{ScrollHit, UIItem, UIItemType};
use ::window::bitmaps::TextureRect;
@@ -20,7 +20,7 @@ use wezterm_term::{Line, StableRowIndex};
use window::color::LinearRgba;
impl crate::TermWindow {
fn paint_pane_opengl_new(
fn paint_pane_box_model(
&mut self,
pos: &PositionedPane,
num_panes: usize,
@@ -32,14 +32,14 @@ impl crate::TermWindow {
self.render_element(&computed, gl_state, None)
}
pub fn paint_pane_opengl(
pub fn paint_pane(
&mut self,
pos: &PositionedPane,
num_panes: usize,
layers: &mut TripleLayerQuadAllocator,
) -> anyhow::Result<()> {
if self.config.use_box_model_render {
return self.paint_pane_opengl_new(pos, num_panes);
return self.paint_pane_box_model(pos, num_panes);
}
self.check_for_dirty_lines_and_invalidate_selection(&pos.pane);
@@ -481,8 +481,8 @@ impl crate::TermWindow {
},
};
let render_result = self.term_window.render_screen_line_opengl(
RenderScreenLineOpenGLParams {
let render_result = self.term_window.render_screen_line(
RenderScreenLineParams {
top_pixel_y: *quad_key.top_pixel_y,
left_pixel_x: self.left_pixel_x,
pixel_width: self.dims.cols as f32
@@ -568,7 +568,7 @@ impl crate::TermWindow {
// TODO: render a thingy to jump to prior prompt
}
*/
metrics::histogram!("paint_pane_opengl.lines", start.elapsed());
metrics::histogram!("paint_pane.lines", start.elapsed());
log::trace!("lines elapsed {:?}", start.elapsed());
Ok(())
@@ -2,7 +2,7 @@ use crate::quad::{QuadTrait, TripleLayerQuadAllocator, TripleLayerQuadAllocatorT
use crate::termwindow::render::{
resolve_fg_color_attr, same_hyperlink, update_next_frame_time, ClusterStyleCache,
ComputeCellFgBgParams, ComputeCellFgBgResult, LineToElementParams, LineToElementShape,
RenderScreenLineOpenGLParams, RenderScreenLineOpenGLResult,
RenderScreenLineParams, RenderScreenLineResult,
};
use crate::termwindow::LineToElementShapeItem;
use ::window::DeadKeyStatus;
@@ -21,16 +21,16 @@ impl crate::TermWindow {
/// This is nominally a matter of setting the fg/bg color and the
/// texture coordinates for a given glyph. There's a little bit
/// of extra complexity to deal with multi-cell glyphs.
pub fn render_screen_line_opengl(
pub fn render_screen_line(
&self,
params: RenderScreenLineOpenGLParams,
params: RenderScreenLineParams,
layers: &mut TripleLayerQuadAllocator,
) -> anyhow::Result<RenderScreenLineOpenGLResult> {
) -> anyhow::Result<RenderScreenLineResult> {
if params.line.is_double_height_bottom() {
// The top and bottom lines are required to have the same content.
// For the sake of simplicity, we render both of them as part of
// rendering the top row, so we have nothing more to do here.
return Ok(RenderScreenLineOpenGLResult {
return Ok(RenderScreenLineResult {
invalidate_on_hover_change: false,
});
}
@@ -694,9 +694,9 @@ impl crate::TermWindow {
)?;
}
metrics::histogram!("render_screen_line_opengl", start.elapsed());
metrics::histogram!("render_screen_line", start.elapsed());
Ok(RenderScreenLineOpenGLResult {
Ok(RenderScreenLineResult {
invalidate_on_hover_change,
})
}
+1 -1
View File
@@ -5,7 +5,7 @@ use mux::tab::{PositionedSplit, SplitDirection};
use std::sync::Arc;
impl crate::TermWindow {
pub fn paint_split_opengl(
pub fn paint_split(
&mut self,
layers: &mut TripleLayerQuadAllocator,
split: &PositionedSplit,
+3 -3
View File
@@ -1,5 +1,5 @@
use crate::quad::TripleLayerQuadAllocator;
use crate::termwindow::render::RenderScreenLineOpenGLParams;
use crate::termwindow::render::RenderScreenLineParams;
use crate::utilsprites::RenderMetrics;
use config::ConfigHandle;
use mux::renderable::RenderableDimensions;
@@ -51,8 +51,8 @@ impl crate::TermWindow {
self.config.text_background_opacity
});
self.render_screen_line_opengl(
RenderScreenLineOpenGLParams {
self.render_screen_line(
RenderScreenLineParams {
top_pixel_y: tab_bar_y,
left_pixel_x: 0.,
pixel_width: self.dimensions.pixel_width as f32,