Commit graph

15033 commits

Author SHA1 Message Date
Kovid Goyal
bbcb7dc24c
Fix cursor rendering when on first cell of multicell 2025-02-03 10:56:47 +05:30
Kovid Goyal
f67c58034c
Add tests for ch_and_idx 2025-02-03 10:56:47 +05:30
Kovid Goyal
72d88e75aa
Always zero memory from arena 2025-02-03 10:56:47 +05:30
Kovid Goyal
dc1bed1bd1
Use XXHash for hash table hashing of arbitrary sized keys
Much faster than FNV
2025-02-03 10:56:46 +05:30
Kovid Goyal
b602915d5b
... 2025-02-03 10:56:46 +05:30
Kovid Goyal
b7e8d6d103
Use an arena for TextCache as well 2025-02-03 10:56:46 +05:30
Kovid Goyal
1047142ee0
... 2025-02-03 10:56:46 +05:30
Kovid Goyal
0902f6aee0
Use an arena allocator for the sprite position map 2025-02-03 10:56:46 +05:30
Kovid Goyal
d781c671a1
Fix rendering of scaled url exclusions 2025-02-03 10:56:46 +05:30
Kovid Goyal
08d03a3e3a
... 2025-02-03 10:56:46 +05:30
Kovid Goyal
81a5f29979
Option to control underline exclusion 2025-02-03 10:56:46 +05:30
Kovid Goyal
1707e603f3
Implement underline exclusion 2025-02-03 10:56:46 +05:30
Kovid Goyal
eb322913c3
Remove a switch in the cell vertex shader 2025-02-03 10:56:46 +05:30
Kovid Goyal
e8fa5a3717
... 2025-02-03 10:56:46 +05:30
Kovid Goyal
27c862970b
Simplify sprite management code
Now if decorations are needed they are created *before* the index for
the sprite is assigned.
2025-02-03 10:56:46 +05:30
Kovid Goyal
70b0aecf32
Track the underline region for every decoration group 2025-02-03 10:56:46 +05:30
Kovid Goyal
b249fba93d
misc fixes for decoration rendering 2025-02-03 10:56:46 +05:30
Kovid Goyal
c3361cd26b
... 2025-02-03 10:56:46 +05:30
Kovid Goyal
3f04b31725
Fix build on older compiler 2025-02-03 10:56:46 +05:30
Kovid Goyal
88f796a94c
Read decorations indices from a separate texture 2025-02-03 10:56:45 +05:30
Kovid Goyal
b2a4db2028
Revert metadata row for sprites
Store in a separate VAO instead more performant as it uses less VRAM and
allows shader lookup co-ords to be passed to fragment shaders without
calculation in the fragment shader.
2025-02-03 10:56:45 +05:30
Kovid Goyal
9e9ab3e6f9
pass decorations location as sprite metadata 2025-02-03 10:56:45 +05:30
Kovid Goyal
5d195bf50b
Give sprites a metadata row accessible in the shaders
Will allow sprites to point to where their decorations should be read
from, for instance. Needed for scaled text and also if we want to
implement decoration avoidance.
2025-02-03 10:56:45 +05:30
Kovid Goyal
6a169eedd5
Move decorations drawing code to C form Python
Makes it faster and easier to call from C
2025-02-03 10:56:45 +05:30
Kovid Goyal
9f84c32808
Make undercurl_style available to C code 2025-02-03 10:56:45 +05:30
Kovid Goyal
0fb49f4139
Switch to using an index for sprite tracking
Frees up two bytes in GPUCell. Doesn't require a minimum texture row
size. Makes a bunch of code faster. Index uses 31 bits which gives us
2,147,483,647 aka ~ 2 billion sprites.
2025-02-03 10:56:45 +05:30
Kovid Goyal
203a5f4e00
... 2025-02-03 10:56:45 +05:30
Kovid Goyal
06f2e64cff
Remove duplicated data 2025-02-03 10:56:45 +05:30
Kovid Goyal
87dea95a0e
Fix rendering of scaled emoji 2025-02-03 10:56:45 +05:30
Kovid Goyal
27bcd96071
Tests for combining char on multicell 2025-02-03 10:56:45 +05:30
Kovid Goyal
06c428ba7b
Fix drawing multiple chars where the second or later char is on a multicell 2025-02-03 10:56:45 +05:30
Kovid Goyal
4a0086b241
Fix vertical_align serialization 2025-02-03 10:56:45 +05:30
Kovid Goyal
5c2c88858b
Implement reporting of multicell commands 2025-02-03 10:56:45 +05:30
Kovid Goyal
1aec299ad8
... 2025-02-03 10:56:45 +05:30
Kovid Goyal
1784823c18
macos implementation for face_apply_scale 2025-02-03 10:56:44 +05:30
Kovid Goyal
e6a4945aff
Get full sprite rendering tests to pass when doing shaping as well 2025-02-03 10:56:44 +05:30
Kovid Goyal
42e93d8caa
More work on scaled font rendering 2025-02-03 10:56:44 +05:30
Kovid Goyal
3dca2687d8
Make font rendering tests use a text font rather than system font 2025-02-03 10:56:44 +05:30
Kovid Goyal
850dcec4d7
Allow multiple box rendering chars per cell 2025-02-03 10:56:44 +05:30
Kovid Goyal
073d5c7340
Add test for quarter blocks 2025-02-03 10:56:44 +05:30
Kovid Goyal
b96da25380
More work on multicell font rendering 2025-02-03 10:56:44 +05:30
Kovid Goyal
8993386399
Store font related cell metrics in a single struct 2025-02-03 10:56:44 +05:30
Kovid Goyal
8030cbd361
Allow more subscales 2025-02-03 10:56:44 +05:30
Kovid Goyal
b1c80d212f
Allow non-width multicell code to fill multiple cells using native width algo 2025-02-03 10:56:44 +05:30
Kovid Goyal
844d538e40
When drawing text, skip past multiline chars 2025-02-03 10:56:44 +05:30
Kovid Goyal
5459f126c7
Fix out of bounds when nuking multiline char 2025-02-03 10:56:44 +05:30
Kovid Goyal
79a062466c
Fix render_box_cell test with odd block height 2025-02-03 10:56:44 +05:30
Kovid Goyal
35946f9386
Improve performance of processing wide chars
Store multi cell data in the CPUCell rather than in TextCache.
This sends the CPUCell size back to 12 but in benchmarks ASCII
performance is untouched and Unicode performace goes back to what it was
before multicell
2025-02-03 10:56:44 +05:30
Kovid Goyal
21871dcd58
Drop val access to CPUCell
Allows us to increase CPUCell beyond 8 bytes if needed
2025-02-03 10:56:44 +05:30
Kovid Goyal
383e1f8f57
Work on scaled rendering for box drawing chars 2025-02-03 10:56:43 +05:30