diff options
Diffstat (limited to 'anim/src/words.zig')
| -rw-r--r-- | anim/src/words.zig | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/anim/src/words.zig b/anim/src/words.zig index 4d221f4..f66f6d2 100644 --- a/anim/src/words.zig +++ b/anim/src/words.zig @@ -162,9 +162,10 @@ pub const Veil = struct { /// it means: the same in every picture. pub const Legend = struct { box: Rect, - entries: []const Entry = &.{ .current, .written, .changed, .read, .link, .allocated, .freed, .unknown, .kernel }, + /// The marks the scenes use. + entries: []const Entry = &.{ .current, .written, .changed, .read, .waiting, .unknown, .link, .pin, .arc, .loupe, .freed, .kernel }, - pub const Entry = enum { current, written, changed, read, link, allocated, freed, unknown, kernel }; + pub const Entry = enum { current, written, changed, read, link, pin, arc, loupe, waiting, freed, unknown, kernel }; pub fn draw(l: *const Legend, f: *sk.Frame, at: anim.Placed) void { const u: ui.Ui = .{ .f = f, .at = at }; @@ -182,7 +183,10 @@ pub const Legend = struct { .changed => .{ "changed", "a moment ago" }, .read => .{ "read", "by this step" }, .link => .{ "link", "now points at that" }, - .allocated => .{ "allocated", "handed out" }, + .pin => .{ "pin", "who points here" }, + .arc => .{ "arc", "a pointer in its panel" }, + .loupe => .{ "loupe", "where it points" }, + .waiting => .{ "waiting", "for the call it made" }, .freed => .{ "freed", "handed back" }, .unknown => .{ "not seen", "never observed" }, .kernel => .{ "kernel", "the other side" }, @@ -211,9 +215,22 @@ pub const Legend = struct { u.label(.mono, size, cell, .center, digits, t.primary); }, .link => u.route(&.{ .{ r.x, r.y + 23 }, .{ r.x + r.w, r.y + 23 } }, theme.color.region.heap, .{ .width = theme.stroke.tie.link, .head = .{ 10, 10 } }), - .allocated => { - u.fill(r, theme.mark(.allocated).ember); - u.frame(r, theme.mark(.allocated).solid, theme.stroke.line); + .pin => u.pinRow(r.x, r.y + 11, &.{"rsp"}, theme.color.region.stack), + .arc => { + const k = theme.metric.arc; + u.route(&.{ .{ r.x + r.w, r.y + 8 }, .{ r.x + 20, r.y + 8 }, .{ r.x + 20, r.y + 38 }, .{ r.x + r.w, r.y + 38 } }, theme.color.region.heap, .{ .width = k.width, .head = k.head, .radius = k.radius }); + }, + .loupe => { + const k = theme.metric.loupe.shadow[0]; + u.fill(.{ .x = r.x + k[0] / 2, .y = r.y + k[1] / 2, .w = r.w - k[0] / 2, .h = r.h - k[1] / 2 }, theme.color.shade); + const lifted: Rect = .{ .x = r.x, .y = r.y, .w = r.w - k[0] / 2, .h = r.h - k[1] / 2 }; + u.fill(lifted, theme.color.lift); + u.fill(.{ .x = r.x, .y = r.y, .w = lifted.w, .h = 10 }, theme.color.lift_tag); + u.frame(lifted, t.dim, theme.stroke.rule); + }, + .waiting => { + u.frame(.{ .x = r.x + 1, .y = r.y + 1, .w = r.w - 2, .h = r.h - 2 }, t.primary, theme.stroke.rule); + u.label(.mono, size, r, .center, "call", t.primary); }, .freed => u.dashedFrame(r, theme.mark(.freed).solid, theme.stroke.line), .unknown => { |
