9140 Commits

Author SHA1 Message Date
Mitchell Hashimoto
d6e243cde1 resize with reflow more cols 2022-09-03 17:28:26 -07:00
Mitchell Hashimoto
2583b8cb65 fix y pos on resize 2022-09-03 12:25:26 -07:00
Mitchell Hashimoto
41f2b756ae fix scrolling and new row calculation 2022-09-03 12:18:45 -07:00
Mitchell Hashimoto
d22a323896 clean up some assertions 2022-09-01 23:25:51 -07:00
Mitchell Hashimoto
81b805b8c2 use an arena allocator for tty allocs
libuv always called the alloc cb right before read, and read owns the
buffer. By using an arena, we're probably just reusing the same buffer
over and over again. This should be quite fast.

In tracing, this indeed changes the MTPC on ttyReadAlloc from ~750ns to
~275ns. I'll take it!
2022-09-01 22:48:33 -07:00
Mitchell Hashimoto
8d6e8eb0aa asserts not being optimized away, use comptime gate 2022-09-01 22:21:54 -07:00
Mitchell Hashimoto
57725cf3a4 cache row iterator max value 2022-09-01 22:05:42 -07:00
Mitchell Hashimoto
5aa6d79519 screen: cache history offset
This is a super hot calculation so taking up memory to cache it resulted
in 15m less function calls when catting a 10mb file, and ~5% speedup.
2022-09-01 21:36:59 -07:00
Mitchell Hashimoto
73581eee0b small optimizations 2022-09-01 18:36:27 -07:00
Mitchell Hashimoto
30a14d230e process ASCII events manually to avoid function call overhead 2022-09-01 17:53:40 -07:00
Mitchell Hashimoto
d404be2993 grow our scrollback much faster 2022-09-01 01:15:20 -07:00
Mitchell Hashimoto
dba027d307 resize should maintain minimum of screen rows 2022-09-01 01:09:06 -07:00
Mitchell Hashimoto
77c8ec0a20 the big screen switchover 2022-09-01 00:58:47 -07:00
Mitchell Hashimoto
2f2b12a32f resize without reflow preserves cursor better 2022-08-31 21:51:01 -07:00
Mitchell Hashimoto
89e931e468 our new resize without reflow supports scrollback so test that 2022-08-31 21:29:28 -07:00
Mitchell Hashimoto
4056f2abf9 new screen supports resize without reflow 2022-08-31 20:48:48 -07:00
Mitchell Hashimoto
621b067e83 update overlay but we still can't use master 2022-08-31 19:58:44 -07:00
Mitchell Hashimoto
cf969b27eb screen2: dynamically allow scrollback when its needed 2022-08-31 19:54:10 -07:00
Mitchell Hashimoto
a192249c77 circbuf rotateToZero does nothing if its already at zero 2022-08-31 19:33:28 -07:00
Mitchell Hashimoto
50612002a8 circbuf resize operation 2022-08-31 17:17:43 -07:00
Mitchell Hashimoto
b7b83db119 fix some circbuf bugs (add tests) and add rotation 2022-08-31 17:08:02 -07:00
Mitchell Hashimoto
cb06bf4873 use non-extern unions so we get safety checks 2022-08-31 16:02:22 -07:00
Mitchell Hashimoto
10ec5f509e circbuf doesn't use zeroes, it takes a default value 2022-08-31 15:27:45 -07:00
Mitchell Hashimoto
e8009f89cf add cursor to new screen 2022-08-31 15:13:30 -07:00
Mitchell Hashimoto
c7b7e3cb44 screen2: selection 2022-08-31 14:58:43 -07:00
Mitchell Hashimoto
f6f8fee804 screen2: scrolling (to a certain extent), copying in tests 2022-08-31 11:44:39 -07:00
Mitchell Hashimoto
001ec979a2 big API surface for screen2, can test write/read now 2022-08-30 17:33:25 -07:00
Mitchell Hashimoto
19b46b6084 starting the new screen implementation 2022-08-30 16:39:49 -07:00
Mitchell Hashimoto
f2af0983cf dedicated circular buffer 2022-08-30 16:35:44 -07:00
Mitchell Hashimoto
953f1aeb29 pkg/harfbuzz: fixing some APIs 2022-08-30 10:02:40 -07:00
Mitchell Hashimoto
36140d3ee9 TODO 2022-08-29 20:26:02 -07:00
Mitchell Hashimoto
39376feae0 font: shape API, calls shape and outputs some debug 2022-08-29 20:15:29 -07:00
Mitchell Hashimoto
5a232e0c3e utf8proc: add grapheme break API 2022-08-29 20:13:13 -07:00
Mitchell Hashimoto
dafc99746d font: Face initializes a hb_font alongside every face 2022-08-29 16:46:53 -07:00
Mitchell Hashimoto
0505018186 Line segmentation into text runs 2022-08-29 16:39:48 -07:00
Mitchell Hashimoto
f73783a521 pkg/harfbuzz: add guessSegmentProperties 2022-08-29 14:52:16 -07:00
Mitchell Hashimoto
2cab94e64d move cell metrics calculation out into src/font 2022-08-29 11:44:05 -07:00
Mitchell Hashimoto
bd9c048c02 use new font.GroupCache, remove unused font structs 2022-08-29 11:34:21 -07:00
Mitchell Hashimoto
a0aa100815 font: GroupCache is like Group, but with caching... 2022-08-29 11:10:50 -07:00
Mitchell Hashimoto
a75035c042 font: introduce Group which will eventually replace FallbackSet
This is more oriented around glyph indexes and also introduces an
important concept in the FontIndex which can be cached ahead of time so
that we can eventually break down text into runs for text shaping.
2022-08-29 10:16:53 -07:00
Mitchell Hashimoto
985b329c8a src/font: change Face to require font to init 2022-08-29 08:48:40 -07:00
Mitchell Hashimoto
f1abca51f7 convert src/font to use new pkg/freetype 2022-08-28 22:22:16 -07:00
Mitchell Hashimoto
28e9619361 allow non-printables even if modifiers are pressed 2022-08-28 21:12:58 -07:00
Mitchell Hashimoto
672f6e720c pkg/freetype: finish APIs we need 2022-08-28 21:06:36 -07:00
Mitchell Hashimoto
8ef3018189 pkg/freetype: loading glyphs 2022-08-28 21:02:39 -07:00
Mitchell Hashimoto
a2b06d7705 pkg/freetype: more face APIs 2022-08-28 17:18:23 -07:00
Mitchell Hashimoto
7af9091497 pkg/freetype: Library and Face 2022-08-28 17:07:27 -07:00
Mitchell Hashimoto
483bb90cf9 shader: only downsample glyph if its bigger than width plus padding 2022-08-28 16:57:30 -07:00
Mitchell Hashimoto
d8a06e7768 clean up some imports 2022-08-28 14:50:22 -07:00
Mitchell Hashimoto
f42bac6bc4 pkg/harfbuzz: use extern funcs for freetype interop 2022-08-28 14:47:47 -07:00