summaryrefslogtreecommitdiff
path: root/src/renderer/OpenGL.zig
AgeCommit message (Collapse)Author
2024-10-09renderer: cleanup, reduce nesting, more commentsQwerasd
2024-10-08renderer, shaper: don't use null cells, handle bg and decorations separatelyQwerasd
Significant rework that also removes a lot of unnecessarily duplicated work while rebuilding cells in both renderers. Fixes multiple issues with decorations and bg colors on wide chars and ligatures, while reducing the amount of special case handling required.
2024-10-04renderer: fg/bg/cursor change must mark the screen as dirtyMitchell Hashimoto
Fixes #2372
2024-10-02fix(renderer): make all decorations and combining marks visible under cursorQwerasd
Metal needed to be changed to account for wide chars having decorations on the right half and OpenGL needed to account for multiple glyphs being under the cursor at once (decorations and combining marks) as well as wide chars.
2024-10-02fix(renderer): use 1-wide ul/st chars, ignore null shaper cellsQwerasd
This makes sure that underline styles are consistent and not stretched, and avoids rendering overlapping text decorations or extraneous background cells for the right halves of wide chars.
2024-09-23renderer/OpenGL: use better logic for whether to render glyphQwerasd
Metal already had this change made, so I copied it over from there. This logic is more straightforward. Also copied the check to skip 0-sized glyphs, since sometimes, for example, spaces are emitted as glyphs by the shaper for some reason, even though they have no actual content, and we want to avoid sending a bunch of useless stuff to the GPU.
2024-09-23renderer: draw underlines below text to improve legibilityQwerasd
2024-09-18renderer: render lock for password inputMitchell Hashimoto
2024-09-17config: move optional path parsing into RepeatablePathGregory Anders
This commit refactors RepeatablePath to contain a list of tagged unions containing "optional" and "required" variants. Both variants have a null terminated file path as their payload, but the tag dictates whether the path must exist or not. This implemenation is used to force consumers to handle the optional vs. required distinction. This also moves the parsing of optional file paths into RepeatablePath's parseCLI function. This allows the code to be better unit tested. Since RepeatablePath no longer contains a simple list of RepeatableStrings, many other of its methods needed to be reimplemented as well. Because all of this functionality is built into the RepeatablePath type, other config options which also use RepeatablePath gain the ability to specify optional paths as well. Right now this is only the "custom-shaders" option. The code paths in the renderer to load shader files has been updated accordingly. In the original optional config file parsing, the leading ? character was removed when paths were expanded. Thus, when config files were actually loaded recursively, they appeared to be regular (required) config files and an error occurred if the file did not exist. **This issue was not found during testing because the presence of the "theme" option masks the error**. I am not sure why the presence of "theme" does this, I did not dig into that. Now because the "optional" or "required" state of each path is tracked in the enum tag the "optional" status of the path is preserved after being expanded to an absolute path. Finally, this commit fixes a bug where missing "config-file" files were not included in the +show-config command (i.e. if a user had `config-file = foo.conf` and `foo.conf` did not exist, then `ghostty +show-config` would only display `config-file =`). This bug applied to `custom-shaders` too, where it has also been fixed.
2024-08-22renderer: do not extend padding color if any cell has default bg colorMitchell Hashimoto
Before, cells that were explicitly set to match the default bg color were treated as if they did NOT have the default and extending would occur. We now check the exact RGB of each cell.
2024-08-18renderer: use fg as extension color for covering glyphs (U+2588)Mitchell Hashimoto
Fixes #2099 This is another heuristic of sorts to make `window-padding-color=extend` look better by default. If a fully covering glyph is used then we use the fg color to extend rather than the background. This doesn't account for fonts that may do this for whatever codepoints, but I think that's a special scenario that we should just recommend disabling this feature.
2024-08-15kitty graphics: support loading 1 channel grayscale imagesQwerasd
2024-08-15renderer/opengl: add comment explaning ogl lock on darwinMitchell Hashimoto
2024-08-14macos/opengl: lock context while rendering to stop resize crashesQwerasd
2024-08-14renderer: don't update frame if renderer grid size != terminal sizeQwerasd
2024-08-11spelling: normalize grey -> grayQwerasd
2024-08-10renderer: remove alt-screen extend-alwaysMitchell Hashimoto
2024-08-10config: add window-padding-color=extend-always to force alwaysMitchell Hashimoto
2024-08-09renderer/opengl: reset screen uniforms on font changeMitchell Hashimoto
Fixes #2067
2024-08-06Merge pull request #2049 from ↵Mitchell Hashimoto
pluiedev/fix/exempt-powerline-from-minimum-contrast renderer: exempt Powerline cells from minimum contrast requirements
2024-08-06renderer: exempt Powerline cells from minimum contrast requirementsLeah Amelia Chen
With a minimum contrast set, the colored glyphs that Powerline uses would sometimes be set to white or black while the surrounding background colors remain unchanged, breaking up contiguous colors on segments of the Powerline. This no longer happens with this patch as Powerline glyphs are now special-cased and exempt from the minimum contrast adjustment.
2024-08-05chore: clean up typosŁukasz Niemier
2024-08-03renderer: disable window-padding-color=extend in certain scenariosMitchell Hashimoto
There are scenarios where this configuration looks bad. This commit introduces some heuristics to prevent it. Here are the heuristics: * Extension is always enabled on alt screen. * Extension is disabled if a row contains any default bg color. The thinking is that in this scenario, using the default bg color looks just fine. * Extension is disabled if a row is marked as a prompt (using semantic prompt sequences). The thinking here is that prompts often contain perfect fit glyphs such as Powerline glyphs and those look bad when extended. This introduces some CPU cost to the extension feature but it should be minimal and respects dirty tracking. This is unfortunate but the feature makes many terminal scenarios look much better and the performance cost is minimal so I believe it is worth it. Further heuristics are likely warranted but this should be a good starting set.
2024-08-03renderer/opengl: support window-padding-color=extendMitchell Hashimoto
2024-07-31Merge pull request #1989 from gpanders/cursor-invert-fg-bgMitchell Hashimoto
config: add cursor-invert-fg-bg option
2024-07-29renderer/opengl: unicode placeholder supportMitchell Hashimoto
2024-07-25renderer: skip virtual placementsMitchell Hashimoto
2024-07-22renderer/opengl: implement cursor-invert-fg-bgGregory Anders
2024-06-23Merge pull request #1872 from qwerasd205/various-performanceMitchell Hashimoto
Various Performance Changes
2024-06-22coretext shaper owns CFReleaseThread, works on both Metal and OpenGL nowMitchell Hashimoto
2024-06-22font: coretext shaper owns the cf release poolMitchell Hashimoto
2024-06-18renderer/opengl: invert cursor cell text when glyph is constrainedMitchell Hashimoto
Fixes #1867
2024-06-14add CFReleasePool handling to OpenGL rendererQwerasd
2024-06-03renderer/opengl: don't append assume capacityMitchell Hashimoto
Fixes #1815
2024-05-25terminal: support using the bright palette for bold textJan200101
2024-05-22renderer: kitty image with y offset should stretch imageMitchell Hashimoto
Fixes #1784 This was just a misunderstanding of the "spec." When both a y offset into the image is specified and a height, the image should be stretched. I mistakingly thought that the image should be offset (even with this misunderstanding there was a data corruption bug). This resolves the issue and output matches Kitty.
2024-05-10fix(renderer): rebuild font grid and reset shaper cache on hot reloadQwerasd
When hot reloading config with a new font, shaper cache data needs to be invalidated and the font grid needs to be rebuilt. This change just makes that happen on all config reloads since it's a rare action so it's not a performance concern.
2024-05-05renderer: add window-vsync option (defaults to false)Mitchell Hashimoto
2024-05-04renderer/metal: stop/start display link on occlusionMitchell Hashimoto
2024-05-01renderer/opengl: use shaper cacheMitchell Hashimoto
2024-04-28renderer/opengl: fix compilationMitchell Hashimoto
2024-04-22renderer/opengl: strikethrough as spriteMitchell Hashimoto
2024-04-06font: remove old filesMitchell Hashimoto
2024-04-06address many fontmem todosMitchell Hashimoto
2024-04-06renderer/opengl: set the font gridMitchell Hashimoto
2024-04-06renderer/opengl: support font size changeMitchell Hashimoto
2024-04-06renderer/opengl: clean up texture syncMitchell Hashimoto
2024-04-05renderer/opengl: convert to SharedGrid, new windows/tabs are frozenMitchell Hashimoto
2024-03-22renderer: re-enable URL underliningMitchell Hashimoto
2024-03-22renderer/opengl: convertMitchell Hashimoto