From e11048c20a50b67841e648a4d5ddd7490bc9c9b7 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 13:24:06 -0300 Subject: Paint into a target Surface instead of swapping the frame's out The painters of a pane's body and tag (renderBody and its selection, gutter, syntax, ANSI and wrap-marker passes; paintPaneTag; paintHeaders; renderPane; the image and PDF grid paths) take the Surface they paint as a parameter. The body layer and the tag layers paint straight into their own temporary surfaces, and the std.mem.swap of p.surface around those calls is gone. No behaviour change. --- src/image.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/image.zig') diff --git a/src/image.zig b/src/image.zig index 09f049ca..071a2e2a 100644 --- a/src/image.zig +++ b/src/image.zig @@ -941,6 +941,7 @@ fn ensureGrid(p: *pardes.Pardes, state: *State, cols: u16, rows: u16) void { pub fn draw( p: *pardes.Pardes, + s: *pardes.Surface, state: *State, pane_id: u8, serial: u32, @@ -982,7 +983,7 @@ pub fn draw( }; const sx = x + @as(u16, @intCast(offx + cx)); const sy = y + @as(u16, @intCast(offy + cy)); - if (sx < p.surface.cols and sy < p.surface.rows) - p.surface.set(sx, sy, cell.glyph[0..cell.glyph_len], .{ .fg = fg, .bg = bg }); + if (sx < s.cols and sy < s.rows) + s.set(sx, sy, cell.glyph[0..cell.glyph_len], .{ .fg = fg, .bg = bg }); }; } -- cgit v1.3