mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-22 16:28:19 +02:00
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.
This commit is contained in:
@@ -14,6 +14,7 @@ from kitty.fast_data_types import (
|
||||
ParsedFontFeature,
|
||||
get_fallback_font,
|
||||
set_allow_use_of_box_fonts,
|
||||
sprite_idx_to_pos,
|
||||
sprite_map_set_layout,
|
||||
sprite_map_set_limits,
|
||||
test_render_line,
|
||||
@@ -231,7 +232,7 @@ def block_helpers(s, sprites, cell_width, cell_height):
|
||||
line = s.line(y)
|
||||
test_render_line(line)
|
||||
for x in range(width * scale):
|
||||
ans.append(sprites[line.sprite_at(x)])
|
||||
ans.append(sprites[sprite_idx_to_pos(line.sprite_at(x), setup_for_testing.xnum, setup_for_testing.ynum)])
|
||||
return ans
|
||||
|
||||
def block_test(*expected, **kw):
|
||||
|
||||
Reference in New Issue
Block a user