mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-27 03:42:49 +00:00
graphics: make N a transient usage-hints bitmask
Change the graphics protocol N key from a boolean into a usage-hints bitmask. Define the first bit as a transient hint, allowing the terminal to treat the image data as short-lived and apply optimizations such as skipping disk cache writes. Propagate the transient hint through frame coalescing and composition, so a composed frame is transient if any contributing frame is transient.
This commit is contained in:
parent
cc2d7a1789
commit
89946ebc07
8 changed files with 54 additions and 28 deletions
|
|
@ -386,7 +386,7 @@ class TestGraphics(BaseTest):
|
|||
self.assertIsNone(li(payload='2' * 12, z=77, m=1, q=2))
|
||||
self.assertIsNone(li(payload='2' * 12))
|
||||
|
||||
def test_no_disk_cache_graphics_image(self):
|
||||
def test_transient_graphics_image(self):
|
||||
s, g, pl, sl = load_helpers(self)
|
||||
self.assertEqual(g.disk_cache.end_of_data_offset(), 0)
|
||||
self.ae(pl('abc', s=1, v=1, f=24, N=1), 'OK')
|
||||
|
|
|
|||
|
|
@ -920,7 +920,7 @@ class TestParser(BaseTest):
|
|||
k.setdefault(f, b'\0')
|
||||
for f in ('format more id data_sz data_offset width height x_offset y_offset data_height data_width cursor_movement'
|
||||
' num_cells num_lines cell_x_offset cell_y_offset z_index placement_id image_number quiet unicode_placement'
|
||||
' parent_id parent_placement_id offset_from_parent_x offset_from_parent_y'
|
||||
' parent_id parent_placement_id usage_hints offset_from_parent_x offset_from_parent_y'
|
||||
).split():
|
||||
k.setdefault(f, 0)
|
||||
p = k.pop('payload', '')
|
||||
|
|
@ -943,6 +943,7 @@ class TestParser(BaseTest):
|
|||
t('a=t,t=d,s=100,z=-9', payload='X', action='t', transmission_type='d', data_width=100, z_index=-9)
|
||||
t('a=t,t=d,s=100,z=9', payload='payload', action='t', transmission_type='d', data_width=100, z_index=9)
|
||||
t('a=t,t=d,s=100,z=9,q=2', action='t', transmission_type='d', data_width=100, z_index=9, quiet=2)
|
||||
t('N=1', usage_hints=1)
|
||||
e(',s=1', 'Malformed GraphicsCommand control block, invalid key character: 0x2c')
|
||||
e('W=1', 'Malformed GraphicsCommand control block, invalid key character: 0x57')
|
||||
e('1=1', 'Malformed GraphicsCommand control block, invalid key character: 0x31')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue