summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index 616747fa..5fa3307b 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -584,18 +584,10 @@ test "startup config runs builtin lines in order and isolates bad lines" {
};
}
-test "scene effects keep the idle frontend animation clock active" {
+test "a post chain keeps no core clock running: the shell animates it" {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true });
defer p.deinit();
- try std.testing.expect(!p.animationActive());
-
- p.settings.scene_effects.crt = true;
- try std.testing.expect(p.animationActive());
- p.settings.scene_effects = .{ .ripple = true };
- try std.testing.expect(p.animationActive());
- p.settings.scene_effects = .{ .glitch = true };
- try std.testing.expect(p.animationActive());
- p.settings.scene_effects = .{};
+ try std.testing.expect(p.settings.post.set(.crt, "", true));
try std.testing.expect(!p.animationActive());
}
@@ -5443,10 +5435,10 @@ pub const Pardes = struct {
look.cancelLookHover(p);
}
- /// A native scene pass proved unavailable. Config reads these exact bits,
- /// and the idle-clock predicate stops immediately once they are clear.
+ /// A native post pass proved unavailable: the chain is emptied, which
+ /// Config then reports.
pub fn disableSceneEffects(p: *Pardes) void {
- p.settings.scene_effects = .{};
+ p.settings.post.clear();
}
// ---- doc panes ----
@@ -5744,8 +5736,6 @@ pub const Pardes = struct {
pub fn nextWake(p: *const Pardes) ?u64 {
const next = p.stepped_ns + animation.frame_ns;
if (p.chrome_animation.isActive() or p.presentation.animating()) return next;
- const scene = p.settings.scene_effects;
- if (scene.crt or scene.ripple or scene.glitch) return next;
var frames: ?u64 = null;
if (p.look_hover_wait) |waiting| {
const delay = config.look_preview_delay_frames orelse return next;
@@ -6953,8 +6943,8 @@ test "core animation keeps wall time at 60, 120 and 144 Hz and across a stall" {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 24 });
defer p.deinit();
const frame = animation.frame_ns;
- // Something that animates for as long as it is on.
- p.settings.scene_effects.crt = true;
+ // Something that animates for as long as the test wants: the theme
+ // fade, held at its start before every step.
for ([_]u64{ 60, 120, 144 }) |hz| {
const start: u64 = 5 * std.time.ns_per_s;
p.clock_started = false;
@@ -6963,6 +6953,7 @@ test "core animation keeps wall time at 60, 120 and 144 Hz and across a stall" {
var at: u64 = 1;
while (at <= hz) : (at += 1) {
const before = p.stepped_ns;
+ p.chrome_animation.step = 0;
p.advance(start + at * std.time.ns_per_s / hz);
const taken = (p.stepped_ns - before + frame / 2) / frame;
// Never two steps in one display frame: that is a visible hitch.
@@ -6979,9 +6970,10 @@ test "core animation keeps wall time at 60, 120 and 144 Hz and across a stall" {
}
// A stall of minutes is not minutes of frames.
const before = p.stepped_ns;
+ p.chrome_animation.step = 0;
p.advance(before + 600 * std.time.ns_per_s);
try std.testing.expectEqual(before + 600 * std.time.ns_per_s, p.stepped_ns);
- p.settings.scene_effects.crt = false;
+ p.chrome_animation.step = animation.transition_steps;
p.advance(p.stepped_ns + frame);
try std.testing.expectEqual(@as(?u64, null), p.nextWake());
}