aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/renderer/rects.rs
Commit message (Collapse)AuthorAge
* Remove unnecessary staticsIntegral2024-12-09
|
* Fallback to underline shader when dotted failsKirill Chibisov2023-12-02
| | | | | Some hardware is just bad. Fixes #7404.
* Remove `alacritty_config` from alacritty_terminalKirill Chibisov2023-11-10
| | | | | There's no need to force alacritty's user configuration on other users of the crate, thus provide the options actually used by alacritty_terminal itself.
* Use ahash instead of fnv and regular hash functionKirill Chibisov2023-07-24
| | | | | | | | After evaluation of the ahash with the data alacritty uses it was discovered that it's 1.5-2x times faster when getting the already hashed values, which is the primary cases for alacritty's renderer. Given that ahash is generally faster, all the HashSet and HashMap's inside the alacritty were changed to use it as a hasher function.
* Switch to VTE's built-in ansi featureAnhad Singh2023-05-23
| | | Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Revert "Apply 'font.glyph_offset.y' for underline/strikeout"Kirill Chibisov2023-02-05
| | | This reverts commit d5e9d1d88317afc1f4374f2c2a7679cece14cb7b.
* Apply 'font.glyph_offset.y' for underline/strikeoutKirill Chibisov2022-12-25
| | | Fixes #6561.
* Fix cursor and underlines always being blackKirill Chibisov2022-10-21
| | | | | | | Some old hardware doesn't like universal shader approach for all the rectangle kinds leading to ALU instruction limits. This commit fixes it by splitting the shader per rectangle kind. Fixes #6417.
* Fix clippy warningsChristian Duerr2022-10-12
| | | | | This patch applies all clippy lints currently present on the latest clippy master than are compatible with our oldstable clippy (only exception is the `_else(||` stuff).
* Extract `SizeInfo` from alacritty_terminalKirill Chibisov2022-04-06
| | | | | The `SizeInfo` is a SizeInfo used for rendering, which contains information about padding, and such, however all the terminal need is number of visible lines and columns.
* Add colored underline supportKirill Chibisov2022-03-16
| | | | | | | | | This commit adds support for colored underline and refines the dynamic extra storage. The extra storage now is using `Arc` making cloning it way faster compared to `Box` approach which scales really well when it comes to cloning in `Term::write_at_cursor`, since cloning `Arc` is constant time. Fixes #4142.
* Use round instead of ceil for line positionKirill Chibisov2022-03-06
| | | | Ceiling line position results in strikeout line being lower than it should.
* Add fallback GLES2 rendererKirill Chibisov2022-03-02
| | | | | | | | | | | | | | | | | | | | | Currently Alacritty only works on hardware which supports OpenGL 3.3 or more, which can become problematic with older devices. This patch adds a new GLES2 renderer, since it is much more widely supported, especially on weaker hardware like phones or a Raspberry Pi. While the GLES2 renderer is slower than the OpenGL 3.3+ version, it is still significantly faster than software rendering. However because of this performance difference it is only used when necessary and there should be no difference for machines supporting OpenGL 3.3+. The two renderers are largely independent and separated in the `renderer/text/glsl3` and `renderer/text/gles2` modules. Separate shaders are also required for text rendering. The rectangle rendering for underlines and the visual bell works identically for both versions, but does have some version-specific shader code. Fixes #128. Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Don't use 'origin_upper_left' in rect shadersKirill Chibisov2022-02-22
|
* Add support for dashed and dotted underlinesKirill Chibisov2022-02-14
| | | | This finishes implementation of underline styles provided by `CSI 4 : [1-5] m` escape sequence.
* Add support for drawing undercurlsKirill Chibisov2022-02-08
| | | Fixes #1628.
* Clean up and abstract shader creation codeoxalica2022-01-30
| | | Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Update rustfmt configurationChristian Duerr2021-10-11
| | | | | | | | | | | | | | | | | In this change I went through all current rustfmt configuration options and expanded our existing configuration with overrides whenever deemed appropriate. The `normalize_doc_attributes` option is still unstable, but seems to work without any issues. Even when passing macros like `include_str!` that is recognized properly and not normalized. So while this wasn't an issue anywhere in the code, it should make sure it never will be. When it comes to imports there are two new major additions. The `imports_granularity` and `group_imports` options. Both mostly just incorporate unwritten rules that have existed in Alacritty for a long time. Unfortunately since `alacritty_terminal` imports in `alacritty` are supposed to be separate blocks, the `group_imports` option cannot be used.
* Fix clippy warningsChristian Duerr2021-07-03
|
* Unify the grid line indexing typesChristian Duerr2021-03-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously Alacritty was using two different ways to reference lines in the terminal. Either a `usize`, or a `Line(usize)`. These indexing systems both served different purposes, but made it difficult to reason about logic involving these systems because of its inconsistency. To resolve this issue, a single new `Line(i32)` type has been introduced. All existing references to lines and points now rely on this definition of a line. The indexing starts at the top of the terminal region with the line 0, which matches the line 1 used by escape sequences. Each line in the history becomes increasingly negative and the bottommost line is equal to the number of visible lines minus one. Having a system which goes into the negatives allows following the escape sequence's indexing system closely, while at the same time making it trivial to implement `Ord` for points. The Alacritty UI crate is the only place which has a different indexing system, since rendering and input puts the zero line at the top of the viewport, rather than the top of the terminal region. All instances which refer to a number of lines/columns instead of just a single Line/Column have also been changed to use a `usize` instead. This way a Line/Column will always refer to a specific place in the grid and no confusion is created by having a count of lines as a possible index into the grid storage.
* Add Drop implementations for OpenGL structuresMikhail "L117" Nikolenko2021-02-19
|
* Move renderable cell transformation to alacrittyChristian Duerr2021-01-24
| | | | | | | | | | | | This refactors a large chunk of the alacritty_terminal API to expose all data necessary for rendering uniformly through the `renderable_content` call. This also no longer transforms the cells for rendering by a GUI but instead just reports the content from a terminal emulation perspective. The transformation into renderable cells is now done inside the alacritty crate. Since the terminal itself only ever needs to know about modified color RGB values, the configuration for colors was moved to the alacritty UI code.
* Draw cursor with rect rendererKirill Chibisov2020-12-28
| | | | | | | | This commit makes cursors being drawn via rects, thus it's always above underlines/strikeouts. Also, since the cursor isn't a glyph anymore, it can't be obscured due to atlas switching while glyphs are rendered. Fixes #4404. Fixes #3471.
* Remove live-shader-reload featureKirill Chibisov2020-12-10
| | | | | Since live-shader-reload is generally unused and unmaintained, and could only be used for debugging purposes, since it refers relative paths, this feature was removed for the sake of simplicity.
* Render underline and strikeout rects in batchesIvan Avdeev2020-12-10
| | | | | | | | | | | | | | | Currently Alacritty requires a separate `draw` call to OpenGL whenever a new rectangle is rendered to the screen. With many rectangles visible, this has a significant impact on rendering performance. Instead of using separate draw calls, the new `RectRenderer` will build a batch of rectangles for rendering. This makes sure that multiple rectangles can be grouped together for single draw calls allowing a reduced impact on rendering time. Since this change is OpenGL 2 friendly, it should not make it more complicated to transition away from the 3.3+ requirements like an alternative instancing based implementation might have.
* Fix wide characters being cut offKirill Chibisov2020-11-17
| | | Fixes #791.
* Use dynamic storage for zerowidth charactersChristian Duerr2020-11-05
| | | | | | | | | | | | | | | | | | | The zerowidth characters were conventionally stored in a [char; 5]. This creates problems both by limiting the maximum number of zerowidth characters and by increasing the cell size beyond what is necessary even when no zerowidth characters are used. Instead of storing zerowidth characters as a slice, a new CellExtra struct is introduced which can store arbitrary optional cell data that is rarely required. Since this is stored behind an optional pointer (Option<Box<CellExtra>>), the initialization and dropping in the case of no extra data are extremely cheap and the size penalty to cells without this extra data is limited to 8 instead of 20 bytes. The most noticible difference with this PR should be a reduction in memory size of up to at least 30% (1.06G -> 733M, 100k scrollback, 72 lines, 280 columns). Since the zerowidth characters are now stored dynamically, the limit of 5 per cell is also no longer present.
* Remove unneeded collect during line rect creationMark Lodato2020-10-22
|
* Add support for single line terminalsii412020-09-27
| | | | | | | | | | | | | | | | | This changes the minimum terminal dimensions from 2 lines and 2 columns, to 1 line and 2 columns. This also reworks the `SizeInfo` to store the number of columns and lines and consistently has only the terminal lines/columns stored, instead of including the message bar and search in some places of the Alacritty renderer/input. These new changes also make it easy to properly start the selection scrolling as soon as the mouse is over the message bar, instead of waiting until it is beyond it. Fixes #4207. Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Fix multiline URL highlightingChristian Duerr2020-08-30
| | | | Fixes #4182.
* Add support for double underlinesChristian Duerr2020-08-12
| | | | | | | | | | | | | This adds support for double underlines using the colon separated escape sequence `CSI 4 : 2 m`. Alacritty will now also always fallback to the normal underline in case any of the other underlines like the undercurl are specified. The escape sequence `CSI 4 : 0 m` can now be used to clear all underlines. Some terminals support `CSI 21 m` for double underline, but since Alacritty already uses that as cancel bold which is a little more consistent, that behavior has not changed. So the colon separated variant must be used.
* Rename font crate to crossfontChristian Duerr2020-07-18
|
* Remove copyright notice from filesChristian Duerr2020-06-06
| | | | | | | | | | | | | | Keeping the license as part of every file bloats up the files unnecessarily and introduces an additional overhead to the creation of new modules. Since cargo already provides excellent dependency management, most of the code-reuse of Alacritty should occur through Rust's dependency management instead of copying it source. If code is copied partially, copying the license from the main license file should be just as easy as copying from the top of the file and making some adjustments based on where it is used is likely necessary anyways.
* Extend style guideline documentationChristian Duerr2020-05-05
|
* Fix underline position for bitmap fontsKirill Chibisov2020-01-22
| | | | Fixes #3235.
* Move renderer from alacritty_terminal to alacrittyKirill Chibisov2019-11-23