Commit Graph

65 Commits

Author SHA1 Message Date
Kovid Goyal
8dea5b3e3e Reduce data sent to GPU per draw by 30%
Split up the Cell structure into a CPUCell and a GPUCell. Only the
GPUCell part needs to be sent to the GPU. Should make kitty use even
less system resources and make a performance difference on systems where
the GPU bandwidth is constrained.

Also allows adding more CPU only data in the future without affecting
GPU bandwidth. For example, hyperlinks or more combining characters.
2018-05-27 21:25:09 +05:30
Kovid Goyal
6f2d63eb87 Implement SGR dim
kitty now supports the SGR DIM escape code, which makes text fade into
the background. It works by alpha blending the text color into the
background color. Fixes #446
2018-05-20 10:43:26 +05:30
Kovid Goyal
bb06bfa627 Cleanup the as_text_generic macro
Also allow adding a \r at the end of each visual line
2018-05-18 23:06:06 +05:30
Kovid Goyal
16e77d7329 Replace use of PyObject_Str in a couple more places 2018-03-16 21:26:46 +05:30
Kovid Goyal
527255e3a1 Fix compilation with gcc 8
Apparently some nitwit Linux distros have made an unreleased compiler
their default compiler. Fixes #376

Fixes various new warnings that GCC 8 issues
2018-03-12 10:38:12 +05:30
Kovid Goyal
9c21610215 Use a single generic function to get text and ANSI representations of all buffers 2018-02-14 20:38:53 +05:30
Kovid Goyal
2ee9844c2b Track cursor position explicitly during rewrap
Instead of using heuristics to position the cursor after a resize, track
the position during re-wrapping and place the cursor at the re-wrapped
position. Fixes #242 (I hope)
2018-02-02 13:06:18 +05:30
Kovid Goyal
e5b9bd2e5a Implement @get-text 2018-01-09 22:48:24 +05:30
Kovid Goyal
0fcce6ec58 Remove trailing whitespace from native code files 2017-12-20 08:44:47 +05:30
Kovid Goyal
356722b9a6 Fix build failure on systems with __OPTIMZE__ defined
Fixes #181
2017-11-24 22:42:56 +05:30
Kovid Goyal
6c838bbc28 Implement dirty line tracking 2017-11-09 16:55:45 +05:30
Kovid Goyal
0277be5856 Track line dirty status in the line buffer 2017-11-09 16:55:45 +05:30
Kovid Goyal
f25d2ea540 Rip out the old sprite update code 2017-11-09 16:45:45 +05:30
Kovid Goyal
21ed07d7ce Ensure python type objects are declared in onlya single unit 2017-11-01 13:14:50 +05:30
Kovid Goyal
3ca45ab241 Fix cursor moving one line up when resizing 2017-09-20 10:59:31 +05:30
Kovid Goyal
a92b3c605f Move the text attributes out of the char type
This means that more text attributes can be added in the future (there
are 8 bits available) and there is no need to keep bit twiddling when
accessing the chars themselves. Also means less data needs to be sent to
the GPU. Cell size does not change since there were currently 2 unused
bytes because of alignment.
2017-09-16 11:02:42 +05:30
Kovid Goyal
0b656246fd Fix cursor width incorrect after scrolling 2017-09-15 11:44:16 +05:30
Kovid Goyal
bc97cfa024 Use a null to represent a blank rather than a space
This has performance benefits when clearing (can use a single
memset). Also allows detecting trailing whitespace on lines correctly.
2017-09-15 10:45:16 +05:30
Kovid Goyal
f655112bda Directly copy the sprite positions into the GPU buffer 2017-09-15 10:45:15 +05:30
Kovid Goyal
e8b5a72c96 Remove GIL management code since it is no longer needed 2017-09-15 10:45:11 +05:30
Kovid Goyal
fe764ab6b6 oops 2017-09-15 10:45:08 +05:30
Kovid Goyal
564010c7cd Migrate history.c 2017-09-15 10:45:08 +05:30
Kovid Goyal
4fd8c7cfaa DRYer 2017-09-15 10:45:08 +05:30
Kovid Goyal
0cbd3a2820 Start work on using a struct for the cell
Should eventually allow the screen buf to be sent directly to the GPU
without a serialization step.

Migrates line-buf.c
2017-09-15 10:45:07 +05:30
Kovid Goyal
788f09e855 Use a special test launcher that links the sanitize runtime library directly 2017-05-15 12:07:36 +05:30
Kovid Goyal
69b187a743 Split up the color field into fg/bg colors
Avoid a lot of unnecessary masking as well as unaligned read/writes
2017-05-15 12:06:06 +05:30
Kovid Goyal
315595aa77 ... 2016-12-18 14:02:03 +05:30
Kovid Goyal
3e1dac97ad Fix a couple of out of bounds memory reads 2016-12-18 13:58:01 +05:30
Kovid Goyal
0797f159ad Only move the cursor a line down on resize if the cursor line was split 2016-12-12 12:44:33 +05:30
Kovid Goyal
ae3f555f51 HistoryBuf.as_ansi() 2016-12-09 19:39:20 +05:30
Kovid Goyal
5a6ecbbf43 LineBuf.as_ansi() 2016-12-09 12:44:39 +05:30
Kovid Goyal
d132ba5a48 Implement DECALN 2016-11-30 08:34:02 +05:30
Kovid Goyal
992aaf96d5 Show a wide cursor when over a wide character 2016-11-21 14:30:08 +05:30
Kovid Goyal
5681138243 Fix scrollback_lines opt not being used 2016-11-21 09:07:52 +05:30
Kovid Goyal
5dccb91996 Make the rewrap algorithm re-useable for rewrapping of HistoryBuf as well 2016-11-20 22:22:39 +05:30
Kovid Goyal
0b0a216856 Use HistoryBuf (still need to implement rewrap) 2016-11-20 20:20:14 +05:30
Kovid Goyal
6c39b07552 Implement Screen.resize 2016-11-18 12:38:31 +05:30
Kovid Goyal
a734fb79e6 All screen tests pass with the new screen code 2016-11-13 22:23:28 +05:30
Kovid Goyal
fa106c2585 More work on migrating Screen 2016-11-13 16:51:14 +05:30
Kovid Goyal
9a7b4263e0 More work on the screen replacement
The first set of tests now pass
2016-11-13 14:10:57 +05:30
Kovid Goyal
fab2213c25 More work on native streams 2016-11-13 10:24:00 +05:30
Kovid Goyal
2c0523246d More work on making Screen native 2016-11-12 13:52:18 +05:30
Kovid Goyal
c8a71ef5f8 Move the update_cell_data() inner loop to native code 2016-11-12 10:57:06 +05:30
Kovid Goyal
286a9f77bc Fix a memory leak in rewrap() 2016-11-11 21:54:52 +05:30
Kovid Goyal
b12af6f21d Test for LineBuf.clear()
Also raise IndexError instead of ValueError for line and char access
2016-11-10 12:05:50 +05:30
Kovid Goyal
d874155f1e ... 2016-11-10 11:53:10 +05:30
Kovid Goyal
c6780ca463 ... 2016-11-09 19:11:32 +05:30
Kovid Goyal
7108584e7a A more accurate, but slower rewrap algorithm 2016-11-09 17:47:03 +05:30
Kovid Goyal
8623e7b6e7 More tests for rewrap 2016-11-09 11:19:17 +05:30
Kovid Goyal
0904939e4a Some test for rewrap 2016-11-08 21:25:26 +05:30