summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 14:59:21 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit360b72ade0acfa655a3740b638a0cc8e23238a05 (patch)
tree4bc9464da2cdcfd6fe636979f0b457221ec92c3d /test
parentd88e381793c6505bf3f2af43705bd2fa32f55ef6 (diff)
downloadpardes-360b72ade0acfa655a3740b638a0cc8e23238a05.tar.gz
pardes-360b72ade0acfa655a3740b638a0cc8e23238a05.zip
The GUI draws in tiers from the regions; pane chrome moves with its pane
Stage 8 of docs/render-pipeline.md. The frame is drawn in groups: tier 0, one per track in paint order (tiers 2 and 3), tier 4 (notices, then guides and the debug box), tier 5 (bar cursors), each cells, images, decor. Decor (rules, rails, thumbs, grip marks, spines, the workspace and column rules, the bottom band, notice rules, bar cursors) is whole-pixel rects through the new decor.frag over ui.vert, so it carries its track's transition and clip. A closing pane's chrome comes from Surface.previous_regions. Deleted: taglineBaseRgb, topbarPaneBorderHeight, bottomTaglinePresent, frameChromeBg, cellBackgroundIs and the rail inference, paneGripCell's scan, transient_on, PaintPlan. One cover map (coverFrame) is marked from the layers and regions once a frame. New regions column, guide and debug; Surface.chrome is the palette, carried in wire v8 (not shipped yet), so an attached GUI draws the same chrome (test). A per-instance clip replaces the vertical transition's scissor. Goldens: 01-12 byte-identical. 13-17 differ only past the grid: the image pass left its scissor at the grid's size, cutting rule ends, rail feet and the bottom band in the leftover pixels whenever a picture was on screen. 16-debug now shows the debug box, which a context-row layer had hidden. 18-mid-transition is new: virtual clock (PARDES_TEST_CLOCK in the GUI), PanelSlide Newcol with the picture, frame 6 of 12. Also: the GUI sleeps when idle instead of polling every 16 ms, and a minimized or occluded window sleeps through animation. Tracy 'gui frame build' at 200x60: 992/1015 us median before, 989/987 us after. Shared files touched: pardes.zig (one export), detached/client.zig, detached/server.zig, detached/wire.zig (all additive), gui.zig. Not touched: Messages.zig, mouse.zig, tagline.zig, colors.zig, tty.zig, host_io.zig, dump.zig, exec.zig, panes.zig.
Diffstat (limited to 'test')
-rw-r--r--test/gui-goldens.txt11
-rw-r--r--test/gui_golden.py18
2 files changed, 20 insertions, 9 deletions
diff --git a/test/gui-goldens.txt b/test/gui-goldens.txt
index e52155a3..27c39150 100644
--- a/test/gui-goldens.txt
+++ b/test/gui-goldens.txt
@@ -10,8 +10,9 @@
10-tagbottom dd8ba0d3ecabf3420d000b0c9591a57278179cbd2a9060f849d283f3881d1847
11-column-tags 6b1731d1611404597c96ad77f34c2d5cd5a81c1085ec68c6779388e07ce28614
12-multiline-tag 1b9ccd331814dc76111470f18448b1ca192e1edc3d79ea6eee19a6a78a4b1831
-13-image de18edee2ab2e0f2d4bf4162d86e3d8a1852fccfc344830491fa1a359095d4ea
-14-theme-ink 6e733d4212373c90b860b2e41102ced8719b07480591b5da3905267c8358db18
-15-theme-acme-light e099dc1a351de8efa63ecd0ec0899636ea31b722a945eb40137a18abd87a82e2
-16-debug e97ce74b7a3d4a08f6a529b1f0de111d62e5532c829a6b1633b966dd45218f55
-17-terminal 304a84d1ef871f581d0a3fade9bc1acdcc87a3612c607548ab0d2851871753ee
+13-image a52e2cf9f238447d885692cba01e68ef7fdc6ae3fc7c8fe1e95c8463c85f519c
+14-theme-ink cc2ea256ddda24e1c97871f75b71ddf62fa825bd02f5d1432592d05e478c707a
+15-theme-acme-light 2bde8a2bdfada7f061217f52cb2272913fc0657dbfa1d7448e1852f321f8e3bf
+16-debug 129ad6f5f85b0e60e81bc6e8e78434629ee751f49731cf2eb28fd0553efd914a
+17-terminal a1305fd755b6bc957228bbf28833f972c2355af9abf40b77f76b30741109574f
+18-mid-transition d4f353ef5fda80411cd9de9729e5b23f59ff7511c10774e69214152ee8070725
diff --git a/test/gui_golden.py b/test/gui_golden.py
index 327911cc..d97009c9 100644
--- a/test/gui_golden.py
+++ b/test/gui_golden.py
@@ -106,7 +106,9 @@ def run(args):
display = Path(os.environ.get('WAYLAND_DISPLAY', 'wayland-0'))
if not display.is_absolute():
display = Path(os.environ.get('XDG_RUNTIME_DIR', '/run/user/%d' % os.getuid())) / display
- inherited = {'PARDES_TEST': '1', 'PARDES_TEST_COLS': '120', 'PARDES_TEST_ROWS': '40',
+ # The virtual clock: a transition's frames are the same frames on any
+ # machine, so one partway through can be hashed too.
+ inherited = {'PARDES_TEST': '1', 'PARDES_TEST_CLOCK': '1', 'PARDES_TEST_COLS': '120', 'PARDES_TEST_ROWS': '40',
'PARDES_TEST_PAD': '7', 'PARDES_TEST_CAPTURE_DIR': str(root),
'SDL_VIDEODRIVER': 'wayland', 'WAYLAND_DISPLAY': str(display)}
launch = ['-c', 'stty cols 120 rows 40; exec "$@"', name, str(args.binary.resolve()),
@@ -117,11 +119,12 @@ def run(args):
first = require(wait_for(lambda: next((s for s, tag in panes(client).items()
if 'shapes.zig' in tag), None)), 'source pane missing')
- def scene(label):
- results.append((label, settled(root)))
+ def scene(label, frame='latest.ppm'):
+ settled(root)
+ results.append((label, hashlib.sha256((root / frame).read_bytes()).hexdigest()))
if args.keep:
args.keep.mkdir(parents=True, exist_ok=True)
- shutil.copyfile(root / 'latest.ppm', args.keep / (label + '.ppm'))
+ shutil.copyfile(root / frame, args.keep / (label + '.ppm'))
print(label, results[-1][1][:16], flush=True)
def mouse(kind, button, x, y):
@@ -196,6 +199,13 @@ def run(args):
client.write(f'/pane/{terminal}/pty/data', b"PS1='$ '; clear; printf '\\033[1;36mcolour\\033[0m plain \\033[32mgreen\\033[0m\\n'\r")
require(wait_for(lambda: b'green' in client.read(f'/pane/{terminal}/body')), 'terminal output missing')
scene('17-terminal')
+ # Partway through a transition: the panes, the picture among them,
+ # sliding over for a new column, frame 6 of PanelSlide's 12. Its
+ # chrome slides with each pane.
+ client.write('/ctl', b'PanelSlide\n')
+ client.write(f'/pane/{first}/exec', b'Newcol\n')
+ require(wait_for(lambda: (root / 'transition-6.ppm').exists()), 'transition frame 6 never drawn')
+ scene('18-mid-transition', 'transition-6.ppm')
lines = ''.join(f'{label} {digest}\n' for label, digest in results)
if args.update:
GOLDENS.write_text(lines)