Skip to content

RediWM is a Wayland compositor written in Zig (OpenGL ES) that includes everything in one process

scene graph plan, stage 6: delete the projection view tree

oxydizer605b70f8d385
diff --git a/AGENTS.md b/AGENTS.md
index 78cb4fa..0b1793b 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -34,8 +34,8 @@ the one for the directory you work in: `src/files`, `src/editor`,
buffer and carries footprint, opacity and input only, so the projection
damages that footprint itself. CSD windows have no shape and keep the
`border_rects` outline. A changed clip damages its rim itself
- (`projection.c`); a point the shape cuts away is declined in `accepts()`, so
- the pick falls to what is below. Window capture draws the client alone and is
+ (`projection.c`); a point the shape cuts away is declined by the pick
+ (`pick_world`), so the pick falls to what is below. Window capture draws the client alone and is
handed the shape explicitly. The ring is one `max(1, round(border * scale))`.
Without the shaped programs (`chrome.shapes` false) windows are square, with
no ring or shadow.
@@ -75,9 +75,9 @@ the one for the directory you work in: `src/files`, `src/editor`,
there. Skipped frames get callbacks from `vblank_timer`, never immediately.
Build output state through `Server.buildOutputState`, including capture: the
owned GLES2 pass is the only presenter (the session requires GLES2) and keeps
- one swapchain damage history. It reads graph geometry; scene nodes remain
- resource and feedback transports until stage 6
- (`docs/plans/scene-graph-stage3.md`).
+ one swapchain damage history. It reads graph geometry and the buffers,
+ textures and wait points of the source nodes
+ (`docs/plans/scene-graph-stage3.md`, `scene-graph-stage6.md`).
* **Shapes in the owned pass** (`scene_pass.h`): a window's rounded clip, ring
and shadow are `rediwm_scene_pass_add_*_shaped` calls, device pixels, snapped by
the caller. The programs cost the driver about 430 KiB (a GL program costs
@@ -101,16 +101,41 @@ the one for the directory you work in: `src/files`, `src/editor`,
* **Projection is resolve, then present** (`projection.c`, `scene_graph.h`).
`resolve` turns the source tree into typed items (kind, unrounded
layout-space edges, composed scale, content) listed in paint order per group
- and moves no view; `present` rounds once (`rediwm_edges_snap`, edges not
- origin+size) and applies. Geometry is derived only in `resolve`: a new rule
- (clip, opacity, fractional placement) is a field on the item, not a
- computation in `present_leaf`. A leaf or group leaves its `paint` list before
- the head is freed (`detach`, `finish_group`). Buffer identity, wait points and
- opaque regions are still read from the source node by `present`. A tree's
- rounded clip (`rediwm_projection_set_tree_clip`) is a field on each item
- (`item.clip`), resolved after the tree's own zoom and scale; an xdg popup
- lives under its parent's tree and must carry
+ and shows nothing; `present` rounds once (`rediwm_edges_snap`, edges not
+ origin+size) and turns what changed into damage events and screen damage.
+ Geometry is derived only in `resolve`: a new rule (clip, opacity, fractional
+ placement) is a field on the item, not a computation in `present_leaf`. A leaf
+ or group leaves its `paint` list before the head is freed (`detach`,
+ `destroy_group`). Buffer identity and damage are read from the source node by
+ `present`, textures, single-pixel colours, wait points and opaque regions by
+ the pass. A tree's rounded clip (`rediwm_projection_set_tree_clip`) is a field
+ on each item (`item.clip`), resolved after the tree's own zoom and scale; an
+ xdg popup lives under its parent's tree and must carry
`rediwm_projection_set_tree_unclipped`.
+* **The world has no second tree** (`docs/plans/scene-graph-stage6.md`). The
+ source tree is disabled, so wlroots computes no outputs, frame callbacks,
+ damage or picks for it; the graph does, with wlroots' own rules on our data.
+ *Feedback* (`rediwm_projection_feedback_*`, called by the pass's `collect`):
+ per build, the pixels of each client surface that nothing above hides, over
+ every output; an output is active when it shows more than a tenth of that, the
+ primary one shows most (the later wins a tie); `outputs_update` and
+ `output_enter/leave` go out on the *source* buffer, again when an active
+ output's scale, transform or subpixel changed. Frame callbacks of the world
+ come from `Server.sendFrameDone`, never `wlr_scene_output_send_frame_done`
+ alone; the pass emits `output_sample` on the source buffer. A layer-shell
+ surface below the world (background, bottom) is no longer occluded by windows
+ in wlroots' eyes: it keeps frame callbacks while covered. *Damage*: every
+ change reaches `p->pending` through `damage_box` and goes to the outputs once,
+ at the end of each sync. A change of what a leaf itself shows is cut to what
+ was visible of it at the last build (`l->visible`); a move, restyle or removal
+ damages the old box (cut) and the new one; a restack damages what moved
+ (`damage_restacked`), shadow footprints included; a destroyed node applies at
+ once, because a capture can build before the next sync. A new kind of change
+ that moves no leaf has to damage itself there (clip rims and shadows do).
+ *Picks*: `rediwm_projection_node_at` (graph for the world, wlroots for the
+ layout trees), never `wlr_scene_node_at` on the root. GLES2 lets go of a
+ plain buffer once uploaded, so "has content" is a buffer, a texture or a
+ single-pixel colour (`present_leaf`, `collect`).
* **Client buffers:** `wlr_client_buffer_apply_damage` works in place only
without extra locks, so mark long-held locks ignorable. v4
`attach(buffer, 0, 0)` still sets OFFSET; only nonzero dx/dy remaps. Don't
@@ -191,8 +216,8 @@ the one for the directory you work in: `src/files`, `src/editor`,
beside every `onWindowChanged`/`onWindowMoved`; output management goes
through `Output.applyAndPersist`; only a client `on` clears
`Output.power_off`.
-* **Explicit sync:** projection moves `output_sample` to the view with its
- wait points; other GPU reads use `ReadFence`, CPU reads check
+* **Explicit sync:** the pass emits `output_sample` on the source buffer, which
+ carries the wait points; other GPU reads use `ReadFence`, CPU reads check
`AcquireWait.ready`.
## Shared UI
diff --git a/TESTING.md b/TESTING.md
index d829189..21d16ae 100644
--- a/TESTING.md
+++ b/TESTING.md
@@ -13,7 +13,7 @@ debugging on the host, see AGENTS.md, "Rendering".
| Command | What it checks |
| --- | --- |
-| `zig build test` | In-process unit tests: rasterizers vs. full rasters, UI, config, IPC parser/serializer fixtures, glass damage, projection damage and its typed graph (paint order, unrounded edges, list lifetime), lifecycle/allocation failures, Files/desktop logic. No compositor or bus. |
+| `zig build test` | In-process unit tests: rasterizers vs. full rasters, UI, config, IPC parser/serializer fixtures, glass damage, projection damage, restack and visibility cuts, hit tests and surface feedback from its typed graph (paint order, unrounded edges, list lifetime), lifecycle/allocation failures, Files/desktop logic. No compositor or bus. |
| `zig build test-glass` | The glass registry and an effect's geometry in the graph at every zoom (no GPU). Glass pixels are gated in `test-scene-pass` (stage 5b) and by `tests/glass_reblur.py`. |
| `zig build test-pass-spike` | The owned-pass spike of `docs/plans/scene-graph-stage1.md`: rounded clip, border, shadow, external-OES texture, backdrop blur, buffer-age damage and cost on headless GLES2 (needs a render node; `-Doptimize=ReleaseSafe` for cost). |
| `zig build test-scene-pass` | Stage 3's owned GLES2 drawing backend against wlroots: transforms, crops, filters, premultiplied alpha, damage, external-OES (an RGB EGLImage and a linear NV12 dmabuf; needs gbm), GL/EGL state and acquire/release timelines. Needs a compatible render node (`WLR_RENDER_DRM_DEVICE` on multi-GPU machines); also run with `-Doptimize=ReleaseSafe`. The unavailable-acquire test intentionally logs `drmSyncobjTransfer failed`. Stage 4b's rounded-shape gates are in the same fixture: clip against a supersampled reference, piece joins, border/body, premultiplied edges, the opaque cover, shadow, and partial repaint across a clip edge; the 128 parity cases also run through the shaped programs. Stage 4d's shadow gate compares every pixel with the CPU chrome's shadow formula. |
@@ -56,6 +56,17 @@ compiler, `wayland-scanner` and wayland-protocols; D-Bus suites need PyGObject,
conditions; compare with `--report new.json --against old.json`. Use a
ReleaseSafe build and a render node, keep other builds/tests stopped and AC
power on. `--report` still reads the stages 3 and 4 "paired" results.
+- `zig build -Ddamage-audit=true` (Debug): after every frame the compositor
+ redraws the same entries whole into a private buffer and logs `damage audit`
+ errors for any pixel the frame's damage missed, with the entries over it. It
+ reads two frames back each time, so timing-sensitive suites (`glass_hold`,
+ `glass_reblur`, `desktop_damage`, `window_urgency`) fail on that build; read
+ the logs of the others. `REDIWM_TEST_LOG_DIR=/dir` makes
+ `ipc_client.spawn_compositor` keep each compositor log there
+ (`grep -h "damage audit" /dir/*.log`). A hit means a change reached the graph
+ without damaging itself (`docs/plans/scene-graph-stage6.md`, 6b); the
+ `capture` suite is known to show a few corner pixels (unsubmitted isolated
+ renders upset buffer age, which predates the graph damage).
- `REDIWM_*_PREVIEW=/tmp/...` (lock, greeter, OSD, settings, switcher, tray,
notification): keep the compositor's own screenshots.
- GLES2 at a fractional scale can differ by one level depending on render
diff --git a/build.zig b/build.zig
index 6b4836b..dde7bf7 100644
--- a/build.zig
+++ b/build.zig
@@ -6,6 +6,8 @@ pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const use_llvm = b.option(bool, "llvm", "Use LLVM and LLD (default for optimized builds)") orelse (optimize != .Debug);
+ // Debug aid (TESTING.md): redraw every frame whole and log what the damage missed.
+ const damage_audit = b.option(bool, "damage-audit", "Compare every frame with a full repaint and log the difference (slow)") orelse false;
// Set by scripts/build-wlroots.sh builds on distros without wlroots 0.20
// (Debian/Ubuntu). Must be applied before anything runs pkg-config.
const wlroots_prefix = b.option([]const u8, "wlroots-prefix", "Use wlroots and its bundled dependencies from this private prefix (see scripts/build-wlroots.sh)");
@@ -136,7 +138,7 @@ pub fn build(b: *std.Build) void {
compositor.root_module.linkSystemLibrary("xcb", .{});
compositor.root_module.addCSourceFile(.{ .file = b.path("src/session/auth.c"), .flags = &.{"-std=c11"} });
compositor.root_module.addCSourceFile(.{ .file = b.path("src/polkit/native.c"), .flags = &.{ "-std=c11", "-Wall", "-Wextra", "-Werror" } });
- addGlass(b, compositor.root_module);
+ addGlass(b, compositor.root_module, damage_audit);
compositor.root_module.addCSourceFile(.{ .file = b.path("src/gpu_timing.c"), .flags = &.{"-std=c11"} });
b.step("rediwm", "Build the compositor").dependOn(&compositor.step);
@@ -420,7 +422,7 @@ pub fn build(b: *std.Build) void {
// Fake PAM is linked only into unit tests; the compositor always uses libpam.
ui_tests_module.addCSourceFile(.{ .file = b.path("tests/auth_test.c"), .flags = &.{ "-std=c11", "-DREDIWM_AUTH_EMBEDDED_TEST" } });
ui_tests_module.addCSourceFile(.{ .file = b.path("src/polkit/native.c"), .flags = &.{ "-std=c11", "-Wall", "-Wextra", "-Werror" } });
- addGlass(b, ui_tests_module);
+ addGlass(b, ui_tests_module, false);
ui_tests_module.addCSourceFile(.{ .file = b.path("src/gpu_timing.c"), .flags = &.{"-std=c11"} });
const ui_tests = b.addTest(.{ .root_module = ui_tests_module });
const run_ui_tests = b.addRunArtifact(ui_tests);
@@ -768,13 +770,13 @@ fn addBassDsp(b: *std.Build, target: std.Build.ResolvedTarget) void {
}).step);
}
-fn addGlass(b: *std.Build, module: *std.Build.Module) void {
+fn addGlass(b: *std.Build, module: *std.Build.Module, damage_audit: bool) void {
module.linkSystemLibrary("wlroots-0.20", .{});
module.linkSystemLibrary("egl", .{});
module.linkSystemLibrary("glesv2", .{});
module.addCSourceFile(.{ .file = b.path("src/projection.c"), .flags = &.{ "-std=c11", "-Wall", "-Wextra" } });
module.addCSourceFile(.{ .file = b.path("src/scene_pass.c"), .flags = &.{ "-std=c11", "-Wall", "-Wextra", "-Werror" } });
- module.addCSourceFile(.{ .file = b.path("src/scene_output.c"), .flags = &.{ "-std=c11", "-Wall", "-Wextra", "-Werror" } });
+ module.addCSourceFile(.{ .file = b.path("src/scene_output.c"), .flags = if (damage_audit) &.{ "-std=c11", "-Wall", "-Wextra", "-Werror", "-DREDIWM_DAMAGE_AUDIT" } else &.{ "-std=c11", "-Wall", "-Wextra", "-Werror" } });
module.addCSourceFile(.{ .file = b.path("src/scene_damage.c"), .flags = &.{ "-std=c11", "-Wall", "-Wextra", "-Werror" } });
module.addCSourceFile(.{ .file = b.path("src/glass.c"), .flags = &.{ "-std=c11", "-Wall", "-Wextra" } });
module.addCSourceFile(.{ .file = b.path("src/explicit_sync.c"), .flags = &.{ "-std=c11", "-Wall", "-Wextra", "-Werror" } });
diff --git a/docs/plans/scene-graph-stage6-cost.json b/docs/plans/scene-graph-stage6-cost.json
new file mode 100644
index 0000000..ca6c05b
--- /dev/null
+++ b/docs/plans/scene-graph-stage6-cost.json
@@ -0,0 +1,3197 @@
+{
+ "what": "stage 6 cost gate: stage 5 (07806c3, HEAD before this stage) against the stage 6 tree (07806c3 + uncommitted 6a-6d); ReleaseSafe, scene_baseline clean and stats sessions, interleaved s5, s6, s6, s5, AC power, performance profile, 2026-10-12",
+ "runs": {
+ "s5-a": {
+ "meta": {
+ "commit": "07806c3",
+ "dirty": true,
+ "renderer": "gles2",
+ "kernel": "7.2.9-zen1-1-zen",
+ "cpu": "12th Gen Intel(R) Core(TM) i9-12900H",
+ "pinned_cpus": [
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "render_device": "/dev/dri/renderD128",
+ "seconds": 4.0,
+ "power": {
+ "ac_online": true,
+ "battery": "Not charging",
+ "platform_profile": "performance",
+ "governor": "schedutil",
+ "epp": "performance",
+ "no_turbo": "0"
+ },
+ "date": "2026-10-12 19:20:45"
+ },
+ "clean": {
+ "scale1": {
+ "idle": {
+ "cpu_percent": 0.001,
+ "voluntary_switches_per_s": 0.4,
+ "instructions_per_s": 146,
+ "cycles_per_s": 2224,
+ "rss_kb": 134928,
+ "rss_anon_kb": 45196
+ },
+ "spinner_clear": {
+ "cpu_percent": 8.066,
+ "voluntary_switches_per_s": 189.7,
+ "instructions_per_s": 32451486,
+ "cycles_per_s": 47595828,
+ "rss_kb": 135700,
+ "rss_anon_kb": 45840
+ },
+ "spinner_glass": {
+ "cpu_percent": 8.45,
+ "voluntary_switches_per_s": 187.2,
+ "instructions_per_s": 52750821,
+ "cycles_per_s": 61252582,
+ "rss_kb": 135700,
+ "rss_anon_kb": 45840
+ },
+ "damage_full": {
+ "cpu_percent": 11.842,
+ "voluntary_switches_per_s": 187.5,
+ "instructions_per_s": 56573158,
+ "cycles_per_s": 90468809,
+ "rss_kb": 135700,
+ "rss_anon_kb": 45840
+ },
+ "drag": {
+ "cpu_percent": 5.561,
+ "voluntary_switches_per_s": 164.3,
+ "instructions_per_s": 49448930,
+ "cycles_per_s": 50534847,
+ "rss_kb": 135764,
+ "rss_anon_kb": 45840
+ },
+ "resize": {
+ "cpu_percent": 18.354,
+ "voluntary_switches_per_s": 224.0,
+ "instructions_per_s": 183366295,
+ "cycles_per_s": 132281957,
+ "rss_kb": 135988,
+ "rss_anon_kb": 46064
+ },
+ "fullscreen": {
+ "cpu_percent": 45.282,
+ "voluntary_switches_per_s": 112.7,
+ "instructions_per_s": 45191010,
+ "cycles_per_s": 348608183,
+ "rss_kb": 157768,
+ "rss_anon_kb": 49924
+ },
+ "zoom_85": {
+ "cpu_percent": 8.542,
+ "voluntary_switches_per_s": 188.2,
+ "instructions_per_s": 52502306,
+ "cycles_per_s": 61128711,
+ "rss_kb": 139864,
+ "rss_anon_kb": 49940
+ },
+ "zoom_70": {
+ "cpu_percent": 8.368,
+ "voluntary_switches_per_s": 188.2,
+ "instructions_per_s": 53787477,
+ "cycles_per_s": 64817025,
+ "rss_kb": 139916,
+ "rss_anon_kb": 49992
+ },
+ "zoom_55": {
+ "cpu_percent": 8.74,
+ "voluntary_switches_per_s": 188.7,
+ "instructions_per_s": 52742872,
+ "cycles_per_s": 60154025,
+ "rss_kb": 139924,
+ "rss_anon_kb": 50000
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 7.344,
+ "voluntary_switches_per_s": 190.7,
+ "instructions_per_s": 37518035,
+ "cycles_per_s": 54007249,
+ "rss_kb": 140264,
+ "rss_anon_kb": 50340
+ }
+ },
+ "scale1.5": {
+ "idle": {
+ "cpu_percent": 0.001,
+ "voluntary_switches_per_s": 0.6,
+ "instructions_per_s": 2717,
+ "cycles_per_s": 8446,
+ "rss_kb": 138504,
+ "rss_anon_kb": 48888
+ },
+ "spinner_clear": {
+ "cpu_percent": 7.523,
+ "voluntary_switches_per_s": 189.2,
+ "instructions_per_s": 32745011,
+ "cycles_per_s": 41963287,
+ "rss_kb": 139308,
+ "rss_anon_kb": 49564
+ },
+ "spinner_glass": {
+ "cpu_percent": 8.979,
+ "voluntary_switches_per_s": 187.5,
+ "instructions_per_s": 55534242,
+ "cycles_per_s": 55343051,
+ "rss_kb": 139308,
+ "rss_anon_kb": 49564
+ },
+ "damage_full": {
+ "cpu_percent": 12.056,
+ "voluntary_switches_per_s": 186.7,
+ "instructions_per_s": 63419118,
+ "cycles_per_s": 84176539,
+ "rss_kb": 139320,
+ "rss_anon_kb": 49576
+ },
+ "drag": {
+ "cpu_percent": 7.169,
+ "voluntary_switches_per_s": 164.1,
+ "instructions_per_s": 50519155,
+ "cycles_per_s": 47270997,
+ "rss_kb": 139552,
+ "rss_anon_kb": 49744
+ },
+ "resize": {
+ "cpu_percent": 20.816,
+ "voluntary_switches_per_s": 229.2,
+ "instructions_per_s": 311043324,
+ "cycles_per_s": 174912562,
+ "rss_kb": 139600,
+ "rss_anon_kb": 49792
+ },
+ "fullscreen": {
+ "cpu_percent": 43.755,
+ "voluntary_switches_per_s": 95.2,
+ "instructions_per_s": 45854137,
+ "cycles_per_s": 319314243,
+ "rss_kb": 150992,
+ "rss_anon_kb": 57600
+ },
+ "zoom_85": {
+ "cpu_percent": 8.872,
+ "voluntary_switches_per_s": 188.0,
+ "instructions_per_s": 54729029,
+ "cycles_per_s": 55266543,
+ "rss_kb": 147424,
+ "rss_anon_kb": 57616
+ },
+ "zoom_70": {
+ "cpu_percent": 8.73,
+ "voluntary_switches_per_s": 187.7,
+ "instructions_per_s": 56336617,
+ "cycles_per_s": 54192560,
+ "rss_kb": 148028,
+ "rss_anon_kb": 58220
+ },
+ "zoom_55": {
+ "cpu_percent": 8.786,
+ "voluntary_switches_per_s": 187.7,
+ "instructions_per_s": 54855493,
+ "cycles_per_s": 54104014,
+ "rss_kb": 148100,
+ "rss_anon_kb": 58228
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 8.283,
+ "voluntary_switches_per_s": 189.0,
+ "instructions_per_s": 37491524,
+ "cycles_per_s": 48486062,
+ "rss_kb": 148468,
+ "rss_anon_kb": 58660
+ }
+ },
+ "mixed": {
+ "idle": {
+ "cpu_percent": 0.094,
+ "voluntary_switches_per_s": 3.6,
+ "instructions_per_s": 531949,
+ "cycles_per_s": 475916,
+ "rss_kb": 137724,
+ "rss_anon_kb": 48072
+ },
+ "spinner_clear": {
+ "cpu_percent": 7.028,
+ "voluntary_switches_per_s": 247.2,
+ "instructions_per_s": 36947968,
+ "cycles_per_s": 48365169,
+ "rss_kb": 142504,
+ "rss_anon_kb": 52660
+ },
+ "spinner_glass": {
+ "cpu_percent": 8.765,
+ "voluntary_switches_per_s": 238.7,
+ "instructions_per_s": 50768205,
+ "cycles_per_s": 64558973,
+ "rss_kb": 142696,
+ "rss_anon_kb": 52660
+ },
+ "damage_full": {
+ "cpu_percent": 12.897,
+ "voluntary_switches_per_s": 248.2,
+ "instructions_per_s": 55627928,
+ "cycles_per_s": 88375940,
+ "rss_kb": 142504,
+ "rss_anon_kb": 52660
+ },
+ "drag": {
+ "cpu_percent": 6.728,
+ "voluntary_switches_per_s": 177.5,
+ "instructions_per_s": 61545783,
+ "cycles_per_s": 61174333,
+ "rss_kb": 142568,
+ "rss_anon_kb": 52660
+ },
+ "resize": {
+ "cpu_percent": 20.806,
+ "voluntary_switches_per_s": 235.0,
+ "instructions_per_s": 338459492,
+ "cycles_per_s": 197687182,
+ "rss_kb": 142568,
+ "rss_anon_kb": 52660
+ },
+ "fullscreen": {
+ "cpu_percent": 40.493,
+ "voluntary_switches_per_s": 136.5,
+ "instructions_per_s": 78305906,
+ "cycles_per_s": 403267323,
+ "rss_kb": 146948,
+ "rss_anon_kb": 57040
+ },
+ "zoom_85": {
+ "cpu_percent": 9.539,
+ "voluntary_switches_per_s": 236.2,
+ "instructions_per_s": 52821254,
+ "cycles_per_s": 65196992,
+ "rss_kb": 146948,
+ "rss_anon_kb": 57040
+ },
+ "zoom_70": {
+ "cpu_percent": 9.188,
+ "voluntary_switches_per_s": 243.2,
+ "instructions_per_s": 54819460,
+ "cycles_per_s": 59898300,
+ "rss_kb": 147528,
+ "rss_anon_kb": 57620
+ },
+ "zoom_55": {
+ "cpu_percent": 9.523,
+ "voluntary_switches_per_s": 246.7,
+ "instructions_per_s": 55035699,
+ "cycles_per_s": 59230431,
+ "rss_kb": 147544,
+ "rss_anon_kb": 57636
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 8.597,
+ "voluntary_switches_per_s": 242.5,
+ "instructions_per_s": 41606674,
+ "cycles_per_s": 56801598,
+ "rss_kb": 147544,
+ "rss_anon_kb": 57636
+ }
+ },
+ "mixed_noglass": {
+ "idle": {
+ "cpu_percent": 0.002,
+ "voluntary_switches_per_s": 0.6,
+ "instructions_per_s": 152,
+ "cycles_per_s": 2599,
+ "rss_kb": 136872,
+ "rss_anon_kb": 47472
+ },
+ "spinner_clear": {
+ "cpu_percent": 8.002,
+ "voluntary_switches_per_s": 247.5,
+ "instructions_per_s": 36215405,
+ "cycles_per_s": 52830483,
+ "rss_kb": 141668,
+ "rss_anon_kb": 52076
+ },
+ "spinner_glass": {
+ "cpu_percent": 7.74,
+ "voluntary_switches_per_s": 246.0,
+ "instructions_per_s": 37873520,
+ "cycles_per_s": 48318061,
+ "rss_kb": 141668,
+ "rss_anon_kb": 52076
+ },
+ "damage_full": {
+ "cpu_percent": 12.046,
+ "voluntary_switches_per_s": 240.0,
+ "instructions_per_s": 40920483,
+ "cycles_per_s": 75719611,
+ "rss_kb": 141668,
+ "rss_anon_kb": 52076
+ },
+ "drag": {
+ "cpu_percent": 5.27,
+ "voluntary_switches_per_s": 196.5,
+ "instructions_per_s": 41451697,
+ "cycles_per_s": 45734489,
+ "rss_kb": 141732,
+ "rss_anon_kb": 52076
+ },
+ "resize": {
+ "cpu_percent": 19.915,
+ "voluntary_switches_per_s": 213.2,
+ "instructions_per_s": 303689644,
+ "cycles_per_s": 167207631,
+ "rss_kb": 141732,
+ "rss_anon_kb": 52076
+ },
+ "fullscreen": {
+ "cpu_percent": 40.857,
+ "voluntary_switches_per_s": 123.2,
+ "instructions_per_s": 49662581,
+ "cycles_per_s": 322513778,
+ "rss_kb": 146180,
+ "rss_anon_kb": 56524
+ },
+ "zoom_85": {
+ "cpu_percent": 8.527,
+ "voluntary_switches_per_s": 247.7,
+ "instructions_per_s": 38451195,
+ "cycles_per_s": 49960325,
+ "rss_kb": 146180,
+ "rss_anon_kb": 56524
+ },
+ "zoom_70": {
+ "cpu_percent": 8.204,
+ "voluntary_switches_per_s": 243.7,
+ "instructions_per_s": 38656530,
+ "cycles_per_s": 52347070,
+ "rss_kb": 146748,
+ "rss_anon_kb": 57092
+ },
+ "zoom_55": {
+ "cpu_percent": 7.854,
+ "voluntary_switches_per_s": 246.7,
+ "instructions_per_s": 38903026,
+ "cycles_per_s": 46437136,
+ "rss_kb": 146748,
+ "rss_anon_kb": 57092
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 8.301,
+ "voluntary_switches_per_s": 241.2,
+ "instructions_per_s": 38968462,
+ "cycles_per_s": 48634131,
+ "rss_kb": 146748,
+ "rss_anon_kb": 57092
+ }
+ }
+ },
+ "stats": {
+ "scale1": {
+ "idle": {
+ "output_commits": 0,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0,
+ "projection_cpu_avg_ms": 0,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0,
+ "gpu_elapsed_avg_ms": 0
+ },
+ "spinner_clear": {
+ "output_commits": 244,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.37835872540983606,
+ "projection_cpu_avg_ms": 0.03191897540983606,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.18955224590163933,
+ "gpu_elapsed_avg_ms": 0.15617677459016394
+ },
+ "spinner_glass": {
+ "output_commits": 240,
+ "glass_reblurs": 240,
+ "cpu_frame_avg_ms": 0.6243169749999999,
+ "projection_cpu_avg_ms": 0.038272966666666665,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.390452825,
+ "gpu_elapsed_avg_ms": 0.511593925
+ },
+ "damage_full": {
+ "output_commits": 240,
+ "glass_reblurs": 240,
+ "cpu_frame_avg_ms": 0.6139212375,
+ "projection_cpu_avg_ms": 0.03588407083333333,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.39348455833333335,
+ "gpu_elapsed_avg_ms": 0.534293375
+ },
+ "drag": {
+ "output_commits": 241,
+ "glass_reblurs": 245,
+ "cpu_frame_avg_ms": 0.6753770661157025,
+ "projection_cpu_avg_ms": 0.07124219008264462,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.41929278925619834,
+ "gpu_elapsed_avg_ms": 0.6639029834710743
+ },
+ "resize": {
+ "output_commits": 237,
+ "glass_reblurs": 301,
+ "cpu_frame_avg_ms": 0.8650034453781512,
+ "projection_cpu_avg_ms": 0.2068756512605042,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.49454661344537815,
+ "gpu_elapsed_avg_ms": 0.7649282268907562
+ },
+ "fullscreen": {
+ "output_commits": 219,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.4124886905829596,
+ "projection_cpu_avg_ms": 0.03169296412556054,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2605901121076233,
+ "gpu_elapsed_avg_ms": 0.6143252511210763
+ },
+ "zoom_85": {
+ "output_commits": 241,
+ "glass_reblurs": 254,
+ "cpu_frame_avg_ms": 0.5834924232365145,
+ "projection_cpu_avg_ms": 0.03555107883817427,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.3693615684647303,
+ "gpu_elapsed_avg_ms": 0.47820021161825726
+ },
+ "zoom_70": {
+ "output_commits": 241,
+ "glass_reblurs": 254,
+ "cpu_frame_avg_ms": 0.6132071576763486,
+ "projection_cpu_avg_ms": 0.037069701244813284,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.37620913692946056,
+ "gpu_elapsed_avg_ms": 0.5261403541666666
+ },
+ "zoom_55": {
+ "output_commits": 240,
+ "glass_reblurs": 252,
+ "cpu_frame_avg_ms": 0.6340968333333333,
+ "projection_cpu_avg_ms": 0.04100501666666667,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.39543839166666667,
+ "gpu_elapsed_avg_ms": 0.4764652833333333
+ },
+ "zoom_min_hold": {
+ "output_commits": 242,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.5388944132231406,
+ "projection_cpu_avg_ms": 0.04323542975206611,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2617519049586777,
+ "gpu_elapsed_avg_ms": 0.2607644958677686
+ }
+ },
+ "scale1.5": {
+ "idle": {
+ "output_commits": 0,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0,
+ "projection_cpu_avg_ms": 0,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0,
+ "gpu_elapsed_avg_ms": 0
+ },
+ "spinner_clear": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.4290031069958848,
+ "projection_cpu_avg_ms": 0.0374547037037037,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.21047390123456788,
+ "gpu_elapsed_avg_ms": 0.18537854732510287
+ },
+ "spinner_glass": {
+ "output_commits": 240,
+ "glass_reblurs": 240,
+ "cpu_frame_avg_ms": 0.6591030916666667,
+ "projection_cpu_avg_ms": 0.0404251,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.42011919166666667,
+ "gpu_elapsed_avg_ms": 0.5508111666666666
+ },
+ "damage_full": {
+ "output_commits": 240,
+ "glass_reblurs": 240,
+ "cpu_frame_avg_ms": 0.6450627708333334,
+ "projection_cpu_avg_ms": 0.0357328375,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.43471343333333334,
+ "gpu_elapsed_avg_ms": 0.7296998708333333
+ },
+ "drag": {
+ "output_commits": 241,
+ "glass_reblurs": 245,
+ "cpu_frame_avg_ms": 0.6735248512396693,
+ "projection_cpu_avg_ms": 0.07552801652892563,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4158653388429752,
+ "gpu_elapsed_avg_ms": 0.8918132561983471
+ },
+ "resize": {
+ "output_commits": 235,
+ "glass_reblurs": 299,
+ "cpu_frame_avg_ms": 1.026949855319149,
+ "projection_cpu_avg_ms": 0.25899581276595746,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.5894750255319149,
+ "gpu_elapsed_avg_ms": 1.0982724
+ },
+ "fullscreen": {
+ "output_commits": 227,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.4014866740088106,
+ "projection_cpu_avg_ms": 0.03129913656387665,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2610284581497797,
+ "gpu_elapsed_avg_ms": 0.9599066814159293
+ },
+ "zoom_85": {
+ "output_commits": 240,
+ "glass_reblurs": 253,
+ "cpu_frame_avg_ms": 0.6351520708333332,
+ "projection_cpu_avg_ms": 0.037097975,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4038226458333333,
+ "gpu_elapsed_avg_ms": 0.5412289499999999
+ },
+ "zoom_70": {
+ "output_commits": 240,
+ "glass_reblurs": 253,
+ "cpu_frame_avg_ms": 0.6531196708333333,
+ "projection_cpu_avg_ms": 0.03801354583333333,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.41555581666666663,
+ "gpu_elapsed_avg_ms": 0.5307617458333334
+ },
+ "zoom_55": {
+ "output_commits": 240,
+ "glass_reblurs": 253,
+ "cpu_frame_avg_ms": 0.6672543958333333,
+ "projection_cpu_avg_ms": 0.03989220833333334,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4290407375,
+ "gpu_elapsed_avg_ms": 0.5541981625
+ },
+ "zoom_min_hold": {
+ "output_commits": 244,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.44230574590163935,
+ "projection_cpu_avg_ms": 0.034067926229508196,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.22220478688524592,
+ "gpu_elapsed_avg_ms": 0.2165373032786885
+ }
+ },
+ "mixed": {
+ "idle": {
+ "output_commits": 2,
+ "glass_reblurs": 2,
+ "cpu_frame_avg_ms": 0.6836465,
+ "projection_cpu_avg_ms": 0.02181325,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.219269,
+ "gpu_elapsed_avg_ms": 0.35807275
+ },
+ "spinner_clear": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.32045329606625256,
+ "projection_cpu_avg_ms": 0.032234954451345756,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.1200023850931677,
+ "gpu_elapsed_avg_ms": 0.12145703726708074
+ },
+ "spinner_glass": {
+ "output_commits": 239,
+ "glass_reblurs": 239,
+ "cpu_frame_avg_ms": 0.4322027306889353,
+ "projection_cpu_avg_ms": 0.035029250521920664,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.22777544676409184,
+ "gpu_elapsed_avg_ms": 0.3273036388308977
+ },
+ "damage_full": {
+ "output_commits": 240,
+ "glass_reblurs": 240,
+ "cpu_frame_avg_ms": 0.4305129208333333,
+ "projection_cpu_avg_ms": 0.03324286666666667,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.22515194791666665,
+ "gpu_elapsed_avg_ms": 0.29179578958333335
+ },
+ "drag": {
+ "output_commits": 483,
+ "glass_reblurs": 406,
+ "cpu_frame_avg_ms": 0.5267118865979381,
+ "projection_cpu_avg_ms": 0.0641873731958763,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.29175955670103093,
+ "gpu_elapsed_avg_ms": 0.4308040144329897
+ },
+ "resize": {
+ "output_commits": 473,
+ "glass_reblurs": 651,
+ "cpu_frame_avg_ms": 0.664824312896406,
+ "projection_cpu_avg_ms": 0.13146046088794927,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.39752818604651163,
+ "gpu_elapsed_avg_ms": 0.5804113742071881
+ },
+ "fullscreen": {
+ "output_commits": 464,
+ "glass_reblurs": 464,
+ "cpu_frame_avg_ms": 0.36437633690987126,
+ "projection_cpu_avg_ms": 0.022733416309012874,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.24852060729613734,
+ "gpu_elapsed_avg_ms": 0.5196267274678111
+ },
+ "zoom_85": {
+ "output_commits": 254,
+ "glass_reblurs": 267,
+ "cpu_frame_avg_ms": 0.392552734439834,
+ "projection_cpu_avg_ms": 0.0317091846473029,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.19776460165975104,
+ "gpu_elapsed_avg_ms": 0.24820864315352698
+ },
+ "zoom_70": {
+ "output_commits": 242,
+ "glass_reblurs": 250,
+ "cpu_frame_avg_ms": 0.37701641493775934,
+ "projection_cpu_avg_ms": 0.029802261410788383,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.19247998547717843,
+ "gpu_elapsed_avg_ms": 0.2473759002079002
+ },
+ "zoom_55": {
+ "output_commits": 241,
+ "glass_reblurs": 254,
+ "cpu_frame_avg_ms": 0.37608751867219914,
+ "projection_cpu_avg_ms": 0.028878821576763487,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.19316014522821576,
+ "gpu_elapsed_avg_ms": 0.2451726846473029
+ },
+ "zoom_min_hold": {
+ "output_commits": 252,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.2893484412371134,
+ "projection_cpu_avg_ms": 0.026425911340206186,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.11520007216494844,
+ "gpu_elapsed_avg_ms": 0.11982366735537191
+ }
+ },
+ "mixed_noglass": {
+ "idle": {
+ "output_commits": 0,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0,
+ "projection_cpu_avg_ms": 0,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0,
+ "gpu_elapsed_avg_ms": 0
+ },
+ "spinner_clear": {
+ "output_commits": 245,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.30927466735537185,
+ "projection_cpu_avg_ms": 0.030129322314049585,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.11204196280991735,
+ "gpu_elapsed_avg_ms": 0.120478326446281
+ },
+ "spinner_glass": {
+ "output_commits": 244,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3248059049586777,
+ "projection_cpu_avg_ms": 0.032384229338842975,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.12307288429752067,
+ "gpu_elapsed_avg_ms": 0.12740905371900826
+ },
+ "damage_full": {
+ "output_commits": 242,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3365520807453416,
+ "projection_cpu_avg_ms": 0.03253162732919255,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.13555898136645964,
+ "gpu_elapsed_avg_ms": 0.18085576604554865
+ },
+ "drag": {
+ "output_commits": 490,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.33609798780487804,
+ "projection_cpu_avg_ms": 0.05040808739837398,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.14613738617886177,
+ "gpu_elapsed_avg_ms": 0.219122837398374
+ },
+ "resize": {
+ "output_commits": 472,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.580564,
+ "projection_cpu_avg_ms": 0.15257531991525425,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2806300169491525,
+ "gpu_elapsed_avg_ms": 0.3754828834745763
+ },
+ "fullscreen": {
+ "output_commits": 458,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.27121729694323143,
+ "projection_cpu_avg_ms": 0.01920722270742358,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.16417108515283843,
+ "gpu_elapsed_avg_ms": 0.3506368427947598
+ },
+ "zoom_85": {
+ "output_commits": 258,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.28382592164948456,
+ "projection_cpu_avg_ms": 0.02670721649484536,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.10927420412371135,
+ "gpu_elapsed_avg_ms": 0.1058177443298969
+ },
+ "zoom_70": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3474085258799172,
+ "projection_cpu_avg_ms": 0.033370654244306415,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.12782226708074534,
+ "gpu_elapsed_avg_ms": 0.12847090062111802
+ },
+ "zoom_55": {
+ "output_commits": 240,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.38836581704781703,
+ "projection_cpu_avg_ms": 0.03768934095634096,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.14703162577962578,
+ "gpu_elapsed_avg_ms": 0.16391435966735968
+ },
+ "zoom_min_hold": {
+ "output_commits": 250,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.34709571842650105,
+ "projection_cpu_avg_ms": 0.03243346376811594,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.13045561904761904,
+ "gpu_elapsed_avg_ms": 0.12245600621118012
+ }
+ }
+ }
+ },
+ "s6-a": {
+ "meta": {
+ "commit": "07806c3",
+ "dirty": true,
+ "renderer": "gles2",
+ "kernel": "7.2.9-zen1-1-zen",
+ "cpu": "12th Gen Intel(R) Core(TM) i9-12900H",
+ "pinned_cpus": [
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "render_device": "/dev/dri/renderD128",
+ "seconds": 4.0,
+ "power": {
+ "ac_online": true,
+ "battery": "Not charging",
+ "platform_profile": "performance",
+ "governor": "schedutil",
+ "epp": "performance",
+ "no_turbo": "0"
+ },
+ "date": "2026-10-12 19:28:23"
+ },
+ "clean": {
+ "scale1": {
+ "idle": {
+ "cpu_percent": 0.004,
+ "voluntary_switches_per_s": 1.0,
+ "instructions_per_s": 7857,
+ "cycles_per_s": 12892,
+ "rss_kb": 134108,
+ "rss_anon_kb": 44644
+ },
+ "spinner_clear": {
+ "cpu_percent": 7.519,
+ "voluntary_switches_per_s": 190.0,
+ "instructions_per_s": 32693580,
+ "cycles_per_s": 47661791,
+ "rss_kb": 134896,
+ "rss_anon_kb": 45280
+ },
+ "spinner_glass": {
+ "cpu_percent": 8.592,
+ "voluntary_switches_per_s": 192.7,
+ "instructions_per_s": 53056148,
+ "cycles_per_s": 64272076,
+ "rss_kb": 134896,
+ "rss_anon_kb": 45280
+ },
+ "damage_full": {
+ "cpu_percent": 11.599,
+ "voluntary_switches_per_s": 187.0,
+ "instructions_per_s": 56964334,
+ "cycles_per_s": 98305597,
+ "rss_kb": 134896,
+ "rss_anon_kb": 45280
+ },
+ "drag": {
+ "cpu_percent": 4.509,
+ "voluntary_switches_per_s": 170.7,
+ "instructions_per_s": 46608823,
+ "cycles_per_s": 54677615,
+ "rss_kb": 134960,
+ "rss_anon_kb": 45280
+ },
+ "resize": {
+ "cpu_percent": 14.508,
+ "voluntary_switches_per_s": 205.0,
+ "instructions_per_s": 163245007,
+ "cycles_per_s": 125691487,
+ "rss_kb": 134976,
+ "rss_anon_kb": 45296
+ },
+ "fullscreen": {
+ "cpu_percent": 34.303,
+ "voluntary_switches_per_s": 112.2,
+ "instructions_per_s": 31018864,
+ "cycles_per_s": 207533285,
+ "rss_kb": 153188,
+ "rss_anon_kb": 49108
+ },
+ "zoom_85": {
+ "cpu_percent": 8.719,
+ "voluntary_switches_per_s": 188.7,
+ "instructions_per_s": 52869119,
+ "cycles_per_s": 60705985,
+ "rss_kb": 138804,
+ "rss_anon_kb": 49124
+ },
+ "zoom_70": {
+ "cpu_percent": 8.787,
+ "voluntary_switches_per_s": 188.2,
+ "instructions_per_s": 53736629,
+ "cycles_per_s": 57369499,
+ "rss_kb": 139052,
+ "rss_anon_kb": 49372
+ },
+ "zoom_55": {
+ "cpu_percent": 9.629,
+ "voluntary_switches_per_s": 188.0,
+ "instructions_per_s": 52781276,
+ "cycles_per_s": 59109896,
+ "rss_kb": 139060,
+ "rss_anon_kb": 49380
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 7.289,
+ "voluntary_switches_per_s": 190.7,
+ "instructions_per_s": 37773088,
+ "cycles_per_s": 52511909,
+ "rss_kb": 139280,
+ "rss_anon_kb": 49600
+ }
+ },
+ "scale1.5": {
+ "idle": {
+ "cpu_percent": 0.002,
+ "voluntary_switches_per_s": 0.4,
+ "instructions_per_s": 146,
+ "cycles_per_s": 2722,
+ "rss_kb": 136924,
+ "rss_anon_kb": 47492
+ },
+ "spinner_clear": {
+ "cpu_percent": 7.447,
+ "voluntary_switches_per_s": 190.0,
+ "instructions_per_s": 32824411,
+ "cycles_per_s": 43812999,
+ "rss_kb": 137788,
+ "rss_anon_kb": 48164
+ },
+ "spinner_glass": {
+ "cpu_percent": 7.062,
+ "voluntary_switches_per_s": 188.7,
+ "instructions_per_s": 56061129,
+ "cycles_per_s": 61757380,
+ "rss_kb": 137788,
+ "rss_anon_kb": 48164
+ },
+ "damage_full": {
+ "cpu_percent": 11.332,
+ "voluntary_switches_per_s": 191.2,
+ "instructions_per_s": 63570115,
+ "cycles_per_s": 95256380,
+ "rss_kb": 137800,
+ "rss_anon_kb": 48176
+ },
+ "drag": {
+ "cpu_percent": 6.289,
+ "voluntary_switches_per_s": 166.6,
+ "instructions_per_s": 47625314,
+ "cycles_per_s": 45515025,
+ "rss_kb": 138032,
+ "rss_anon_kb": 48344
+ },
+ "resize": {
+ "cpu_percent": 17.961,
+ "voluntary_switches_per_s": 231.7,
+ "instructions_per_s": 289895316,
+ "cycles_per_s": 173439835,
+ "rss_kb": 138080,
+ "rss_anon_kb": 48392
+ },
+ "fullscreen": {
+ "cpu_percent": 29.541,
+ "voluntary_switches_per_s": 168.2,
+ "instructions_per_s": 47941864,
+ "cycles_per_s": 454593409,
+ "rss_kb": 145812,
+ "rss_anon_kb": 56124
+ },
+ "zoom_85": {
+ "cpu_percent": 8.565,
+ "voluntary_switches_per_s": 188.5,
+ "instructions_per_s": 54894572,
+ "cycles_per_s": 58216167,
+ "rss_kb": 145828,
+ "rss_anon_kb": 56140
+ },
+ "zoom_70": {
+ "cpu_percent": 8.351,
+ "voluntary_switches_per_s": 188.0,
+ "instructions_per_s": 56760063,
+ "cycles_per_s": 60215837,
+ "rss_kb": 146564,
+ "rss_anon_kb": 56876
+ },
+ "zoom_55": {
+ "cpu_percent": 8.012,
+ "voluntary_switches_per_s": 188.5,
+ "instructions_per_s": 55215090,
+ "cycles_per_s": 59452832,
+ "rss_kb": 146896,
+ "rss_anon_kb": 56888
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 7.645,
+ "voluntary_switches_per_s": 189.0,
+ "instructions_per_s": 38949801,
+ "cycles_per_s": 52405745,
+ "rss_kb": 146752,
+ "rss_anon_kb": 57064
+ }
+ },
+ "mixed": {
+ "idle": {
+ "cpu_percent": 0.003,
+ "voluntary_switches_per_s": 0.6,
+ "instructions_per_s": 2721,
+ "cycles_per_s": 6196,
+ "rss_kb": 138828,
+ "rss_anon_kb": 49336
+ },
+ "spinner_clear": {
+ "cpu_percent": 7.373,
+ "voluntary_switches_per_s": 246.5,
+ "instructions_per_s": 37240889,
+ "cycles_per_s": 48339244,
+ "rss_kb": 143552,
+ "rss_anon_kb": 53932
+ },
+ "spinner_glass": {
+ "cpu_percent": 8.483,
+ "voluntary_switches_per_s": 238.7,
+ "instructions_per_s": 51188779,
+ "cycles_per_s": 58459734,
+ "rss_kb": 143808,
+ "rss_anon_kb": 53932
+ },
+ "damage_full": {
+ "cpu_percent": 11.594,
+ "voluntary_switches_per_s": 237.5,
+ "instructions_per_s": 56133288,
+ "cycles_per_s": 83749378,
+ "rss_kb": 143552,
+ "rss_anon_kb": 53932
+ },
+ "drag": {
+ "cpu_percent": 7.167,
+ "voluntary_switches_per_s": 192.2,
+ "instructions_per_s": 60579030,
+ "cycles_per_s": 56548650,
+ "rss_kb": 143616,
+ "rss_anon_kb": 53932
+ },
+ "resize": {
+ "cpu_percent": 20.582,
+ "voluntary_switches_per_s": 221.2,
+ "instructions_per_s": 318341277,
+ "cycles_per_s": 179762259,
+ "rss_kb": 143616,
+ "rss_anon_kb": 53932
+ },
+ "fullscreen": {
+ "cpu_percent": 38.306,
+ "voluntary_switches_per_s": 139.2,
+ "instructions_per_s": 40271121,
+ "cycles_per_s": 296338592,
+ "rss_kb": 148064,
+ "rss_anon_kb": 58380
+ },
+ "zoom_85": {
+ "cpu_percent": 8.818,
+ "voluntary_switches_per_s": 250.7,
+ "instructions_per_s": 53348466,
+ "cycles_per_s": 59465388,
+ "rss_kb": 148080,
+ "rss_anon_kb": 58396
+ },
+ "zoom_70": {
+ "cpu_percent": 8.716,
+ "voluntary_switches_per_s": 235.2,
+ "instructions_per_s": 55144879,
+ "cycles_per_s": 63662643,
+ "rss_kb": 148664,
+ "rss_anon_kb": 58980
+ },
+ "zoom_55": {
+ "cpu_percent": 8.558,
+ "voluntary_switches_per_s": 227.7,
+ "instructions_per_s": 54832526,
+ "cycles_per_s": 57084681,
+ "rss_kb": 148672,
+ "rss_anon_kb": 58988
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 7.038,
+ "voluntary_switches_per_s": 244.5,
+ "instructions_per_s": 42730843,
+ "cycles_per_s": 50814509,
+ "rss_kb": 148672,
+ "rss_anon_kb": 58988
+ }
+ },
+ "mixed_noglass": {
+ "idle": {
+ "cpu_percent": 0.003,
+ "voluntary_switches_per_s": 0.6,
+ "instructions_per_s": 151,
+ "cycles_per_s": 2523,
+ "rss_kb": 137992,
+ "rss_anon_kb": 48820
+ },
+ "spinner_clear": {
+ "cpu_percent": 6.604,
+ "voluntary_switches_per_s": 249.0,
+ "instructions_per_s": 36408196,
+ "cycles_per_s": 44784244,
+ "rss_kb": 142584,
+ "rss_anon_kb": 53284
+ },
+ "spinner_glass": {
+ "cpu_percent": 7.607,
+ "voluntary_switches_per_s": 244.5,
+ "instructions_per_s": 38265168,
+ "cycles_per_s": 43690095,
+ "rss_kb": 142584,
+ "rss_anon_kb": 53284
+ },
+ "damage_full": {
+ "cpu_percent": 10.69,
+ "voluntary_switches_per_s": 242.7,
+ "instructions_per_s": 41544397,
+ "cycles_per_s": 73574975,
+ "rss_kb": 142584,
+ "rss_anon_kb": 53284
+ },
+ "drag": {
+ "cpu_percent": 4.146,
+ "voluntary_switches_per_s": 201.3,
+ "instructions_per_s": 39409295,
+ "cycles_per_s": 38696627,
+ "rss_kb": 142648,
+ "rss_anon_kb": 53284
+ },
+ "resize": {
+ "cpu_percent": 15.011,
+ "voluntary_switches_per_s": 204.0,
+ "instructions_per_s": 283028190,
+ "cycles_per_s": 160896608,
+ "rss_kb": 142648,
+ "rss_anon_kb": 53284
+ },
+ "fullscreen": {
+ "cpu_percent": 36.956,
+ "voluntary_switches_per_s": 153.5,
+ "instructions_per_s": 39091625,
+ "cycles_per_s": 378828451,
+ "rss_kb": 147664,
+ "rss_anon_kb": 58300
+ },
+ "zoom_85": {
+ "cpu_percent": 7.198,
+ "voluntary_switches_per_s": 245.5,
+ "instructions_per_s": 39188642,
+ "cycles_per_s": 48788328,
+ "rss_kb": 147664,
+ "rss_anon_kb": 58300
+ },
+ "zoom_70": {
+ "cpu_percent": 7.798,
+ "voluntary_switches_per_s": 243.0,
+ "instructions_per_s": 38869242,
+ "cycles_per_s": 50923302,
+ "rss_kb": 148020,
+ "rss_anon_kb": 58656
+ },
+ "zoom_55": {
+ "cpu_percent": 7.703,
+ "voluntary_switches_per_s": 247.7,
+ "instructions_per_s": 39093145,
+ "cycles_per_s": 51471125,
+ "rss_kb": 148024,
+ "rss_anon_kb": 58660
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 8.334,
+ "voluntary_switches_per_s": 244.0,
+ "instructions_per_s": 39798674,
+ "cycles_per_s": 54245647,
+ "rss_kb": 148024,
+ "rss_anon_kb": 58660
+ }
+ }
+ },
+ "stats": {
+ "scale1": {
+ "idle": {
+ "output_commits": 0,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0,
+ "projection_cpu_avg_ms": 0,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0,
+ "gpu_elapsed_avg_ms": 0
+ },
+ "spinner_clear": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.4262172263374486,
+ "projection_cpu_avg_ms": 0.02837445267489712,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2159532181069959,
+ "gpu_elapsed_avg_ms": 0.21268088888888886
+ },
+ "spinner_glass": {
+ "output_commits": 240,
+ "glass_reblurs": 240,
+ "cpu_frame_avg_ms": 0.6086336166666667,
+ "projection_cpu_avg_ms": 0.028915275,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.38476493333333334,
+ "gpu_elapsed_avg_ms": 0.4748086375
+ },
+ "damage_full": {
+ "output_commits": 240,
+ "glass_reblurs": 240,
+ "cpu_frame_avg_ms": 0.6496991541666667,
+ "projection_cpu_avg_ms": 0.03037595833333333,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.432763025,
+ "gpu_elapsed_avg_ms": 0.6133543916666667
+ },
+ "drag": {
+ "output_commits": 242,
+ "glass_reblurs": 244,
+ "cpu_frame_avg_ms": 0.7032582962962963,
+ "projection_cpu_avg_ms": 0.03778234979423868,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.45974870781893,
+ "gpu_elapsed_avg_ms": 0.683997341563786
+ },
+ "resize": {
+ "output_commits": 238,
+ "glass_reblurs": 304,
+ "cpu_frame_avg_ms": 0.7443755588235293,
+ "projection_cpu_avg_ms": 0.039691378151260504,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.5263870252100841,
+ "gpu_elapsed_avg_ms": 0.8191005630252101
+ },
+ "fullscreen": {
+ "output_commits": 232,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.4108612435897436,
+ "projection_cpu_avg_ms": 0.025500850427350424,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2637363418803419,
+ "gpu_elapsed_avg_ms": 0.6463695128205129
+ },
+ "zoom_85": {
+ "output_commits": 240,
+ "glass_reblurs": 252,
+ "cpu_frame_avg_ms": 0.6266758874999999,
+ "projection_cpu_avg_ms": 0.031191908333333334,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.40390077500000005,
+ "gpu_elapsed_avg_ms": 0.5105325833333333
+ },
+ "zoom_70": {
+ "output_commits": 240,
+ "glass_reblurs": 253,
+ "cpu_frame_avg_ms": 0.6868610708333333,
+ "projection_cpu_avg_ms": 0.03371355833333334,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4358765833333333,
+ "gpu_elapsed_avg_ms": 0.5179557541666666
+ },
+ "zoom_55": {
+ "output_commits": 240,
+ "glass_reblurs": 253,
+ "cpu_frame_avg_ms": 0.6207503625,
+ "projection_cpu_avg_ms": 0.0308798375,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.39628588333333337,
+ "gpu_elapsed_avg_ms": 0.4724231625
+ },
+ "zoom_min_hold": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.4756474279835391,
+ "projection_cpu_avg_ms": 0.028374189300411523,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.24606253497942385,
+ "gpu_elapsed_avg_ms": 0.23475008230452676
+ }
+ },
+ "scale1.5": {
+ "idle": {
+ "output_commits": 0,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0,
+ "projection_cpu_avg_ms": 0,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0,
+ "gpu_elapsed_avg_ms": 0
+ },
+ "spinner_clear": {
+ "output_commits": 242,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.47317618181818183,
+ "projection_cpu_avg_ms": 0.03457638016528926,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.23669712396694217,
+ "gpu_elapsed_avg_ms": 0.20860087603305782
+ },
+ "spinner_glass": {
+ "output_commits": 240,
+ "glass_reblurs": 240,
+ "cpu_frame_avg_ms": 0.6483671333333333,
+ "projection_cpu_avg_ms": 0.03339382916666667,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4216437291666667,
+ "gpu_elapsed_avg_ms": 0.5702072375
+ },
+ "damage_full": {
+ "output_commits": 238,
+ "glass_reblurs": 238,
+ "cpu_frame_avg_ms": 0.8032571050420169,
+ "projection_cpu_avg_ms": 0.03848551680672269,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.5421409915966386,
+ "gpu_elapsed_avg_ms": 0.7962366764705882
+ },
+ "drag": {
+ "output_commits": 240,
+ "glass_reblurs": 243,
+ "cpu_frame_avg_ms": 0.8459555477178423,
+ "projection_cpu_avg_ms": 0.050982962655601656,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.550808336099585,
+ "gpu_elapsed_avg_ms": 0.9601778589211618
+ },
+ "resize": {
+ "output_commits": 239,
+ "glass_reblurs": 308,
+ "cpu_frame_avg_ms": 0.7441296569037658,
+ "projection_cpu_avg_ms": 0.04149028870292887,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.5334619539748954,
+ "gpu_elapsed_avg_ms": 1.0279637280334728
+ },
+ "fullscreen": {
+ "output_commits": 229,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3966022532751092,
+ "projection_cpu_avg_ms": 0.02572650218340611,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2589999519650655,
+ "gpu_elapsed_avg_ms": 0.965484192139738
+ },
+ "zoom_85": {
+ "output_commits": 239,
+ "glass_reblurs": 252,
+ "cpu_frame_avg_ms": 0.7066271422594141,
+ "projection_cpu_avg_ms": 0.03708236820083682,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.45728381171548116,
+ "gpu_elapsed_avg_ms": 0.5967422677824268
+ },
+ "zoom_70": {
+ "output_commits": 240,
+ "glass_reblurs": 252,
+ "cpu_frame_avg_ms": 0.6610032208333333,
+ "projection_cpu_avg_ms": 0.03225682916666667,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.42885036249999997,
+ "gpu_elapsed_avg_ms": 0.5726399541666667
+ },
+ "zoom_55": {
+ "output_commits": 240,
+ "glass_reblurs": 253,
+ "cpu_frame_avg_ms": 0.6418336125,
+ "projection_cpu_avg_ms": 0.030834125,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4175881666666667,
+ "gpu_elapsed_avg_ms": 0.5411902791666666
+ },
+ "zoom_min_hold": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.4691670740740741,
+ "projection_cpu_avg_ms": 0.029120197530864197,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2466365185185185,
+ "gpu_elapsed_avg_ms": 0.24085392592592592
+ }
+ },
+ "mixed": {
+ "idle": {
+ "output_commits": 0,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0,
+ "projection_cpu_avg_ms": 0,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0,
+ "gpu_elapsed_avg_ms": 0
+ },
+ "spinner_clear": {
+ "output_commits": 245,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.24438129278350518,
+ "projection_cpu_avg_ms": 0.019705938144329894,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.0956998,
+ "gpu_elapsed_avg_ms": 0.09562109484536083
+ },
+ "spinner_glass": {
+ "output_commits": 242,
+ "glass_reblurs": 242,
+ "cpu_frame_avg_ms": 0.3080482614107884,
+ "projection_cpu_avg_ms": 0.01975704979253112,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.16183823858921162,
+ "gpu_elapsed_avg_ms": 0.2111405145228216
+ },
+ "damage_full": {
+ "output_commits": 244,
+ "glass_reblurs": 244,
+ "cpu_frame_avg_ms": 0.28589054545454545,
+ "projection_cpu_avg_ms": 0.016808712809917355,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.15813854338842973,
+ "gpu_elapsed_avg_ms": 0.2278605061983471
+ },
+ "drag": {
+ "output_commits": 489,
+ "glass_reblurs": 410,
+ "cpu_frame_avg_ms": 0.38850619144602855,
+ "projection_cpu_avg_ms": 0.027413837067209776,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.23992022199592666,
+ "gpu_elapsed_avg_ms": 0.3558089287169042
+ },
+ "resize": {
+ "output_commits": 481,
+ "glass_reblurs": 665,
+ "cpu_frame_avg_ms": 0.4765827297297297,
+ "projection_cpu_avg_ms": 0.02536403742203742,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.33971207068607073,
+ "gpu_elapsed_avg_ms": 0.5470156237006237
+ },
+ "fullscreen": {
+ "output_commits": 237,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.20523770563674323,
+ "projection_cpu_avg_ms": 0.01708555114822547,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.0968478267223382,
+ "gpu_elapsed_avg_ms": 0.2425071878914405
+ },
+ "zoom_85": {
+ "output_commits": 256,
+ "glass_reblurs": 269,
+ "cpu_frame_avg_ms": 0.2962985217391304,
+ "projection_cpu_avg_ms": 0.0180619917184265,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.15739289648033125,
+ "gpu_elapsed_avg_ms": 0.19351828985507244
+ },
+ "zoom_70": {
+ "output_commits": 242,
+ "glass_reblurs": 251,
+ "cpu_frame_avg_ms": 0.3435140560165975,
+ "projection_cpu_avg_ms": 0.02164338174273859,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.1826542510373444,
+ "gpu_elapsed_avg_ms": 0.21171052697095435
+ },
+ "zoom_55": {
+ "output_commits": 242,
+ "glass_reblurs": 255,
+ "cpu_frame_avg_ms": 0.31950262732919255,
+ "projection_cpu_avg_ms": 0.019389120082815733,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.17430986956521738,
+ "gpu_elapsed_avg_ms": 0.20823402070393376
+ },
+ "zoom_min_hold": {
+ "output_commits": 255,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.2592399423868313,
+ "projection_cpu_avg_ms": 0.018472421810699587,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.11192118106995885,
+ "gpu_elapsed_avg_ms": 0.1161256255144033
+ }
+ },
+ "mixed_noglass": {
+ "idle": {
+ "output_commits": 0,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0,
+ "projection_cpu_avg_ms": 0,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0,
+ "gpu_elapsed_avg_ms": 0
+ },
+ "spinner_clear": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3200681014492754,
+ "projection_cpu_avg_ms": 0.026450687370600415,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.11934977846790891,
+ "gpu_elapsed_avg_ms": 0.122526
+ },
+ "spinner_glass": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.31206686542443063,
+ "projection_cpu_avg_ms": 0.024740848861283644,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.1190941801242236,
+ "gpu_elapsed_avg_ms": 0.1210428612836439
+ },
+ "damage_full": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3149756169772257,
+ "projection_cpu_avg_ms": 0.02466790890269151,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.12748577639751552,
+ "gpu_elapsed_avg_ms": 0.15376313250517598
+ },
+ "drag": {
+ "output_commits": 488,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.44561467959183676,
+ "projection_cpu_avg_ms": 0.040719932653061224,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2074553387755102,
+ "gpu_elapsed_avg_ms": 0.28233202249488754
+ },
+ "resize": {
+ "output_commits": 482,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3674521950207469,
+ "projection_cpu_avg_ms": 0.02757775726141079,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.23615467219917013,
+ "gpu_elapsed_avg_ms": 0.32484970270270275
+ },
+ "fullscreen": {
+ "output_commits": 122,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.2409555230125523,
+ "projection_cpu_avg_ms": 0.022101828451882844,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.07092375941422595,
+ "gpu_elapsed_avg_ms": 0.16294510041841004
+ },
+ "zoom_85": {
+ "output_commits": 255,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3122959481327801,
+ "projection_cpu_avg_ms": 0.02372412863070539,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.12463009128630706,
+ "gpu_elapsed_avg_ms": 0.11860946473029046
+ },
+ "zoom_70": {
+ "output_commits": 242,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3199588861283644,
+ "projection_cpu_avg_ms": 0.02583757971014493,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.12196528364389234,
+ "gpu_elapsed_avg_ms": 0.12159623809523809
+ },
+ "zoom_55": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3036328367768595,
+ "projection_cpu_avg_ms": 0.024109043388429754,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.11742762396694215,
+ "gpu_elapsed_avg_ms": 0.11527309710743802
+ },
+ "zoom_min_hold": {
+ "output_commits": 253,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3211599214876033,
+ "projection_cpu_avg_ms": 0.02371223347107438,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.12546426859504134,
+ "gpu_elapsed_avg_ms": 0.12496228157349897
+ }
+ }
+ }
+ },
+ "s6-b": {
+ "meta": {
+ "commit": "07806c3",
+ "dirty": true,
+ "renderer": "gles2",
+ "kernel": "7.2.9-zen1-1-zen",
+ "cpu": "12th Gen Intel(R) Core(TM) i9-12900H",
+ "pinned_cpus": [
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "render_device": "/dev/dri/renderD128",
+ "seconds": 4.0,
+ "power": {
+ "ac_online": true,
+ "battery": "Not charging",
+ "platform_profile": "performance",
+ "governor": "schedutil",
+ "epp": "performance",
+ "no_turbo": "0"
+ },
+ "date": "2026-10-12 19:36:02"
+ },
+ "clean": {
+ "scale1": {
+ "idle": {
+ "cpu_percent": 0.002,
+ "voluntary_switches_per_s": 0.4,
+ "instructions_per_s": 143,
+ "cycles_per_s": 2690,
+ "rss_kb": 134420,
+ "rss_anon_kb": 44872
+ },
+ "spinner_clear": {
+ "cpu_percent": 7.414,
+ "voluntary_switches_per_s": 189.5,
+ "instructions_per_s": 32701280,
+ "cycles_per_s": 43134031,
+ "rss_kb": 135448,
+ "rss_anon_kb": 45512
+ },
+ "spinner_glass": {
+ "cpu_percent": 8.435,
+ "voluntary_switches_per_s": 188.0,
+ "instructions_per_s": 52712125,
+ "cycles_per_s": 53708956,
+ "rss_kb": 135192,
+ "rss_anon_kb": 45512
+ },
+ "damage_full": {
+ "cpu_percent": 11.77,
+ "voluntary_switches_per_s": 187.0,
+ "instructions_per_s": 56758312,
+ "cycles_per_s": 81289036,
+ "rss_kb": 135192,
+ "rss_anon_kb": 45512
+ },
+ "drag": {
+ "cpu_percent": 7.832,
+ "voluntary_switches_per_s": 161.5,
+ "instructions_per_s": 45362887,
+ "cycles_per_s": 46260292,
+ "rss_kb": 135256,
+ "rss_anon_kb": 45512
+ },
+ "resize": {
+ "cpu_percent": 16.232,
+ "voluntary_switches_per_s": 226.0,
+ "instructions_per_s": 163246360,
+ "cycles_per_s": 117786871,
+ "rss_kb": 135380,
+ "rss_anon_kb": 45636
+ },
+ "fullscreen": {
+ "cpu_percent": 43.2,
+ "voluntary_switches_per_s": 154.5,
+ "instructions_per_s": 47137043,
+ "cycles_per_s": 310752934,
+ "rss_kb": 139080,
+ "rss_anon_kb": 49336
+ },
+ "zoom_85": {
+ "cpu_percent": 8.706,
+ "voluntary_switches_per_s": 188.0,
+ "instructions_per_s": 52594740,
+ "cycles_per_s": 54190371,
+ "rss_kb": 139096,
+ "rss_anon_kb": 49352
+ },
+ "zoom_70": {
+ "cpu_percent": 8.568,
+ "voluntary_switches_per_s": 187.7,
+ "instructions_per_s": 53709570,
+ "cycles_per_s": 54603548,
+ "rss_kb": 139344,
+ "rss_anon_kb": 49600
+ },
+ "zoom_55": {
+ "cpu_percent": 8.623,
+ "voluntary_switches_per_s": 188.2,
+ "instructions_per_s": 52822708,
+ "cycles_per_s": 54231003,
+ "rss_kb": 139416,
+ "rss_anon_kb": 49608
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 8.213,
+ "voluntary_switches_per_s": 189.0,
+ "instructions_per_s": 37363234,
+ "cycles_per_s": 45798843,
+ "rss_kb": 139684,
+ "rss_anon_kb": 49940
+ }
+ },
+ "scale1.5": {
+ "idle": {
+ "cpu_percent": 0.003,
+ "voluntary_switches_per_s": 0.4,
+ "instructions_per_s": 143,
+ "cycles_per_s": 1675,
+ "rss_kb": 138276,
+ "rss_anon_kb": 48520
+ },
+ "spinner_clear": {
+ "cpu_percent": 7.711,
+ "voluntary_switches_per_s": 189.7,
+ "instructions_per_s": 32747903,
+ "cycles_per_s": 42441095,
+ "rss_kb": 139080,
+ "rss_anon_kb": 49188
+ },
+ "spinner_glass": {
+ "cpu_percent": 8.775,
+ "voluntary_switches_per_s": 187.2,
+ "instructions_per_s": 55618327,
+ "cycles_per_s": 54225728,
+ "rss_kb": 139080,
+ "rss_anon_kb": 49188
+ },
+ "damage_full": {
+ "cpu_percent": 12.175,
+ "voluntary_switches_per_s": 186.2,
+ "instructions_per_s": 62767284,
+ "cycles_per_s": 77914154,
+ "rss_kb": 139092,
+ "rss_anon_kb": 49200
+ },
+ "drag": {
+ "cpu_percent": 7.815,
+ "voluntary_switches_per_s": 164.1,
+ "instructions_per_s": 47138934,
+ "cycles_per_s": 47058299,
+ "rss_kb": 139328,
+ "rss_anon_kb": 49372
+ },
+ "resize": {
+ "cpu_percent": 19.558,
+ "voluntary_switches_per_s": 219.0,
+ "instructions_per_s": 289506665,
+ "cycles_per_s": 159041337,
+ "rss_kb": 139376,
+ "rss_anon_kb": 49420
+ },
+ "fullscreen": {
+ "cpu_percent": 39.374,
+ "voluntary_switches_per_s": 105.5,
+ "instructions_per_s": 45087418,
+ "cycles_per_s": 288994448,
+ "rss_kb": 147752,
+ "rss_anon_kb": 57796
+ },
+ "zoom_85": {
+ "cpu_percent": 8.717,
+ "voluntary_switches_per_s": 191.7,
+ "instructions_per_s": 55071868,
+ "cycles_per_s": 53489128,
+ "rss_kb": 147768,
+ "rss_anon_kb": 57812
+ },
+ "zoom_70": {
+ "cpu_percent": 8.307,
+ "voluntary_switches_per_s": 187.0,
+ "instructions_per_s": 56279924,
+ "cycles_per_s": 52354325,
+ "rss_kb": 147816,
+ "rss_anon_kb": 57860
+ },
+ "zoom_55": {
+ "cpu_percent": 8.526,
+ "voluntary_switches_per_s": 187.7,
+ "instructions_per_s": 54913476,
+ "cycles_per_s": 54809620,
+ "rss_kb": 147828,
+ "rss_anon_kb": 57872
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 7.817,
+ "voluntary_switches_per_s": 189.2,
+ "instructions_per_s": 38870894,
+ "cycles_per_s": 44909454,
+ "rss_kb": 148256,
+ "rss_anon_kb": 58300
+ }
+ },
+ "mixed": {
+ "idle": {
+ "cpu_percent": 0.003,
+ "voluntary_switches_per_s": 0.6,
+ "instructions_per_s": 151,
+ "cycles_per_s": 1789,
+ "rss_kb": 138356,
+ "rss_anon_kb": 48748
+ },
+ "spinner_clear": {
+ "cpu_percent": 8.714,
+ "voluntary_switches_per_s": 242.5,
+ "instructions_per_s": 37000364,
+ "cycles_per_s": 49099849,
+ "rss_kb": 143248,
+ "rss_anon_kb": 53448
+ },
+ "spinner_glass": {
+ "cpu_percent": 8.748,
+ "voluntary_switches_per_s": 240.2,
+ "instructions_per_s": 51183952,
+ "cycles_per_s": 57305679,
+ "rss_kb": 143248,
+ "rss_anon_kb": 53448
+ },
+ "damage_full": {
+ "cpu_percent": 12.433,
+ "voluntary_switches_per_s": 246.7,
+ "instructions_per_s": 55746967,
+ "cycles_per_s": 79060503,
+ "rss_kb": 143248,
+ "rss_anon_kb": 53448
+ },
+ "drag": {
+ "cpu_percent": 8.797,
+ "voluntary_switches_per_s": 176.9,
+ "instructions_per_s": 59288524,
+ "cycles_per_s": 56577402,
+ "rss_kb": 143312,
+ "rss_anon_kb": 53448
+ },
+ "resize": {
+ "cpu_percent": 20.065,
+ "voluntary_switches_per_s": 208.5,
+ "instructions_per_s": 318211207,
+ "cycles_per_s": 177918942,
+ "rss_kb": 143312,
+ "rss_anon_kb": 53448
+ },
+ "fullscreen": {
+ "cpu_percent": 18.884,
+ "voluntary_switches_per_s": 169.5,
+ "instructions_per_s": 24741354,
+ "cycles_per_s": 164477464,
+ "rss_kb": 147776,
+ "rss_anon_kb": 57912
+ },
+ "zoom_85": {
+ "cpu_percent": 9.439,
+ "voluntary_switches_per_s": 250.7,
+ "instructions_per_s": 53326158,
+ "cycles_per_s": 60299778,
+ "rss_kb": 147792,
+ "rss_anon_kb": 57928
+ },
+ "zoom_70": {
+ "cpu_percent": 8.881,
+ "voluntary_switches_per_s": 250.5,
+ "instructions_per_s": 55321401,
+ "cycles_per_s": 57887439,
+ "rss_kb": 148152,
+ "rss_anon_kb": 58288
+ },
+ "zoom_55": {
+ "cpu_percent": 9.272,
+ "voluntary_switches_per_s": 230.0,
+ "instructions_per_s": 54816212,
+ "cycles_per_s": 58373599,
+ "rss_kb": 148160,
+ "rss_anon_kb": 58296
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 8.673,
+ "voluntary_switches_per_s": 242.5,
+ "instructions_per_s": 42625049,
+ "cycles_per_s": 52428727,
+ "rss_kb": 148160,
+ "rss_anon_kb": 58296
+ }
+ },
+ "mixed_noglass": {
+ "idle": {
+ "cpu_percent": 0.004,
+ "voluntary_switches_per_s": 0.6,
+ "instructions_per_s": 151,
+ "cycles_per_s": 2353,
+ "rss_kb": 137380,
+ "rss_anon_kb": 48080
+ },
+ "spinner_clear": {
+ "cpu_percent": 8.31,
+ "voluntary_switches_per_s": 241.7,
+ "instructions_per_s": 36068851,
+ "cycles_per_s": 47261541,
+ "rss_kb": 141972,
+ "rss_anon_kb": 52544
+ },
+ "spinner_glass": {
+ "cpu_percent": 8.41,
+ "voluntary_switches_per_s": 242.2,
+ "instructions_per_s": 37988428,
+ "cycles_per_s": 47369480,
+ "rss_kb": 141972,
+ "rss_anon_kb": 52544
+ },
+ "damage_full": {
+ "cpu_percent": 12.425,
+ "voluntary_switches_per_s": 236.0,
+ "instructions_per_s": 41155187,
+ "cycles_per_s": 68464680,
+ "rss_kb": 141972,
+ "rss_anon_kb": 52544
+ },
+ "drag": {
+ "cpu_percent": 7.923,
+ "voluntary_switches_per_s": 188.4,
+ "instructions_per_s": 38609351,
+ "cycles_per_s": 43202823,
+ "rss_kb": 142036,
+ "rss_anon_kb": 52544
+ },
+ "resize": {
+ "cpu_percent": 18.519,
+ "voluntary_switches_per_s": 163.7,
+ "instructions_per_s": 282891795,
+ "cycles_per_s": 156471746,
+ "rss_kb": 142036,
+ "rss_anon_kb": 52544
+ },
+ "fullscreen": {
+ "cpu_percent": 40.098,
+ "voluntary_switches_per_s": 144.0,
+ "instructions_per_s": 37842309,
+ "cycles_per_s": 284086281,
+ "rss_kb": 146936,
+ "rss_anon_kb": 57444
+ },
+ "zoom_85": {
+ "cpu_percent": 8.566,
+ "voluntary_switches_per_s": 242.7,
+ "instructions_per_s": 38802232,
+ "cycles_per_s": 48445566,
+ "rss_kb": 146936,
+ "rss_anon_kb": 57444
+ },
+ "zoom_70": {
+ "cpu_percent": 8.584,
+ "voluntary_switches_per_s": 243.7,
+ "instructions_per_s": 38645188,
+ "cycles_per_s": 49061728,
+ "rss_kb": 147328,
+ "rss_anon_kb": 57836
+ },
+ "zoom_55": {
+ "cpu_percent": 8.36,
+ "voluntary_switches_per_s": 250.2,
+ "instructions_per_s": 39399135,
+ "cycles_per_s": 48897455,
+ "rss_kb": 147328,
+ "rss_anon_kb": 57836
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 8.291,
+ "voluntary_switches_per_s": 241.7,
+ "instructions_per_s": 39687261,
+ "cycles_per_s": 48606525,
+ "rss_kb": 147328,
+ "rss_anon_kb": 57836
+ }
+ }
+ },
+ "stats": {
+ "scale1": {
+ "idle": {
+ "output_commits": 0,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0,
+ "projection_cpu_avg_ms": 0,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0,
+ "gpu_elapsed_avg_ms": 0
+ },
+ "spinner_clear": {
+ "output_commits": 242,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.5027754338842975,
+ "projection_cpu_avg_ms": 0.03562661570247934,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.24532261157024796,
+ "gpu_elapsed_avg_ms": 0.22638234710743801
+ },
+ "spinner_glass": {
+ "output_commits": 239,
+ "glass_reblurs": 239,
+ "cpu_frame_avg_ms": 0.6738479958158996,
+ "projection_cpu_avg_ms": 0.031284464435146445,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4303470753138075,
+ "gpu_elapsed_avg_ms": 0.5369782552301255
+ },
+ "damage_full": {
+ "output_commits": 238,
+ "glass_reblurs": 238,
+ "cpu_frame_avg_ms": 0.7600568697478991,
+ "projection_cpu_avg_ms": 0.036373453781512605,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.49042428991596637,
+ "gpu_elapsed_avg_ms": 0.6338243991596638
+ },
+ "drag": {
+ "output_commits": 236,
+ "glass_reblurs": 238,
+ "cpu_frame_avg_ms": 1.1288603924050633,
+ "projection_cpu_avg_ms": 0.060413,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.7212137974683545,
+ "gpu_elapsed_avg_ms": 0.9460266610169491
+ },
+ "resize": {
+ "output_commits": 238,
+ "glass_reblurs": 305,
+ "cpu_frame_avg_ms": 0.7361332100840337,
+ "projection_cpu_avg_ms": 0.04060121008403361,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.5253523151260504,
+ "gpu_elapsed_avg_ms": 0.8017894663865547
+ },
+ "fullscreen": {
+ "output_commits": 118,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3456702658227848,
+ "projection_cpu_avg_ms": 0.024133962025316456,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.1662307299578059,
+ "gpu_elapsed_avg_ms": 0.34403700843881857
+ },
+ "zoom_85": {
+ "output_commits": 240,
+ "glass_reblurs": 254,
+ "cpu_frame_avg_ms": 0.6447240541666667,
+ "projection_cpu_avg_ms": 0.0288671125,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.41315240833333333,
+ "gpu_elapsed_avg_ms": 0.514617
+ },
+ "zoom_70": {
+ "output_commits": 240,
+ "glass_reblurs": 253,
+ "cpu_frame_avg_ms": 0.6830863375,
+ "projection_cpu_avg_ms": 0.033005720833333335,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4359478541666667,
+ "gpu_elapsed_avg_ms": 0.5244826625
+ },
+ "zoom_55": {
+ "output_commits": 239,
+ "glass_reblurs": 252,
+ "cpu_frame_avg_ms": 0.6627937071129708,
+ "projection_cpu_avg_ms": 0.030929560669456065,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4236063933054393,
+ "gpu_elapsed_avg_ms": 0.5018359832635984
+ },
+ "zoom_min_hold": {
+ "output_commits": 241,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.5490302821576762,
+ "projection_cpu_avg_ms": 0.033774443983402486,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.27454665975103737,
+ "gpu_elapsed_avg_ms": 0.27076522406639003
+ }
+ },
+ "scale1.5": {
+ "idle": {
+ "output_commits": 0,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0,
+ "projection_cpu_avg_ms": 0,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0,
+ "gpu_elapsed_avg_ms": 0
+ },
+ "spinner_clear": {
+ "output_commits": 242,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.4451170661157025,
+ "projection_cpu_avg_ms": 0.03165035950413223,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.21972471900826446,
+ "gpu_elapsed_avg_ms": 0.19443871074380165
+ },
+ "spinner_glass": {
+ "output_commits": 240,
+ "glass_reblurs": 240,
+ "cpu_frame_avg_ms": 0.641476575,
+ "projection_cpu_avg_ms": 0.030453987499999998,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4207081458333333,
+ "gpu_elapsed_avg_ms": 0.5474902541666666
+ },
+ "damage_full": {
+ "output_commits": 237,
+ "glass_reblurs": 237,
+ "cpu_frame_avg_ms": 0.8033795316455696,
+ "projection_cpu_avg_ms": 0.03885929957805907,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.5333004219409283,
+ "gpu_elapsed_avg_ms": 0.7428978185654009
+ },
+ "drag": {
+ "output_commits": 237,
+ "glass_reblurs": 239,
+ "cpu_frame_avg_ms": 1.0562253949579832,
+ "projection_cpu_avg_ms": 0.061333294117647055,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.6760372352941176,
+ "gpu_elapsed_avg_ms": 1.0517697394957983
+ },
+ "resize": {
+ "output_commits": 239,
+ "glass_reblurs": 308,
+ "cpu_frame_avg_ms": 0.7468573807531381,
+ "projection_cpu_avg_ms": 0.04233284937238494,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.5475145020920501,
+ "gpu_elapsed_avg_ms": 0.9846455
+ },
+ "fullscreen": {
+ "output_commits": 223,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.34292189237668164,
+ "projection_cpu_avg_ms": 0.02321711659192825,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.226065067264574,
+ "gpu_elapsed_avg_ms": 0.8700931704035874
+ },
+ "zoom_85": {
+ "output_commits": 239,
+ "glass_reblurs": 252,
+ "cpu_frame_avg_ms": 0.7029160920502092,
+ "projection_cpu_avg_ms": 0.035030326359832636,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4463792217573222,
+ "gpu_elapsed_avg_ms": 0.5644734979079499
+ },
+ "zoom_70": {
+ "output_commits": 240,
+ "glass_reblurs": 253,
+ "cpu_frame_avg_ms": 0.6801445666666667,
+ "projection_cpu_avg_ms": 0.031632975,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.44103122499999997,
+ "gpu_elapsed_avg_ms": 0.5477152624999999
+ },
+ "zoom_55": {
+ "output_commits": 240,
+ "glass_reblurs": 252,
+ "cpu_frame_avg_ms": 0.6469521666666667,
+ "projection_cpu_avg_ms": 0.03177440833333333,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4167242125,
+ "gpu_elapsed_avg_ms": 0.5069242541666666
+ },
+ "zoom_min_hold": {
+ "output_commits": 241,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.5191693734439834,
+ "projection_cpu_avg_ms": 0.03189134439834025,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.26837740248962655,
+ "gpu_elapsed_avg_ms": 0.25711875933609957
+ }
+ },
+ "mixed": {
+ "idle": {
+ "output_commits": 0,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0,
+ "projection_cpu_avg_ms": 0,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0,
+ "gpu_elapsed_avg_ms": 0
+ },
+ "spinner_clear": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.32475856521739127,
+ "projection_cpu_avg_ms": 0.027103194616977227,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.1205614182194617,
+ "gpu_elapsed_avg_ms": 0.11734849689440993
+ },
+ "spinner_glass": {
+ "output_commits": 240,
+ "glass_reblurs": 240,
+ "cpu_frame_avg_ms": 0.37901949583333333,
+ "projection_cpu_avg_ms": 0.02462431875,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2016440625,
+ "gpu_elapsed_avg_ms": 0.25335187708333334
+ },
+ "damage_full": {
+ "output_commits": 240,
+ "glass_reblurs": 240,
+ "cpu_frame_avg_ms": 0.3886728958333333,
+ "projection_cpu_avg_ms": 0.024676904166666666,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.21349732916666667,
+ "gpu_elapsed_avg_ms": 0.28901497708333335
+ },
+ "drag": {
+ "output_commits": 475,
+ "glass_reblurs": 398,
+ "cpu_frame_avg_ms": 0.7228251886792453,
+ "projection_cpu_avg_ms": 0.0511077463312369,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.42847459958071277,
+ "gpu_elapsed_avg_ms": 0.5527351844863733
+ },
+ "resize": {
+ "output_commits": 480,
+ "glass_reblurs": 661,
+ "cpu_frame_avg_ms": 0.5513602520833333,
+ "projection_cpu_avg_ms": 0.030981012500000002,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.39436049375000004,
+ "gpu_elapsed_avg_ms": 0.5573472066805846
+ },
+ "fullscreen": {
+ "output_commits": 119,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.1976849309623431,
+ "projection_cpu_avg_ms": 0.017861085774058576,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.06676996652719665,
+ "gpu_elapsed_avg_ms": 0.14122463807531382
+ },
+ "zoom_85": {
+ "output_commits": 252,
+ "glass_reblurs": 264,
+ "cpu_frame_avg_ms": 0.40292578958333336,
+ "projection_cpu_avg_ms": 0.025260220833333333,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2204329416666667,
+ "gpu_elapsed_avg_ms": 0.2716348350730689
+ },
+ "zoom_70": {
+ "output_commits": 241,
+ "glass_reblurs": 250,
+ "cpu_frame_avg_ms": 0.3761943097713098,
+ "projection_cpu_avg_ms": 0.02438758627858628,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2056767338877339,
+ "gpu_elapsed_avg_ms": 0.2538217027027027
+ },
+ "zoom_55": {
+ "output_commits": 241,
+ "glass_reblurs": 255,
+ "cpu_frame_avg_ms": 0.39675971041666663,
+ "projection_cpu_avg_ms": 0.025522410416666665,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.21071681458333333,
+ "gpu_elapsed_avg_ms": 0.258630425
+ },
+ "zoom_min_hold": {
+ "output_commits": 252,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.33978629752066114,
+ "projection_cpu_avg_ms": 0.025734886363636363,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.14014907024793388,
+ "gpu_elapsed_avg_ms": 0.1431139276859504
+ }
+ },
+ "mixed_noglass": {
+ "idle": {
+ "output_commits": 0,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0,
+ "projection_cpu_avg_ms": 0,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0,
+ "gpu_elapsed_avg_ms": 0
+ },
+ "spinner_clear": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3162944492753623,
+ "projection_cpu_avg_ms": 0.02494293788819876,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.11623506418219462,
+ "gpu_elapsed_avg_ms": 0.11498070600414079
+ },
+ "spinner_glass": {
+ "output_commits": 242,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3193465041493776,
+ "projection_cpu_avg_ms": 0.025010964730290457,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.12208753734439834,
+ "gpu_elapsed_avg_ms": 0.12024897095435684
+ },
+ "damage_full": {
+ "output_commits": 242,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3324972111801242,
+ "projection_cpu_avg_ms": 0.026126931677018635,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.13240413043478264,
+ "gpu_elapsed_avg_ms": 0.1585014513457557
+ },
+ "drag": {
+ "output_commits": 483,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.5256279670103092,
+ "projection_cpu_avg_ms": 0.04694072577319587,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.24734007628865978,
+ "gpu_elapsed_avg_ms": 0.33595756314699793
+ },
+ "resize": {
+ "output_commits": 480,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.32385095,
+ "projection_cpu_avg_ms": 0.02506273125,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.21011882916666666,
+ "gpu_elapsed_avg_ms": 0.2683568791666667
+ },
+ "fullscreen": {
+ "output_commits": 231,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.20912074788135593,
+ "projection_cpu_avg_ms": 0.017530349576271188,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.09619942372881356,
+ "gpu_elapsed_avg_ms": 0.21708454237288136
+ },
+ "zoom_85": {
+ "output_commits": 254,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3260125888429752,
+ "projection_cpu_avg_ms": 0.024840493801652895,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.12873857644628098,
+ "gpu_elapsed_avg_ms": 0.13005972933884297
+ },
+ "zoom_70": {
+ "output_commits": 242,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.33434678674948237,
+ "projection_cpu_avg_ms": 0.027141035196687372,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.12998325879917186,
+ "gpu_elapsed_avg_ms": 0.13063459420289855
+ },
+ "zoom_55": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3378066708074534,
+ "projection_cpu_avg_ms": 0.02703637060041408,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.13087038302277434,
+ "gpu_elapsed_avg_ms": 0.13135523395445134
+ },
+ "zoom_min_hold": {
+ "output_commits": 253,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.33921239462809916,
+ "projection_cpu_avg_ms": 0.025840712809917357,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.12981215702479337,
+ "gpu_elapsed_avg_ms": 0.127420673553719
+ }
+ }
+ }
+ },
+ "s5-b": {
+ "meta": {
+ "commit": "07806c3",
+ "dirty": true,
+ "renderer": "gles2",
+ "kernel": "7.2.9-zen1-1-zen",
+ "cpu": "12th Gen Intel(R) Core(TM) i9-12900H",
+ "pinned_cpus": [
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "render_device": "/dev/dri/renderD128",
+ "seconds": 4.0,
+ "power": {
+ "ac_online": true,
+ "battery": "Not charging",
+ "platform_profile": "performance",
+ "governor": "schedutil",
+ "epp": "performance",
+ "no_turbo": "0"
+ },
+ "date": "2026-10-12 19:43:41"
+ },
+ "clean": {
+ "scale1": {
+ "idle": {
+ "cpu_percent": 0.002,
+ "voluntary_switches_per_s": 0.4,
+ "instructions_per_s": 143,
+ "cycles_per_s": 2351,
+ "rss_kb": 134844,
+ "rss_anon_kb": 45204
+ },
+ "spinner_clear": {
+ "cpu_percent": 7.783,
+ "voluntary_switches_per_s": 189.7,
+ "instructions_per_s": 32581004,
+ "cycles_per_s": 42608366,
+ "rss_kb": 135700,
+ "rss_anon_kb": 45868
+ },
+ "spinner_glass": {
+ "cpu_percent": 8.884,
+ "voluntary_switches_per_s": 187.2,
+ "instructions_per_s": 52741830,
+ "cycles_per_s": 54082562,
+ "rss_kb": 135700,
+ "rss_anon_kb": 45868
+ },
+ "damage_full": {
+ "cpu_percent": 12.316,
+ "voluntary_switches_per_s": 186.7,
+ "instructions_per_s": 56346672,
+ "cycles_per_s": 74377786,
+ "rss_kb": 135700,
+ "rss_anon_kb": 45868
+ },
+ "drag": {
+ "cpu_percent": 7.934,
+ "voluntary_switches_per_s": 161.2,
+ "instructions_per_s": 48408884,
+ "cycles_per_s": 47889374,
+ "rss_kb": 135764,
+ "rss_anon_kb": 45868
+ },
+ "resize": {
+ "cpu_percent": 17.615,
+ "voluntary_switches_per_s": 232.0,
+ "instructions_per_s": 183583230,
+ "cycles_per_s": 126026856,
+ "rss_kb": 135872,
+ "rss_anon_kb": 45976
+ },
+ "fullscreen": {
+ "cpu_percent": 39.548,
+ "voluntary_switches_per_s": 133.0,
+ "instructions_per_s": 44985366,
+ "cycles_per_s": 289608100,
+ "rss_kb": 139752,
+ "rss_anon_kb": 49856
+ },
+ "zoom_85": {
+ "cpu_percent": 9.01,
+ "voluntary_switches_per_s": 187.5,
+ "instructions_per_s": 52414721,
+ "cycles_per_s": 54729459,
+ "rss_kb": 139768,
+ "rss_anon_kb": 49872
+ },
+ "zoom_70": {
+ "cpu_percent": 8.228,
+ "voluntary_switches_per_s": 187.2,
+ "instructions_per_s": 53920449,
+ "cycles_per_s": 52075231,
+ "rss_kb": 139816,
+ "rss_anon_kb": 49920
+ },
+ "zoom_55": {
+ "cpu_percent": 8.471,
+ "voluntary_switches_per_s": 188.0,
+ "instructions_per_s": 52667232,
+ "cycles_per_s": 53532299,
+ "rss_kb": 139824,
+ "rss_anon_kb": 49928
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 7.835,
+ "voluntary_switches_per_s": 193.5,
+ "instructions_per_s": 37341328,
+ "cycles_per_s": 44019601,
+ "rss_kb": 140164,
+ "rss_anon_kb": 50268
+ }
+ },
+ "scale1.5": {
+ "idle": {
+ "cpu_percent": 0.141,
+ "voluntary_switches_per_s": 3.2,
+ "instructions_per_s": 291452,
+ "cycles_per_s": 254132,
+ "rss_kb": 138536,
+ "rss_anon_kb": 49052
+ },
+ "spinner_clear": {
+ "cpu_percent": 7.771,
+ "voluntary_switches_per_s": 189.7,
+ "instructions_per_s": 32763955,
+ "cycles_per_s": 42594047,
+ "rss_kb": 139164,
+ "rss_anon_kb": 49536
+ },
+ "spinner_glass": {
+ "cpu_percent": 8.695,
+ "voluntary_switches_per_s": 187.2,
+ "instructions_per_s": 55539160,
+ "cycles_per_s": 55797134,
+ "rss_kb": 139364,
+ "rss_anon_kb": 49736
+ },
+ "damage_full": {
+ "cpu_percent": 12.694,
+ "voluntary_switches_per_s": 186.0,
+ "instructions_per_s": 63013597,
+ "cycles_per_s": 78349156,
+ "rss_kb": 139364,
+ "rss_anon_kb": 49736
+ },
+ "drag": {
+ "cpu_percent": 8.186,
+ "voluntary_switches_per_s": 161.6,
+ "instructions_per_s": 50176960,
+ "cycles_per_s": 49453986,
+ "rss_kb": 139428,
+ "rss_anon_kb": 49736
+ },
+ "resize": {
+ "cpu_percent": 19.577,
+ "voluntary_switches_per_s": 229.2,
+ "instructions_per_s": 311373244,
+ "cycles_per_s": 170546414,
+ "rss_kb": 140056,
+ "rss_anon_kb": 50364
+ },
+ "fullscreen": {
+ "cpu_percent": 34.407,
+ "voluntary_switches_per_s": 122.2,
+ "instructions_per_s": 47301030,
+ "cycles_per_s": 307560119,
+ "rss_kb": 147916,
+ "rss_anon_kb": 58224
+ },
+ "zoom_85": {
+ "cpu_percent": 8.631,
+ "voluntary_switches_per_s": 187.7,
+ "instructions_per_s": 54710820,
+ "cycles_per_s": 54995794,
+ "rss_kb": 147932,
+ "rss_anon_kb": 58240
+ },
+ "zoom_70": {
+ "cpu_percent": 8.97,
+ "voluntary_switches_per_s": 187.0,
+ "instructions_per_s": 56392004,
+ "cycles_per_s": 55499992,
+ "rss_kb": 147972,
+ "rss_anon_kb": 58280
+ },
+ "zoom_55": {
+ "cpu_percent": 8.677,
+ "voluntary_switches_per_s": 188.0,
+ "instructions_per_s": 54944161,
+ "cycles_per_s": 54134070,
+ "rss_kb": 147980,
+ "rss_anon_kb": 58288
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 7.755,
+ "voluntary_switches_per_s": 188.2,
+ "instructions_per_s": 37469588,
+ "cycles_per_s": 44146189,
+ "rss_kb": 148412,
+ "rss_anon_kb": 58720
+ }
+ },
+ "mixed": {
+ "idle": {
+ "cpu_percent": 0.003,
+ "voluntary_switches_per_s": 0.6,
+ "instructions_per_s": 151,
+ "cycles_per_s": 2008,
+ "rss_kb": 138260,
+ "rss_anon_kb": 48860
+ },
+ "spinner_clear": {
+ "cpu_percent": 8.322,
+ "voluntary_switches_per_s": 248.7,
+ "instructions_per_s": 37311975,
+ "cycles_per_s": 48504483,
+ "rss_kb": 142992,
+ "rss_anon_kb": 53452
+ },
+ "spinner_glass": {
+ "cpu_percent": 9.125,
+ "voluntary_switches_per_s": 245.5,
+ "instructions_per_s": 50686334,
+ "cycles_per_s": 58401535,
+ "rss_kb": 142992,
+ "rss_anon_kb": 53452
+ },
+ "damage_full": {
+ "cpu_percent": 13.079,
+ "voluntary_switches_per_s": 222.7,
+ "instructions_per_s": 55428242,
+ "cycles_per_s": 77172228,
+ "rss_kb": 142992,
+ "rss_anon_kb": 53452
+ },
+ "drag": {
+ "cpu_percent": 9.476,
+ "voluntary_switches_per_s": 176.1,
+ "instructions_per_s": 60234020,
+ "cycles_per_s": 58524159,
+ "rss_kb": 143056,
+ "rss_anon_kb": 53452
+ },
+ "resize": {
+ "cpu_percent": 21.452,
+ "voluntary_switches_per_s": 233.0,
+ "instructions_per_s": 338175292,
+ "cycles_per_s": 190110282,
+ "rss_kb": 143056,
+ "rss_anon_kb": 53452
+ },
+ "fullscreen": {
+ "cpu_percent": 43.007,
+ "voluntary_switches_per_s": 115.7,
+ "instructions_per_s": 79176720,
+ "cycles_per_s": 322997973,
+ "rss_kb": 148040,
+ "rss_anon_kb": 58436
+ },
+ "zoom_85": {
+ "cpu_percent": 9.175,
+ "voluntary_switches_per_s": 246.0,
+ "instructions_per_s": 52824101,
+ "cycles_per_s": 58861832,
+ "rss_kb": 148040,
+ "rss_anon_kb": 58436
+ },
+ "zoom_70": {
+ "cpu_percent": 8.684,
+ "voluntary_switches_per_s": 239.0,
+ "instructions_per_s": 55038136,
+ "cycles_per_s": 57825481,
+ "rss_kb": 148092,
+ "rss_anon_kb": 58488
+ },
+ "zoom_55": {
+ "cpu_percent": 8.558,
+ "voluntary_switches_per_s": 243.0,
+ "instructions_per_s": 55046695,
+ "cycles_per_s": 58311021,
+ "rss_kb": 148100,
+ "rss_anon_kb": 58496
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 8.139,
+ "voluntary_switches_per_s": 242.7,
+ "instructions_per_s": 41607969,
+ "cycles_per_s": 49379250,
+ "rss_kb": 148100,
+ "rss_anon_kb": 58496
+ }
+ },
+ "mixed_noglass": {
+ "idle": {
+ "cpu_percent": 0.002,
+ "voluntary_switches_per_s": 0.4,
+ "instructions_per_s": 151,
+ "cycles_per_s": 1587,
+ "rss_kb": 137476,
+ "rss_anon_kb": 47980
+ },
+ "spinner_clear": {
+ "cpu_percent": 7.933,
+ "voluntary_switches_per_s": 243.2,
+ "instructions_per_s": 35803533,
+ "cycles_per_s": 46989382,
+ "rss_kb": 142208,
+ "rss_anon_kb": 52584
+ },
+ "spinner_glass": {
+ "cpu_percent": 7.953,
+ "voluntary_switches_per_s": 247.2,
+ "instructions_per_s": 38071363,
+ "cycles_per_s": 46847154,
+ "rss_kb": 142208,
+ "rss_anon_kb": 52584
+ },
+ "damage_full": {
+ "cpu_percent": 11.435,
+ "voluntary_switches_per_s": 240.2,
+ "instructions_per_s": 40908220,
+ "cycles_per_s": 68936867,
+ "rss_kb": 142208,
+ "rss_anon_kb": 52584
+ },
+ "drag": {
+ "cpu_percent": 7.148,
+ "voluntary_switches_per_s": 192.0,
+ "instructions_per_s": 40241058,
+ "cycles_per_s": 43935297,
+ "rss_kb": 142272,
+ "rss_anon_kb": 52584
+ },
+ "resize": {
+ "cpu_percent": 19.048,
+ "voluntary_switches_per_s": 193.0,
+ "instructions_per_s": 303547062,
+ "cycles_per_s": 164506206,
+ "rss_kb": 142272,
+ "rss_anon_kb": 52584
+ },
+ "fullscreen": {
+ "cpu_percent": 19.496,
+ "voluntary_switches_per_s": 178.2,
+ "instructions_per_s": 29409252,
+ "cycles_per_s": 169827546,
+ "rss_kb": 146720,
+ "rss_anon_kb": 57032
+ },
+ "zoom_85": {
+ "cpu_percent": 8.032,
+ "voluntary_switches_per_s": 245.5,
+ "instructions_per_s": 38363631,
+ "cycles_per_s": 48565878,
+ "rss_kb": 146976,
+ "rss_anon_kb": 57032
+ },
+ "zoom_70": {
+ "cpu_percent": 8.479,
+ "voluntary_switches_per_s": 244.5,
+ "instructions_per_s": 38541010,
+ "cycles_per_s": 48706822,
+ "rss_kb": 147412,
+ "rss_anon_kb": 57724
+ },
+ "zoom_55": {
+ "cpu_percent": 7.941,
+ "voluntary_switches_per_s": 244.0,
+ "instructions_per_s": 38884661,
+ "cycles_per_s": 47839539,
+ "rss_kb": 147412,
+ "rss_anon_kb": 57724
+ },
+ "zoom_min_hold": {
+ "cpu_percent": 8.183,
+ "voluntary_switches_per_s": 243.0,
+ "instructions_per_s": 39111352,
+ "cycles_per_s": 49795252,
+ "rss_kb": 147412,
+ "rss_anon_kb": 57724
+ }
+ }
+ },
+ "stats": {
+ "scale1": {
+ "idle": {
+ "output_commits": 0,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0,
+ "projection_cpu_avg_ms": 0,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0,
+ "gpu_elapsed_avg_ms": 0
+ },
+ "spinner_clear": {
+ "output_commits": 242,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.4718257479338843,
+ "projection_cpu_avg_ms": 0.03949895041322314,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2230435826446281,
+ "gpu_elapsed_avg_ms": 0.20344480991735536
+ },
+ "spinner_glass": {
+ "output_commits": 239,
+ "glass_reblurs": 239,
+ "cpu_frame_avg_ms": 0.6682396443514644,
+ "projection_cpu_avg_ms": 0.04007462761506276,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4163003556485355,
+ "gpu_elapsed_avg_ms": 0.5167087238493724
+ },
+ "damage_full": {
+ "output_commits": 239,
+ "glass_reblurs": 239,
+ "cpu_frame_avg_ms": 0.7084305732217573,
+ "projection_cpu_avg_ms": 0.04109290376569037,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4494228661087866,
+ "gpu_elapsed_avg_ms": 0.5964528953974896
+ },
+ "drag": {
+ "output_commits": 235,
+ "glass_reblurs": 239,
+ "cpu_frame_avg_ms": 1.1261686144067797,
+ "projection_cpu_avg_ms": 0.1165441186440678,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.6758209110169491,
+ "gpu_elapsed_avg_ms": 0.901869283898305
+ },
+ "resize": {
+ "output_commits": 235,
+ "glass_reblurs": 302,
+ "cpu_frame_avg_ms": 0.9523061191489361,
+ "projection_cpu_avg_ms": 0.2370606255319149,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.5271911957446809,
+ "gpu_elapsed_avg_ms": 0.8110053446808511
+ },
+ "fullscreen": {
+ "output_commits": 119,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3206877088607595,
+ "projection_cpu_avg_ms": 0.025554767932489453,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.15328265400843882,
+ "gpu_elapsed_avg_ms": 0.3322202573839662
+ },
+ "zoom_85": {
+ "output_commits": 240,
+ "glass_reblurs": 253,
+ "cpu_frame_avg_ms": 0.6374082249999999,
+ "projection_cpu_avg_ms": 0.03975564166666667,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.3953511041666667,
+ "gpu_elapsed_avg_ms": 0.4945136875
+ },
+ "zoom_70": {
+ "output_commits": 240,
+ "glass_reblurs": 252,
+ "cpu_frame_avg_ms": 0.6538220916666667,
+ "projection_cpu_avg_ms": 0.037962075,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4097533875,
+ "gpu_elapsed_avg_ms": 0.5022228583333334
+ },
+ "zoom_55": {
+ "output_commits": 239,
+ "glass_reblurs": 252,
+ "cpu_frame_avg_ms": 0.6972097531380753,
+ "projection_cpu_avg_ms": 0.041712347280334724,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.42987902092050206,
+ "gpu_elapsed_avg_ms": 0.5084026150627615
+ },
+ "zoom_min_hold": {
+ "output_commits": 241,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.5453183817427385,
+ "projection_cpu_avg_ms": 0.04250292946058091,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2657776680497925,
+ "gpu_elapsed_avg_ms": 0.25653159336099585
+ }
+ },
+ "scale1.5": {
+ "idle": {
+ "output_commits": 1,
+ "glass_reblurs": 1,
+ "cpu_frame_avg_ms": 1.1506815,
+ "projection_cpu_avg_ms": 0.0368195,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.363032,
+ "gpu_elapsed_avg_ms": 0.7497655
+ },
+ "spinner_clear": {
+ "output_commits": 242,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.45797253305785124,
+ "projection_cpu_avg_ms": 0.03992035537190083,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2179926652892562,
+ "gpu_elapsed_avg_ms": 0.1955673388429752
+ },
+ "spinner_glass": {
+ "output_commits": 239,
+ "glass_reblurs": 239,
+ "cpu_frame_avg_ms": 0.6692997364016736,
+ "projection_cpu_avg_ms": 0.03934518410041841,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.43001585774058576,
+ "gpu_elapsed_avg_ms": 0.55979469874477
+ },
+ "damage_full": {
+ "output_commits": 238,
+ "glass_reblurs": 238,
+ "cpu_frame_avg_ms": 0.7686343991596638,
+ "projection_cpu_avg_ms": 0.04367994117647059,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.507516231092437,
+ "gpu_elapsed_avg_ms": 0.7334561302521009
+ },
+ "drag": {
+ "output_commits": 234,
+ "glass_reblurs": 238,
+ "cpu_frame_avg_ms": 1.1694368042553192,
+ "projection_cpu_avg_ms": 0.1276772510638298,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.6966903829787234,
+ "gpu_elapsed_avg_ms": 1.0758342127659575
+ },
+ "resize": {
+ "output_commits": 236,
+ "glass_reblurs": 300,
+ "cpu_frame_avg_ms": 0.9321069491525424,
+ "projection_cpu_avg_ms": 0.2255046906779661,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.5225628305084745,
+ "gpu_elapsed_avg_ms": 0.9782962923728813
+ },
+ "fullscreen": {
+ "output_commits": 120,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.327812253164557,
+ "projection_cpu_avg_ms": 0.026985556962025314,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.15850730379746836,
+ "gpu_elapsed_avg_ms": 0.5088745738396624
+ },
+ "zoom_85": {
+ "output_commits": 239,
+ "glass_reblurs": 252,
+ "cpu_frame_avg_ms": 0.7098632970711297,
+ "projection_cpu_avg_ms": 0.041562309623430965,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.44506770292887027,
+ "gpu_elapsed_avg_ms": 0.5633665062761506
+ },
+ "zoom_70": {
+ "output_commits": 239,
+ "glass_reblurs": 252,
+ "cpu_frame_avg_ms": 0.7075415648535565,
+ "projection_cpu_avg_ms": 0.04320457740585774,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.44582723849372385,
+ "gpu_elapsed_avg_ms": 0.5438430794979079
+ },
+ "zoom_55": {
+ "output_commits": 239,
+ "glass_reblurs": 252,
+ "cpu_frame_avg_ms": 0.661339610878661,
+ "projection_cpu_avg_ms": 0.03991593723849372,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.4163370836820084,
+ "gpu_elapsed_avg_ms": 0.5041734895397489
+ },
+ "zoom_min_hold": {
+ "output_commits": 242,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.5224143057851239,
+ "projection_cpu_avg_ms": 0.040417615702479336,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.25720453305785124,
+ "gpu_elapsed_avg_ms": 0.2492534090909091
+ }
+ },
+ "mixed": {
+ "idle": {
+ "output_commits": 0,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0,
+ "projection_cpu_avg_ms": 0,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0,
+ "gpu_elapsed_avg_ms": 0
+ },
+ "spinner_clear": {
+ "output_commits": 243,
+ "glass_reblurs": 2,
+ "cpu_frame_avg_ms": 0.34223190683229815,
+ "projection_cpu_avg_ms": 0.034704952380952385,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.12114148033126294,
+ "gpu_elapsed_avg_ms": 0.1232546149068323
+ },
+ "spinner_glass": {
+ "output_commits": 240,
+ "glass_reblurs": 240,
+ "cpu_frame_avg_ms": 0.36824944374999996,
+ "projection_cpu_avg_ms": 0.02962568125,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.19236110416666666,
+ "gpu_elapsed_avg_ms": 0.24975257708333334
+ },
+ "damage_full": {
+ "output_commits": 240,
+ "glass_reblurs": 240,
+ "cpu_frame_avg_ms": 0.39036623076923077,
+ "projection_cpu_avg_ms": 0.03002182952182952,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.20912148232848232,
+ "gpu_elapsed_avg_ms": 0.28580194178794177
+ },
+ "drag": {
+ "output_commits": 478,
+ "glass_reblurs": 403,
+ "cpu_frame_avg_ms": 0.6913420166666667,
+ "projection_cpu_avg_ms": 0.08087232916666666,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.38119641041666663,
+ "gpu_elapsed_avg_ms": 0.5267842604166666
+ },
+ "resize": {
+ "output_commits": 474,
+ "glass_reblurs": 653,
+ "cpu_frame_avg_ms": 0.5956821244725738,
+ "projection_cpu_avg_ms": 0.12587728481012658,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.355180246835443,
+ "gpu_elapsed_avg_ms": 0.4912878037974684
+ },
+ "fullscreen": {
+ "output_commits": 442,
+ "glass_reblurs": 442,
+ "cpu_frame_avg_ms": 0.3483801018099547,
+ "projection_cpu_avg_ms": 0.02221510407239819,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.24248043438914027,
+ "gpu_elapsed_avg_ms": 0.49054038461538463
+ },
+ "zoom_85": {
+ "output_commits": 252,
+ "glass_reblurs": 264,
+ "cpu_frame_avg_ms": 0.378357711018711,
+ "projection_cpu_avg_ms": 0.029113856548856547,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.20025082120582122,
+ "gpu_elapsed_avg_ms": 0.2544440997920998
+ },
+ "zoom_70": {
+ "output_commits": 240,
+ "glass_reblurs": 249,
+ "cpu_frame_avg_ms": 0.38427594374999996,
+ "projection_cpu_avg_ms": 0.02694409375,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.21299441041666667,
+ "gpu_elapsed_avg_ms": 0.26929155208333333
+ },
+ "zoom_55": {
+ "output_commits": 240,
+ "glass_reblurs": 253,
+ "cpu_frame_avg_ms": 0.37575326666666664,
+ "projection_cpu_avg_ms": 0.029057452083333334,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.20360165625,
+ "gpu_elapsed_avg_ms": 0.25554022916666663
+ },
+ "zoom_min_hold": {
+ "output_commits": 250,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.343761398340249,
+ "projection_cpu_avg_ms": 0.030736176348547715,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.13459403734439832,
+ "gpu_elapsed_avg_ms": 0.13882813692946055
+ }
+ },
+ "mixed_noglass": {
+ "idle": {
+ "output_commits": 0,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0,
+ "projection_cpu_avg_ms": 0,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0,
+ "gpu_elapsed_avg_ms": 0
+ },
+ "spinner_clear": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.28921288636363635,
+ "projection_cpu_avg_ms": 0.026759010330578512,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.10365011363636363,
+ "gpu_elapsed_avg_ms": 0.09677202892561983
+ },
+ "spinner_glass": {
+ "output_commits": 244,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3083396128364389,
+ "projection_cpu_avg_ms": 0.028899985507246376,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.11205454658385093,
+ "gpu_elapsed_avg_ms": 0.11045697722567288
+ },
+ "damage_full": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3092466314699793,
+ "projection_cpu_avg_ms": 0.028545956521739132,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.11780619875776398,
+ "gpu_elapsed_avg_ms": 0.14151793995859213
+ },
+ "drag": {
+ "output_commits": 482,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.49912269421487604,
+ "projection_cpu_avg_ms": 0.07445066322314049,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.2112389070247934,
+ "gpu_elapsed_avg_ms": 0.3002722417355372
+ },
+ "resize": {
+ "output_commits": 480,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3841743375,
+ "projection_cpu_avg_ms": 0.10805001041666668,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.18849255208333335,
+ "gpu_elapsed_avg_ms": 0.24619911458333335
+ },
+ "fullscreen": {
+ "output_commits": 478,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.24192800416666668,
+ "projection_cpu_avg_ms": 0.019146589583333335,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.1396608,
+ "gpu_elapsed_avg_ms": 0.2371037125
+ },
+ "zoom_85": {
+ "output_commits": 254,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3415190518672199,
+ "projection_cpu_avg_ms": 0.03275798132780083,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.12559265975103734,
+ "gpu_elapsed_avg_ms": 0.12699029875518672
+ },
+ "zoom_70": {
+ "output_commits": 243,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.3205200041407868,
+ "projection_cpu_avg_ms": 0.02986333540372671,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.1201483685300207,
+ "gpu_elapsed_avg_ms": 0.12021838716356106
+ },
+ "zoom_55": {
+ "output_commits": 242,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.32088109128630704,
+ "projection_cpu_avg_ms": 0.030230014522821577,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.12116221161825727,
+ "gpu_elapsed_avg_ms": 0.12314771784232365
+ },
+ "zoom_min_hold": {
+ "output_commits": 251,
+ "glass_reblurs": 0,
+ "cpu_frame_avg_ms": 0.2912512111801242,
+ "projection_cpu_avg_ms": 0.025772590062111803,
+ "glass_cpu_avg_ms": 0,
+ "scene_commit_cpu_avg_ms": 0.10979878260869565,
+ "gpu_elapsed_avg_ms": 0.10917290269151139
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/docs/plans/scene-graph-stage6.md b/docs/plans/scene-graph-stage6.md
index fc9e7bc..30b9bc7 100644
--- a/docs/plans/scene-graph-stage6.md
+++ b/docs/plans/scene-graph-stage6.md
@@ -1,10 +1,11 @@
# Scene graph plan, stage 6: one tree
-Status: **planned, D1 to D4 taken (all as recommended), nothing implemented**, 2026-10-11. Stages 0 to 5 of
+Status: **6a to 6e done (6a to 6d 2026-10-11, the cost gate 2026-10-12)**, and
+nothing committed. D1 to D4 taken as recommended. Stages 0 to 5 of
[scene-graph.md](scene-graph.md) are done: the owned output pass is the only
presenter and draws window shapes, shadows and glass from the typed graph. This
stage removes the last mirror: the projection's **view tree**, a second copy of
-every window's scene nodes that no longer draws anything but still carries hit
+every window's scene nodes that no longer draws anything but still carried hit
testing, damage and surface feedback. The source scene tree stays as the surface
adapter (the master plan keeps replacing it for a later, separate decision).
@@ -161,3 +162,110 @@ once, after 6e.
in paint order must keep matching it.
* **Pointer constraints, tablets, touch and drag-and-drop** all go through
`hitTest`; one path keeps them consistent, and their suites run in 6c.
+
+## What was built (2026-10-11)
+
+The sub-stages ran in the order 6a, 6c, 6b, 6d: 6b is only testable once nothing
+else reads the views, so the view tree was disabled for it (the screen's damage
+then comes from the graph alone) and deleted afterwards.
+
+* **6a, feedback.** `rediwm_projection_feedback_begin/note/end` (`projection.c`),
+ called from the pass's `collect`: per build, the pixels of each client surface
+ that nothing above hides, over *every* output (a per-output tally flapped
+ through "visible nowhere" when a window moved between outputs, because the
+ other output's figure was stale). wlroots' rule is applied as it is in
+ `scene.c`: an output is active above a tenth of the visible area, the primary
+ one shows most, `outputs_update` is re-sent when an active output's scale,
+ transform or subpixel changed (without that a live scale reload never reached
+ the client). Signals go out on the *source* buffer, so `wlr_scene_surface`
+ listens where it was built to; frame callbacks go through `Server.sendFrameDone`
+ (the source buffers have no `visible` region, so wlroots' own
+ `wlr_scene_buffer_send_frame_done` would stay silent). D4's comparison with the
+ views' own state ran in Debug until it agreed on every suite.
+* **6c, hit testing.** `rediwm_projection_node_at`: the world's items top to
+ bottom (rounded box, window shape, the source buffer's input region), the
+ layout trees through `wlr_scene_node_at`. Compared with the view tree over a
+ sweep of 6000 points per configuration (zoom steps 100 to 55 %, scales 1 and
+ 1.5, one and two outputs) before the views went.
+* **6b, damage.** Every change goes through `damage_box` into one pending region
+ that is applied to all outputs once per sync. What changes only what a leaf
+ shows is cut to what of it was visible at the last build, as wlroots cut it to a
+ node's visible region (otherwise a blinking cursor in a hidden terminal flips
+ the output); a restack damages what moved (`damage_restacked`: the leaves
+ outside the longest run that kept its order), shadow footprints included; a
+ destroyed window or node applies at once, because a capture can build a frame
+ before the next sync. D4's comparison was a **damage audit**: after each frame
+ the same entries are drawn whole into a private buffer and compared with the
+ real one. It found four bugs the suites did not (a closed window's group
+ damaged nothing; a restacked window's shadow was not damaged; `paints` read the
+ source buffer pointer, which GLES2 clears after upload, so a leaf stopped
+ counting as shown; buffer damage went out as one bounding box). It stays as
+ `-Ddamage-audit` (`TESTING.md`).
+* **6d, the views are gone.** `view_state`, `route_surface`, the lock marking,
+ `rediwm_projection_node/source/node_zoom`, the group view trees and
+ `Server`'s `world_view` are deleted; the pass reads buffers, textures, wait
+ points and opaque regions from the source nodes (`rediwm_mirror_opaque` moved
+ to `projection.c`). `projection_test.c` and `glass_test.c` test the graph,
+ with new cases for restack, the visibility cut, destroy damage and the
+ feedback sets (two outputs, the 10 % rule, a scale change); `output_scale.py`
+ now also checks `wl_surface.enter/leave` and a window spanning the seam.
+* **Left out, as planned:** D5 (per-surface dmabuf feedback).
+
+## Results
+
+* `zig build test` 786 of 786, `test-projection`, `test-glass` pass.
+* About 60 integration suites against HEAD: every suite that fails on the tree
+ fails on HEAD too (`screencast`, `glass_hold`, `desktop_zoom`, `taskbar_peek`,
+ `mini_map`, `mini_map_canvas`, `wlr_protocols`, `animations`, `switcher`,
+ `start_menu`, `window_titles`, `desktop_icons`, `desktop_canvas`, `power_menu`);
+ `window_corners` and `xwayland` flake on HEAD as well. The damage audit is clean
+ on the window, focus, snapping, tab, decoration, minimap, lock, layer, input,
+ scale and damage suites. The `capture` suite shows a few corner pixels that
+ predate this stage: isolated captures build into swapchain buffers they never
+ submit, which upsets buffer age (worth fixing separately).
+* **Known limit:** a layer-shell surface *below* the world (background or bottom
+ layer) is no longer occluded by windows in wlroots' eyes, so it keeps getting
+ frame callbacks, and damage, while a window covers it. Everything above the
+ world, and the world itself, is unaffected.
+* **Cost gate (6e)** (`scene-graph-stage6-cost.json`): ReleaseSafe builds of
+ stage 5 (07806c3, the commit before this stage) and of the tree, interleaved
+ s5, s6, s6, s5 with `tests/scene_baseline.py` on AC power in the performance
+ profile (every session recorded both unchanged). Cells are the mean of each
+ pair; the spread between the two runs of one build is the noise floor.
+ * **Projection CPU: lower**, as expected. `projection_cpu` is -21 % in the
+ median cell and in no cell above its pair spread; `resize` -78 to -83 % (the
+ old view setters), `drag` -30 to -48 % (a noisy cell), glass cells -10 to
+ -35 %.
+ * **Output build and whole frame: level.** `cpu_frame` has a median of -1 %;
+ the one rise beyond its spread is scale 1 `zoom_70` (+8 %, spread 6 %).
+ `scene_commit_cpu` has a median of +2 % (the visibility tally): +7 to +11 % in
+ scale 1 `zoom_85` and `zoom_70` and +9 % in mixed_noglass `spinner_clear`,
+ each barely past a spread of 7 to 9 %. `gpu_elapsed` is within its spreads
+ except scale 1 `zoom_85` (+5 %, spread 3 %). `glass_reblurs` per commit is
+ unchanged in every cell outside mixed `fullscreen`, below.
+ * **Instructions (clean sessions): level or lower.** Median 0 %; `resize` -6 to
+ -11 %, `drag` -2 to -6 %. The only rises are `zoom_min_hold` at scale 1.5 and
+ mixed (+4 % and +3 %, both pairs agree to the digit, about 7 k instructions
+ per frame); the frame timers of the same cells do not show it, and its cause
+ was not chased. Against stage 0 (the numbers in the stage 5 gate, a different
+ session) every cell stays below it, -2 to -61 %.
+ * **Memory: level, not lower.** The first pair read -0.4 to -1.1 MiB at scales
+ 1 and 1.5 and +0.4 to +1.1 mixed; six more start-up and sustained runs of
+ each build (three more runs of each, scale 1.5 and mixed, AC off, memory
+ only) put the stage 6 mean at
+ +0.0 to +0.3 MiB, inside the 0.8 MiB spread of one build between runs. The
+ scene node and buffer removed per leaf are too small to read next to that.
+ Still +0.8 to +2.5 MiB over stage 0, as after stage 5.
+ * **Wakeups unchanged:** switches per second are within ±4 % in the cells that
+ do not flake (`fullscreen` and `resize` vary 5 to 35 % between runs of one
+ build; mixed `zoom_55` reads -7 %); idle shows 0.0 % CPU in every config.
+ * **Mixed `fullscreen`** commits about half as often and re-blurs nothing:
+ stage 5 committed 442 to 464 times in the cell and re-blurred under every
+ commit, the tree 119 to 237 times and never. The cause was not isolated
+ (stage 5's view damage reaching the output the client is not on is the likely
+ one); the audit build run over the stats-mode workload (scale 1, 1.5, mixed)
+ is silent, so no damage is missing.
+ * **Pixels:** the 16 golden screenshots (scale 1, 1.5 and mixed, windows,
+ zoom 70, zoom min and fullscreen) of the tree equal stage 5's at tolerance
+ 0. They differ from the stage 0 goldens exactly as stage 5 does (window
+ shapes, shadows and glass since stage 4).
diff --git a/docs/plans/scene-graph.md b/docs/plans/scene-graph.md
index 728d4cc..f65b947 100644
--- a/docs/plans/scene-graph.md
+++ b/docs/plans/scene-graph.md
@@ -162,12 +162,13 @@ environment variable: no test hooks in production), removed in stage 6.
[scene-graph-stage5.md](scene-graph-stage5.md).* Delete `glass.c`'s prefix capture,
per-effect contexts, dependency hashing and the drag hold; keep glass pixel
tests, converted.
-6. **Delete.** *Planned 2026-10-11, D1 to D4 taken:
+6. **Delete.** *Done 2026-10-12 (projection CPU -21 % median, instructions and
+ memory level with stage 5, pixels identical, uncommitted):
[scene-graph-stage6.md](scene-graph-stage6.md); the legacy presenter and the
- temporary config key already went in stage 4e.* `wlr_scene` output rendering, the projection view tree, the
- legacy presenter and the temporary config key. Update `AGENTS.md`
- (rendering and damage rules, the two-border-path and skirt notes),
- `TESTING.md` and the area notes.
+ temporary config key already went in stage 4e.* The projection's view tree is
+ gone: surface feedback, damage and hit testing come from the graph, and the
+ pass reads the source nodes. Updated `AGENTS.md` (rendering and damage rules),
+ `TESTING.md` (the damage audit) and the tests.
The old wlr_scene source tree stays as the surface adapter until a separate,
later decision; replacing it is not part of this plan.
diff --git a/src/Output.zig b/src/Output.zig
index 3feae9e..b6b3780 100644
--- a/src/Output.zig
+++ b/src/Output.zig
@@ -1151,7 +1151,7 @@ fn handleVblank(output: *Output) c_int {
fn sendFrameDone(output: *Output) void {
if (output.server.scene.getSceneOutput(output.wlr_output)) |scene_output| {
var now = timestamp();
- scene_output.sendFrameDone(&now);
+ output.server.sendFrameDone(scene_output, &now);
}
var preview_time = timestamp();
output.server.switcher.frameDone(output, &preview_time);
@@ -1336,7 +1336,7 @@ fn runFrame(output: *Output) void {
}
if (!deferred) {
var now = timestamp();
- scene_output.sendFrameDone(&now);
+ output.server.sendFrameDone(scene_output, &now);
}
}
if (deferred) {
diff --git a/src/Server.zig b/src/Server.zig
index ce5d885..71a6acd 100644
--- a/src/Server.zig
+++ b/src/Server.zig
@@ -360,7 +360,8 @@ pub fn init(server: *Server, scale: ?f32, icon_theme_cfg: icon_theme.Config, io:
const scene = wlr.Scene.create() catch return error.SceneCreateFailed;
errdefer scene.tree.node.destroy();
- // The world source tree stays disabled: projection renders its copies.
+ // The world source tree stays disabled: wlroots ignores it, and the projection
+ // resolves it into the graph the output pass draws.
// wlroots would lower each mapped X11 source as if it were hidden,
// undoing our raise after the map listener runs. Toplevel owns X11
// stacking alongside its scene ordering instead.
@@ -370,7 +371,6 @@ pub fn init(server: *Server, scale: ?f32, icon_theme_cfg: icon_theme.Config, io:
const desktop_tree = scene.tree.createSceneTree() catch return error.SceneCreateFailed;
const world_tree = scene.tree.createSceneTree() catch return error.SceneCreateFailed;
const world_desktop_tree = world_tree.createSceneTree() catch return error.SceneCreateFailed;
- const world_view = scene.tree.createSceneTree() catch return error.SceneCreateFailed;
const taskbar_tree = scene.tree.createSceneTree() catch return error.SceneCreateFailed;
const overlay_tree = scene.tree.createSceneTree() catch return error.SceneCreateFailed;
const ime_tree = scene.tree.createSceneTree() catch return error.SceneCreateFailed;
@@ -483,7 +483,7 @@ pub fn init(server: *Server, scale: ?f32, icon_theme_cfg: icon_theme.Config, io:
}
server.outputs.init();
server.layer_surfaces.init();
- try server.world.init(server, world_tree, world_view);
+ try server.world.init(server, world_tree);
errdefer server.world.deinit();
try server.shell.init(server);
errdefer server.shell.deinit();
@@ -1062,6 +1062,13 @@ pub fn buildOutputState(server: *Server, output: *wlr.SceneOutput, state: *wlr.O
return server.output_renderer.buildState(server.world.projection, output, state);
}
+/// Frame callbacks for everything the output shows: the layout trees through
+/// wlroots, the world's surfaces from the graph.
+pub fn sendFrameDone(server: *Server, output: *wlr.SceneOutput, now: *std.posix.timespec) void {
+ output.sendFrameDone(now);
+ server.world.projection.sendFrameDone(output, now);
+}
+
pub fn beginRenderPass(server: *Server, buffer: *wlr.Buffer, options: ?*const wlr.Renderer.BufferPassOptions) !*wlr.RenderPass {
return server.output_renderer.beginPass(buffer, options) orelse error.RenderPassFailed;
}
diff --git a/src/World.zig b/src/World.zig
index 2c651f9..1e494a6 100644
--- a/src/World.zig
+++ b/src/World.zig
@@ -53,11 +53,11 @@ vel_z: anim.VelocityTracker = .{},
/// Last chip selected during the current Super hold; IDs survive window teardown safely.
peek_window_id: ?u64 = null,
-pub fn init(world: *World, server: *Server, tree: *wlr.SceneTree, view: *wlr.SceneTree) !void {
+pub fn init(world: *World, server: *Server, tree: *wlr.SceneTree) !void {
world.* = .{
.server = server,
.tree = tree,
- .projection = Projection.create(tree, view, server.scene) orelse return error.SceneCreateFailed,
+ .projection = Projection.create(tree, server.scene) orelse return error.SceneCreateFailed,
};
world.toplevels.init();
world.closing.init();
diff --git a/src/glass_test.c b/src/glass_test.c
index 25828ea..378b968 100644
--- a/src/glass_test.c
+++ b/src/glass_test.c
@@ -94,24 +94,25 @@ static bool projection_input(struct wlr_scene_buffer *buffer, double *x, double
*x += 7; *y += 9;
return true;
}
-struct items { struct rediwm_item effect, target; };
+struct items { struct rediwm_item effect, target, client; };
+static struct wlr_scene_node *client_node;
static bool find_items(const struct rediwm_item *item, struct wlr_scene_node *transport, void *data) {
struct items *found = data;
- struct wlr_scene_node *source = rediwm_projection_source(transport);
if (item->kind == REDIWM_ITEM_EFFECT) found->effect = *item;
- else if (source->type == WLR_SCENE_NODE_BUFFER && !wlr_scene_buffer_from_node(source)->buffer &&
+ else if (transport == client_node) found->client = *item;
+ else if (transport->type == WLR_SCENE_NODE_BUFFER && !wlr_scene_buffer_from_node(transport)->buffer &&
item->width == 200) found->target = *item;
return true;
}
static void projection_checks(struct wlr_scene *scene, struct glass_engine *engine) {
struct wlr_scene_tree *source = wlr_scene_tree_create(&scene->tree);
- struct wlr_scene_tree *view = wlr_scene_tree_create(&scene->tree);
- struct rediwm_projection *p = rediwm_projection_create(source, view, scene);
+ struct rediwm_projection *p = rediwm_projection_create(source, scene);
assert(p);
struct wlr_scene_tree *frame = wlr_scene_tree_create(source);
wlr_scene_node_set_position(&frame->node, 101, 51);
struct test_buffer *image = buffer_create(400, 260);
struct wlr_scene_buffer *client = wlr_scene_buffer_create(frame, &image->base);
+ client_node = &client->node;
wlr_buffer_drop(&image->base);
wlr_scene_buffer_set_source_box(client, &(struct wlr_fbox){10, 10, 380, 240});
wlr_scene_buffer_set_dest_size(client, 400, 260);
@@ -123,23 +124,23 @@ static void projection_checks(struct wlr_scene *scene, struct glass_engine *engi
for (size_t i = 0; i < sizeof(levels)/sizeof(levels[0]); i++) {
double z = levels[i];
rediwm_projection_sync(p, z, -20, -30, 0, 0);
- struct wlr_scene_node *displayed = rediwm_projection_node(p, &client->node);
- assert(displayed && rediwm_projection_source(displayed) == &client->node);
- struct wlr_scene_buffer *buffer = wlr_scene_buffer_from_node(displayed);
- int displayed_x, displayed_y;
- assert(wlr_scene_node_coords(displayed, &displayed_x, &displayed_y));
- assert(displayed_x == lround(121*z) && displayed_y == lround(81*z));
- assert(buffer->dst_width == lround(121*z+400*wz*z) - lround(121*z));
- assert(fabs(rediwm_projection_node_zoom(displayed) - wz*z) < .0001);
- assert(buffer->src_box.x == 10 && buffer->src_box.width == 380);
+ struct items found = {0};
+ rediwm_projection_for_each_item(p, false, find_items, &found);
+ const struct rediwm_item *shown = &found.client;
+ assert(shown->kind == REDIWM_ITEM_BUFFER);
+ const struct rediwm_snap snap = rediwm_edges_snap(shown->edges);
+ assert(snap.x == lround(121*z) && snap.y == lround(81*z));
+ assert(snap.width == lround(121*z+400*wz*z) - lround(121*z));
+ assert(fabs(shown->scale - wz*z) < .0001);
+ assert(shown->content.src_box.x == 10 && shown->content.src_box.width == 380);
assert(frame->node.x == 101 && frame->node.y == 51);
assert(client->dst_width == 400 && client->dst_height == 260);
double x, y;
- struct wlr_scene_node *hit = wlr_scene_node_at(&view->node,
- displayed_x + buffer->dst_width * .5, displayed_y + buffer->dst_height * .5, &x, &y);
- assert(hit == displayed);
+ struct wlr_scene_node *hit = rediwm_projection_node_at(p,
+ snap.x + snap.width * .5, snap.y + snap.height * .5, &x, &y);
+ assert(hit == &client->node);
assert(fabs(x - 207) < .0001 && fabs(y - 139) < .0001);
- assert(!wlr_scene_node_at(&view->node, displayed_x + 1, displayed_y + 1, &x, &y));
+ assert(!rediwm_projection_node_at(p, snap.x + 1, snap.y + 1, &x, &y));
}
}
// An effect has its target's box at every zoom, and is shown only with it.
@@ -163,12 +164,13 @@ static void projection_checks(struct wlr_scene *scene, struct glass_engine *engi
struct items hidden = {0};
rediwm_projection_for_each_item(p, false, find_items, &hidden);
assert(hidden.effect.kind != REDIWM_ITEM_EFFECT);
- // Source destruction tears down all mirrors, including effects.
+ // Source destruction tears down the graph's items, including effects.
wlr_scene_node_destroy(&frame->node);
- assert(wl_list_empty(&view->children));
+ struct items gone = {0};
+ rediwm_projection_for_each_item(p, false, find_items, &gone);
+ assert(gone.client.width == 0 && gone.effect.kind != REDIWM_ITEM_EFFECT);
rediwm_projection_destroy(p);
wlr_scene_node_destroy(&source->node);
- wlr_scene_node_destroy(&view->node);
fputs("PASS: projection geometry, input, glass geometry and destruction\n", stderr);
}
int main(void)
diff --git a/src/mini_map.zig b/src/mini_map.zig
index 7090fbe..bb0f072 100644
--- a/src/mini_map.zig
+++ b/src/mini_map.zig
@@ -241,7 +241,7 @@ pub fn tick(self: *Self, output: *Output, now: i64) bool {
if (!self.dragging) {
var sx: f64 = 0;
var sy: f64 = 0;
- const picked = server.scene.tree.node.at(server.input.cursor.x, server.input.cursor.y, &sx, &sy);
+ const picked = server.world.projection.nodeAt(server.input.cursor.x, server.input.cursor.y, &sx, &sy);
self.hovered = server.input.cursor_mode == .passthrough and server.input.active_buttons == 0 and
picked != null and SceneData.fromNode(picked.?) == &self.scene_data;
}
diff --git a/src/projection.c b/src/projection.c
index 1637d6b..b2482ae 100644
--- a/src/projection.c
+++ b/src/projection.c
@@ -17,10 +17,11 @@
// Two halves, joined by the typed graph of scene_graph.h. resolve() walks the
// source tree and writes `item`s and group origins, in paint order, into the
-// lists below; it touches no view node. present() reads only that graph (and the
-// content the source still owns: buffers, wait points, opaque regions), rounds,
-// and applies the result to the view tree. The graph is the one place geometry
-// is computed; present() may not derive any of its own.
+// lists below. present() reads only that graph (and the content the source still
+// owns: buffers and their damage), rounds, and turns what changed into damage
+// events and screen damage. The graph is the one place geometry is computed;
+// present() may not derive any of its own. The output pass, hit testing and the
+// surface feedback all read the graph too: there is no second tree of the world.
// Damage events: which leaf changed which layout-space box, for consumers that
// must tell what lies below a point in paint order from what lies above it
// (backdrop effects, stage 5 of docs/plans/scene-graph.md). A ring: each consumer
@@ -28,54 +29,48 @@
// told so and must treat everything as changed.
enum { DAMAGE_EVENTS = 4096 };
struct rediwm_projection {
- struct wlr_scene_tree *source, *view;
+ struct wlr_scene_tree *source;
struct wlr_scene *scene;
// Every adapter, in creation order; `paint` holds the groups resolve() last
// reached, bottom to top.
struct wl_list leaves, groups, paint;
+ // The surface leaves whose outputs the output pass reports (stage 6), and what
+ // each output (by scene output index) looked like at the last report.
+ struct wl_list feedback;
+ struct {
+ float scale;
+ enum wl_output_transform transform;
+ enum wl_output_subpixel subpixel;
+ bool known;
+ } shown_output[64];
+ // The outputs whose scale, transform or subpixel order changed since: a surface
+ // on them is told again even where nothing else changed, as wlroots does, for
+ // its preferred scale.
+ uint64_t forced;
struct wl_listener new_surface;
struct wl_list surfaces;
uint64_t next_leaf_id;
+ // Layout-space damage the sync in progress collects, applied to every output
+ // when it ends (stage 6b).
+ pixman_region32_t pending;
struct rediwm_damage_event events[DAMAGE_EVENTS];
uint64_t next_event; // sequence number of the next event; 0 is never used
};
-// Source top-level subtrees are contiguous in paint order. Moving their
-// presentation tree updates wlroots visibility once for the whole window,
-// instead of once for every titlebar, border, client and shadow leaf.
+// Source top-level subtrees are contiguous in paint order: each is a group, and
+// a window going away damages everything its leaves showed at once.
struct group {
struct wl_list link;
// In projection->paint, or alone, when the last resolve() did not reach it.
struct wl_list paint;
// The leaves resolve() last reached under this group, bottom to top.
struct wl_list items;
- // The group's origin in layout space, unrounded; resolved from the source.
- double x, y;
bool enabled;
struct rediwm_projection *projection;
struct wlr_scene_node *source;
- struct wlr_scene_tree *view;
struct wl_listener destroy;
- struct wlr_addon source_lookup, view_lookup;
+ struct wlr_addon source_lookup;
bool seen;
};
-// Everything present() last applied to a view node: the rounded rectangle, the
-// content and what the view's buffer reported about itself. Nothing else writes
-// to non-glass views, so an unchanged state skips a dozen setter calls and an
-// opaque-region rebuild per leaf on every sync (every frame after a commit).
-struct view_state {
- int x, y, width, height;
- bool enabled, opaque;
- // Hash of the source's opaque region as mirrored onto the view.
- uint64_t opaque_hash;
- struct rediwm_content content;
-};
-static bool view_state_equal(const struct view_state *a,
- const struct view_state *b) {
- return a->x == b->x && a->y == b->y && a->width == b->width &&
- a->height == b->height && a->enabled == b->enabled &&
- a->opaque == b->opaque && a->opaque_hash == b->opaque_hash &&
- rediwm_content_equal(&a->content, &b->content);
-}
// A list link that is always valid to remove: alone, or in a live list.
static void detach(struct wl_list *link) {
wl_list_remove(link);
@@ -86,17 +81,18 @@ struct leaf {
// In its group's `items` when the last resolve() reached it, else alone.
struct wl_list paint;
struct rediwm_projection *projection;
- struct wlr_scene_node *source, *view;
+ struct wlr_scene_node *source;
struct wl_listener destroy, commit;
- struct wlr_addon lookup, source_lookup;
+ struct wlr_addon source_lookup;
struct wlr_scene_surface *surface;
+ struct feedback *feedback;
bool dirty, seen;
// Commits can outpace presentation. Keep their union, including empty damage
// on a rotated buffer; buffer identity is not evidence of changed pixels.
pixman_region32_t damage;
bool full_damage;
// A compositor-owned buffer reported its own damage since the last sync;
- // without a report a replaced buffer damages its whole view.
+ // without a report a replaced buffer damages its whole box.
bool owned_damage;
int damage_width, damage_height;
// The graph's view of this leaf, rewritten by every resolve(). `item.clip`
@@ -104,22 +100,26 @@ struct leaf {
struct rediwm_item item;
struct rediwm_clip clip;
// `item.shadow` points at `shadow` when the leaf is under a shadow tree. A
- // shadow's view has no buffer, so wlroots damages nothing for it: present()
- // damages the footprint it last drew (`shadow_drawn`) and the new one.
+ // shadow has no buffer to damage: present() damages the footprint it last drew
+ // (`shadow_drawn`) and the new one.
struct rediwm_shadow shadow;
// The box present() last showed the leaf in, for its damage events.
struct rediwm_snap shown;
struct rediwm_content shown_content;
bool has_shown;
+ // What of the leaf nothing above hid when the output pass last built, over the
+ // whole layout: damage that changes only what the leaf shows is cut to it, as
+ // wlroots cut it to a node's visible region. Not known until the first build.
+ pixman_region32_t visible;
+ bool has_visible;
+ // Position in paint order at the last sync, to tell a restack.
+ uint32_t rank;
+ bool ranked;
struct rediwm_shadow shadow_drawn_as;
struct rediwm_snap shadow_drawn;
float shadow_drawn_opacity;
bool has_shadow_drawn;
struct wlr_buffer *last_buffer;
- // The client buffer whose view lock we told wlroots to ignore, if any.
- struct wlr_client_buffer *marked;
- struct view_state applied;
- bool has_applied;
};
// Everything the compositor says about how a source tree is presented, in one
// addon. Resolve meets every tree of every window on every frame, and each
@@ -143,7 +143,7 @@ struct tree_props {
struct rediwm_clip_spec clip;
struct rediwm_shadow_spec shadow;
// The clip as the last resolve() saw it in layout space, to tell a changed
- // shape (to be damaged) from a moved window (whose views damage themselves).
+ // shape (to be damaged) from a moved window (whose leaves damage themselves).
struct rediwm_clip applied;
bool has_applied;
};
@@ -223,8 +223,7 @@ bool rediwm_projection_set_tree_unclipped(struct wlr_scene_node *node, bool uncl
if (props) props->unclipped = unclipped;
return true;
}
-static const struct wlr_addon_interface lookup_impl, source_lookup_impl;
-static const struct wlr_addon_interface group_source_impl, group_view_impl;
+static const struct wlr_addon_interface source_lookup_impl, group_source_impl;
struct watched_surface {
struct rediwm_projection *projection;
struct wl_list link;
@@ -235,22 +234,25 @@ static void schedule(struct rediwm_projection *p) {
wl_list_for_each(out, &p->scene->outputs, link)
wlr_output_schedule_frame(out->output);
}
-static void finish_group(struct group *g) {
- // Leaves outlive their group by a moment (its view node frees them after its
- // addons finish), and each still points into this list head.
+static void forget_shown(struct leaf *l);
+static void damage_shadow(struct leaf *l, bool show, struct rediwm_snap at);
+static void apply_damage(struct rediwm_projection *p);
+static void destroy_group(struct group *g) {
+ // What the window's leaves showed is damaged at once, as a node going away was
+ // for wlroots: a frame built before the next sync (a capture) must see it. The
+ // leaves are destroyed with their nodes, after this group, and only ever touch
+ // the projection.
struct leaf *l, *next;
- wl_list_for_each_safe(l, next, &g->items, paint) detach(&l->paint);
+ wl_list_for_each_safe(l, next, &g->items, paint) {
+ forget_shown(l);
+ damage_shadow(l, false, (struct rediwm_snap){0});
+ detach(&l->paint);
+ }
+ apply_damage(g->projection);
wl_list_remove(&g->paint);
wl_list_remove(&g->destroy.link);
wl_list_remove(&g->link);
wlr_addon_finish(&g->source_lookup);
- wlr_addon_finish(&g->view_lookup);
-}
-static void destroy_group(struct group *g) {
- finish_group(g);
- // Destroying the view also releases any remaining leaf adapters. This is
- // safe if the source tree is destroyed before its children or vice versa.
- wlr_scene_node_destroy(&g->view->node);
free(g);
}
static void group_source_destroy(struct wl_listener *listener, void *data) {
@@ -263,15 +265,8 @@ static void group_source_addon_destroy(struct wlr_addon *addon) {
struct group *g = wl_container_of(addon, g, source_lookup);
destroy_group(g);
}
-static void group_view_destroy(struct wlr_addon *addon) {
- struct group *g = wl_container_of(addon, g, view_lookup);
- finish_group(g);
- free(g);
-}
static const struct wlr_addon_interface group_source_impl = {
.name = "rediwm projection group source", .destroy = group_source_addon_destroy};
-static const struct wlr_addon_interface group_view_impl = {
- .name = "rediwm projection group", .destroy = group_view_destroy};
static struct group *get_group(struct rediwm_projection *p,
struct wlr_scene_node *source) {
struct wlr_addon *addon = wlr_addon_find(&source->addons, p, &group_source_impl);
@@ -281,90 +276,42 @@ static struct group *get_group(struct rediwm_projection *p,
g = calloc(1, sizeof(*g));
if (!g)
return NULL;
- g->view = wlr_scene_tree_create(p->view);
- if (!g->view) {
- free(g);
- return NULL;
- }
g->source = source;
g->projection = p;
wl_list_init(&g->paint);
wl_list_init(&g->items);
wl_list_insert(&p->groups, &g->link);
wlr_addon_init(&g->source_lookup, &source->addons, p, &group_source_impl);
- wlr_addon_init(&g->view_lookup, &g->view->node.addons, NULL, &group_view_impl);
g->destroy.notify = group_source_destroy;
wl_signal_add(&source->events.destroy, &g->destroy);
return g;
}
-static struct leaf *lookup(struct wlr_scene_node *node) {
- struct wlr_addon *addon = wlr_addon_find(&node->addons, NULL, &lookup_impl);
- if (!addon)
- return NULL;
- struct leaf *l = wl_container_of(addon, l, lookup);
- return l;
-}
-struct wlr_scene_node *rediwm_projection_source(struct wlr_scene_node *node) {
- struct leaf *l = lookup(node);
- return l ? l->source : node;
-}
-double rediwm_projection_node_zoom(struct wlr_scene_node *node) {
- struct leaf *l = lookup(node);
- return l ? l->item.scale : 1;
-}
-struct wlr_scene_node *rediwm_projection_node(struct rediwm_projection *p,
- struct wlr_scene_node *source) {
- if (!p)
- return source;
- struct wlr_addon *addon =
- wlr_addon_find(&source->addons, p, &source_lookup_impl);
- if (!addon)
- return NULL;
- struct leaf *l = wl_container_of(addon, l, source_lookup);
- return l->view;
-}
-static void move_listener(struct wl_listener *listener,
- struct wl_signal *signal) {
- wl_list_remove(&listener->link);
- wl_signal_add(signal, listener);
-}
-// Keep wlroots' own surface lifecycle implementation, but drive it exclusively
-// from displayed buffers. Source buffers stay under a disabled tree in the same
-// scene, so the handlers retain the correct scene/output/color-manager context.
-static void route_surface(struct leaf *l, struct wlr_scene_buffer *buffer) {
- if (!l->surface)
- return;
- move_listener(&l->surface->private.outputs_update,
- &buffer->events.outputs_update);
- move_listener(&l->surface->private.output_sample,
- &buffer->events.output_sample);
- move_listener(&l->surface->private.frame_done, &buffer->events.frame_done);
-}
-// wlr_client_buffer_apply_damage updates a shm client's texture in place only
-// when no lock but the surface's is outstanding; otherwise every commit
-// allocates a new texture and uploads the whole buffer. wlr_scene marks its
-// own surface-node lock as ignorable for that reason. The view holds a second
-// lock and needs the same mark, which is safe for the same reason: the view is
-// synchronized from the source before every output frame. Single-pixel
-// buffers are excluded because wlroots draws them from a cached colour.
-static void unmark_view_buffer(struct leaf *l) {
- if (!l->marked)
- return;
- struct wlr_scene_buffer *v = wlr_scene_buffer_from_node(l->view);
- if (v->buffer == &l->marked->base && l->marked->private.n_ignore_locks > 0)
- l->marked->private.n_ignore_locks--;
- l->marked = NULL;
-}
-static void mark_view_buffer(struct leaf *l, struct wlr_buffer *backing) {
- struct wlr_client_buffer *client =
- backing ? wlr_client_buffer_get(backing) : NULL;
- if (!client || !l->surface || l->surface->surface->buffer != client)
- return;
- if (client->source &&
- wlr_single_pixel_buffer_v1_try_from_buffer(client->source))
- return;
- client->private.n_ignore_locks++;
- l->marked = client;
+// ---- Surface feedback (stage 6 of docs/plans/scene-graph.md) ---------------------
+// wlr_scene tells a surface where it is shown by emitting its scene buffer's own
+// signals, from the node's visible region. The world's source tree is disabled, so
+// wlroots sees nothing there; the output pass, which draws the graph, knows what
+// is shown.
+// For every client surface it reports, per output it builds, how many pixels are
+// visible (not hidden by what is above), and this keeps the last report of each
+// output. From the sums it applies wlroots' own rule (scene.c,
+// update_node_update_outputs): an output is active when it shows more than a tenth
+// of what is visible on all of them, and the primary one is the one showing most
+// (the last, on a tie). It then emits the signals wlr_scene would have: the
+// source buffer is where wlr_scene_surface listens.
+enum { FEEDBACK_OUTPUTS = 64 };
+struct feedback {
+ struct wl_list link;
+ struct leaf *leaf;
+ // Visible pixels as the last build of each output (scene output index) saw them.
+ uint32_t area[FEEDBACK_OUTPUTS];
+ uint64_t active;
+ struct wlr_scene_output *primary;
+};
+static void free_feedback(struct leaf *l) {
+ if (!l->feedback) return;
+ wl_list_remove(&l->feedback->link);
+ free(l->feedback);
+ l->feedback = NULL;
}
static void emit(struct rediwm_projection *p, uint64_t leaf, int x, int y, int width, int height) {
if (width <= 0 || height <= 0) return;
@@ -389,24 +336,45 @@ bool rediwm_projection_damage_events(struct rediwm_projection *p, uint64_t *curs
uint64_t rediwm_projection_damage_cursor(struct rediwm_projection *p) {
return p->next_event ? p->next_event : 1;
}
+// Layout-space damage for the screen, applied when the sync ends. `visible_only`
+// cuts it to what the leaf showed at the last build: a change of what the leaf
+// itself shows is invisible where something opaque lay over it, and anything that
+// stops covering it damages that region itself.
+static void damage_box(struct leaf *l, struct rediwm_snap s, bool visible_only) {
+ if (s.width <= 0 || s.height <= 0) return;
+ pixman_region32_t *pending = &l->projection->pending;
+ if (visible_only && l->has_visible) {
+ pixman_region32_t region;
+ pixman_region32_init_rect(&region, s.x, s.y, s.width, s.height);
+ pixman_region32_intersect(&region, &region, &l->visible);
+ pixman_region32_union(pending, pending, &region);
+ pixman_region32_fini(&region);
+ } else {
+ pixman_region32_union_rect(pending, pending, s.x, s.y, s.width, s.height);
+ }
+}
static void damage_shadow(struct leaf *l, bool show, struct rediwm_snap at);
static void forget_shown(struct leaf *l) {
- if (l->has_shown) emit_snap(l, l->shown);
+ if (l->has_shown) {
+ emit_snap(l, l->shown);
+ damage_box(l, l->shown, true);
+ }
l->has_shown = false;
}
static void destroy_leaf(struct leaf *l) {
forget_shown(l);
damage_shadow(l, false, (struct rediwm_snap){0});
- unmark_view_buffer(l);
- route_surface(l, l->surface ? l->surface->buffer : NULL);
+ // A node going away damaged the screen at once, and a frame built before the
+ // next sync (a capture) must see it.
+ apply_damage(l->projection);
+ free_feedback(l);
wl_list_remove(&l->commit.link);
wl_list_remove(&l->destroy.link);
wl_list_remove(&l->link);
wl_list_remove(&l->paint);
wlr_addon_finish(&l->source_lookup);
- wlr_addon_finish(&l->lookup);
- wlr_scene_node_destroy(l->view);
pixman_region32_fini(&l->damage);
+ pixman_region32_fini(&l->visible);
free(l);
}
static void source_destroy(struct wl_listener *listener, void *data) {
@@ -415,29 +383,12 @@ static void source_destroy(struct wl_listener *listener, void *data) {
schedule(l->projection);
destroy_leaf(l);
}
-static void view_destroy(struct wlr_addon *addon) {
- // The adapter is explicitly destroyed before its presentation tree.
- struct leaf *l = wl_container_of(addon, l, lookup);
- // Addons finish before wlroots unlocks the view's buffer.
- unmark_view_buffer(l);
- route_surface(l, l->surface ? l->surface->buffer : NULL);
- wl_list_remove(&l->commit.link);
- wl_list_remove(&l->destroy.link);
- wl_list_remove(&l->link);
- wl_list_remove(&l->paint);
- wlr_addon_finish(&l->source_lookup);
- wlr_addon_finish(addon);
- pixman_region32_fini(&l->damage);
- free(l);
-}
static void source_addon_destroy(struct wlr_addon *addon) {
struct leaf *l = wl_container_of(addon, l, source_lookup);
destroy_leaf(l);
}
static const struct wlr_addon_interface source_lookup_impl = {
.name = "rediwm projection source", .destroy = source_addon_destroy};
-static const struct wlr_addon_interface lookup_impl = {
- .name = "rediwm projection", .destroy = view_destroy};
bool rediwm_surface_state_remapped(const struct wlr_surface_state *state) {
// wl_surface before v5 sets OFFSET on every attach, even attach(buffer, 0, 0),
// so only a nonzero delta is a real change. GTK3, Xwayland and other v4
@@ -467,26 +418,6 @@ static void committed(struct wl_listener *listener, void *data) {
l->dirty = true;
schedule(l->projection);
}
-static bool accepts(struct wlr_scene_buffer *buffer, double *x, double *y) {
- struct leaf *l = lookup(&buffer->node);
- if (!l || buffer->dst_width <= 0 || buffer->dst_height <= 0)
- return false;
- *x *= (double)l->item.width / buffer->dst_width;
- *y *= (double)l->item.height / buffer->dst_height;
- // A window's rounded corners are transparent: a point the shape cuts away goes
- // to whatever is below, which wlroots finds by asking the next node. The point
- // is now in source units; the shape is in layout space.
- if (l->item.clip && l->item.width > 0 && l->item.height > 0) {
- const struct rediwm_edges *e = &l->item.edges;
- const double px = e->x1 + *x * (e->x2 - e->x1) / l->item.width;
- const double py = e->y1 + *y * (e->y2 - e->y1) / l->item.height;
- if (rediwm_clip_distance(l->item.clip, px, py) > 0)
- return false;
- }
- struct wlr_scene_buffer *source = wlr_scene_buffer_from_node(l->source);
- return !source->point_accepts_input ||
- source->point_accepts_input(source, x, y);
-}
static struct leaf *get_leaf(struct rediwm_projection *p,
struct wlr_scene_node *source) {
struct wlr_addon *addon =
@@ -503,88 +434,30 @@ static struct leaf *get_leaf(struct rediwm_projection *p,
l->dirty = true;
l->full_damage = true;
pixman_region32_init(&l->damage);
+ pixman_region32_init(&l->visible);
wl_list_init(&l->commit.link);
wl_list_init(&l->paint);
- if (source->type == WLR_SCENE_NODE_RECT) {
- struct wlr_scene_rect *rect = wlr_scene_rect_from_node(source);
- struct wlr_scene_rect *view =
- wlr_scene_rect_create(p->view, 0, 0, rect->color);
- if (view)
- l->view = &view->node;
- } else {
- struct wlr_scene_buffer *view = wlr_scene_buffer_create(p->view, NULL);
- if (view)
- l->view = &view->node;
- }
- if (!l->view) {
- pixman_region32_fini(&l->damage);
- free(l);
- return NULL;
- }
wl_list_insert(&p->leaves, &l->link);
wlr_addon_init(&l->source_lookup, &source->addons, p, &source_lookup_impl);
- wlr_addon_init(&l->lookup, &l->view->addons, NULL, &lookup_impl);
l->destroy.notify = source_destroy;
wl_signal_add(&source->events.destroy, &l->destroy);
if (source->type == WLR_SCENE_NODE_BUFFER) {
struct wlr_scene_buffer *buffer = wlr_scene_buffer_from_node(source);
- struct wlr_scene_buffer *view = wlr_scene_buffer_from_node(l->view);
- view->point_accepts_input = accepts;
l->surface = wlr_scene_surface_try_from_buffer(buffer);
if (l->surface) {
l->damage_width = l->surface->surface->current.buffer_width;
l->damage_height = l->surface->surface->current.buffer_height;
- route_surface(l, view);
+ l->feedback = calloc(1, sizeof(*l->feedback));
+ if (l->feedback) {
+ l->feedback->leaf = l;
+ wl_list_insert(&p->feedback, &l->feedback->link);
+ }
l->commit.notify = committed;
wl_signal_add(&l->surface->surface->events.commit, &l->commit);
}
}
return l;
}
-// The source's opaque region mapped onto its view, never larger than the real
-// one, returning a hash of the source region for the view-state cache.
-//
-// wlroots knows a client surface is opaque from its raw buffer's format (an
-// XRGB buffer covers the whole surface) or from the client's own opaque
-// region, and keeps that in the node's opaque region. The view's buffer is a
-// wlr_client_buffer, which reveals no pixel format, so its own flag is false
-// for every client: without this no window occluded anything below it, every
-// damaged frame redrew the wallpaper and the windows underneath, and a
-// fullscreen client could never be the only thing left to scan out.
-//
-// A 1:1 view uses the region as is. Otherwise each rectangle is scaled with
-// the view and pulled one pixel inward, so rounding and the filter's reach
-// beyond an opaque edge can never mark a translucent pixel opaque.
-static uint64_t mirror_opaque(pixman_region32_t *out, const pixman_region32_t *source,
- int source_width, int source_height, int width,
- int height) {
- uint64_t hash = UINT64_C(14695981039346656037);
- int count = 0;
- const pixman_box32_t *box =
- pixman_region32_rectangles((pixman_region32_t *)source, &count);
- const bool exact = width == source_width && height == source_height;
- for (int i = 0; i < count; i++) {
- const int edges[4] = {box[i].x1, box[i].y1, box[i].x2, box[i].y2};
- for (int j = 0; j < 4; j++)
- hash = (hash ^ (uint64_t)(uint32_t)edges[j]) * UINT64_C(1099511628211);
- if (exact) {
- pixman_region32_union_rect(out, out, box[i].x1, box[i].y1,
- box[i].x2 - box[i].x1, box[i].y2 - box[i].y1);
- } else if (source_width > 0 && source_height > 0) {
- const double sx = (double)width / source_width;
- const double sy = (double)height / source_height;
- const int x1 = (int)ceil(box[i].x1 * sx) + 1;
- const int y1 = (int)ceil(box[i].y1 * sy) + 1;
- const int x2 = (int)floor(box[i].x2 * sx) - 1;
- const int y2 = (int)floor(box[i].y2 * sy) - 1;
- if (x2 > x1 && y2 > y1)
- pixman_region32_union_rect(out, out, x1, y1, x2 - x1, y2 - y1);
- }
- }
- pixman_region32_intersect_rect(out, out, 0, 0, width, height);
- return hash;
-}
-// Glass writes its own projected buffers after this synchronization pass.
#include "glass.h"
// A glass effect covers its target exactly: the box is the target's (same
// parent), and it is shown only with it. The pass draws the blur (stage 5c).
@@ -637,12 +510,12 @@ static void damage_clip_change(struct rediwm_projection *p, const struct rediwm_
pixman_region32_init(&region);
if (before) clip_rim(&region, before);
if (after) clip_rim(&region, after);
- if (pixman_region32_not_empty(&region)) rediwm_scene_damage_layout(p->scene, &region);
+ pixman_region32_union(&p->pending, &p->pending, &region);
pixman_region32_fini(&region);
}
// resolve(): source tree -> graph. Writes items, group origins, `seen` flags and
// the paint-order lists; creates adapters for nodes it meets the first time, but
-// moves, sizes and shows nothing in the view tree.
+// moves and shows nothing.
static void resolve_node(struct rediwm_projection *p, struct group *g,
struct wlr_scene_node *node, double x, double y,
bool enabled, struct rediwm_xform t,
@@ -766,7 +639,7 @@ static void damage_shadow(struct leaf *l, bool show, struct rediwm_snap at) {
l->shadow_drawn.width, l->shadow_drawn.height);
if (show) pixman_region32_union_rect(&region, &region, at.x, at.y, at.width, at.height);
if (pixman_region32_not_empty(&region)) {
- rediwm_scene_damage_layout(l->projection->scene, &region);
+ pixman_region32_union(&l->projection->pending, &l->projection->pending, &region);
const pixman_box32_t *b = pixman_region32_extents(&region);
emit(l->projection, l->item.id, b->x1, b->y1, b->x2 - b->x1, b->y2 - b->y1);
}
@@ -777,9 +650,26 @@ static void damage_shadow(struct leaf *l, bool show, struct rediwm_snap at) {
l->shadow_drawn_opacity = opacity;
}
-// The layout box a buffer-local damage region covers: its bounding box through
-// the source box onto the item's edges, one pixel wider for filtering. The whole
-// box without damage, or under a transform (conservative, like glass.c was).
+// The layout box a buffer-local box covers: through the source box onto the item's
+// edges, one pixel wider for filtering, never beyond the leaf (damage outside its
+// source box shows nowhere).
+static struct rediwm_snap map_damage(const struct rediwm_item *item, const pixman_box32_t *b,
+ const struct wlr_fbox *src, struct rediwm_snap snap) {
+ const struct rediwm_edges *e = &item->edges;
+ const double sx = (e->x2 - e->x1) / src->width, sy = (e->y2 - e->y1) / src->height;
+ const int x1 = (int)floor(e->x1 + (b->x1 - src->x) * sx) - 1;
+ const int y1 = (int)floor(e->y1 + (b->y1 - src->y) * sy) - 1;
+ const int x2 = (int)ceil(e->x1 + (b->x2 - src->x) * sx) + 1;
+ const int y2 = (int)ceil(e->y1 + (b->y2 - src->y) * sy) + 1;
+ const int cx1 = x1 > snap.x ? x1 : snap.x, cy1 = y1 > snap.y ? y1 : snap.y;
+ const int cx2 = x2 < snap.x + snap.width ? x2 : snap.x + snap.width;
+ const int cy2 = y2 < snap.y + snap.height ? y2 : snap.y + snap.height;
+ return (struct rediwm_snap){cx1, cy1, cx2 - cx1, cy2 - cy1};
+}
+// What a commit's or a replaced buffer's damage changed: the event covers the
+// bounding box of the buffer-local damage, the screen only the pieces of it (up to
+// a few). The whole box without damage, or under a transform (conservative, like
+// glass.c was).
static void damage_event_for_buffer(struct leaf *l, const pixman_region32_t *damage,
int buffer_width, int buffer_height,
struct rediwm_snap snap) {
@@ -787,64 +677,51 @@ static void damage_event_for_buffer(struct leaf *l, const pixman_region32_t *dam
if (!damage || item->content.transform != WL_OUTPUT_TRANSFORM_NORMAL ||
buffer_width <= 0 || buffer_height <= 0) {
emit_snap(l, snap);
+ damage_box(l, snap, true);
return;
}
- if (!pixman_region32_not_empty(damage)) return;
- const pixman_box32_t *b = pixman_region32_extents(damage);
+ if (!pixman_region32_not_empty((pixman_region32_t *)damage)) return;
struct wlr_fbox src = item->content.src_box;
if (wlr_fbox_empty(&src)) src = (struct wlr_fbox){0, 0, buffer_width, buffer_height};
- const struct rediwm_edges *e = &item->edges;
- const double sx = (e->x2 - e->x1) / src.width, sy = (e->y2 - e->y1) / src.height;
- const int x1 = (int)floor(e->x1 + (b->x1 - src.x) * sx) - 1;
- const int y1 = (int)floor(e->y1 + (b->y1 - src.y) * sy) - 1;
- const int x2 = (int)ceil(e->x1 + (b->x2 - src.x) * sx) + 1;
- const int y2 = (int)ceil(e->y1 + (b->y2 - src.y) * sy) + 1;
- // Never beyond the leaf: damage outside its source box shows nowhere.
- const int cx1 = x1 > snap.x ? x1 : snap.x, cy1 = y1 > snap.y ? y1 : snap.y;
- const int cx2 = x2 < snap.x + snap.width ? x2 : snap.x + snap.width;
- const int cy2 = y2 < snap.y + snap.height ? y2 : snap.y + snap.height;
- emit(l->projection, item->id, cx1, cy1, cx2 - cx1, cy2 - cy1);
+ const struct rediwm_snap whole =
+ map_damage(item, pixman_region32_extents((pixman_region32_t *)damage), &src, snap);
+ emit(l->projection, item->id, whole.x, whole.y, whole.width, whole.height);
+ int count = 0;
+ const pixman_box32_t *rects = pixman_region32_rectangles((pixman_region32_t *)damage, &count);
+ if (count > 16) {
+ damage_box(l, whole, true);
+ return;
+ }
+ for (int i = 0; i < count; i++) {
+ const struct rediwm_snap piece = map_damage(item, &rects[i], &src, snap);
+ damage_box(l, piece, true);
+ }
}
-// present(): graph -> view tree. Reads items and group origins, never the
-// source's geometry; rounds, orders and applies, and tells wlroots about the
-// buffers and damage that changed.
-static void present_leaf(struct group *g, struct leaf *l,
- struct wlr_scene_node **previous) {
+// present(): graph -> damage. Reads items, never the source's geometry; rounds
+// and tells the screen and the damage events what changed.
+static void present_leaf(struct leaf *l) {
struct rediwm_item *item = &l->item;
- if (l->view->parent != g->view)
- wlr_scene_node_reparent(l->view, g->view);
- // Reorder only when necessary, avoiding damage from no-op syncs.
- if (*previous) {
- if (l->view->link.prev != &(*previous)->link)
- wlr_scene_node_place_above(l->view, *previous);
- } else if (l->view->link.prev != &g->view->children) {
- wlr_scene_node_lower_to_bottom(l->view);
- }
- *previous = l->view;
// Round in layout coordinates first. Rounding a scaled local offset would
// change pixels at fractional zoom and when crossing negative origins.
const struct rediwm_snap snap = rediwm_edges_snap(item->edges);
- struct view_state next = {0};
- next.x = snap.x - g->view->node.x;
- next.y = snap.y - g->view->node.y;
- next.width = snap.width;
- next.height = snap.height;
- next.enabled = item->enabled && snap.width > 0 && snap.height > 0;
- next.content = item->content;
+ const bool enabled = item->enabled && snap.width > 0 && snap.height > 0;
// Damage events: a moved, resized, shown, hidden or restyled leaf changes its
// old and its new box; otherwise only what a new buffer or commit damaged.
// Only a leaf that puts pixels on screen has them: an input-only node (a
// resize grab) moving with its window must not read as a change below glass,
// and the pass draws effects itself (shadows report in damage_shadow).
- bool paints = next.enabled;
+ bool paints = enabled;
if (item->kind == REDIWM_ITEM_RECT) {
paints = paints && item->content.color[3] > 0;
} else if (item->kind == REDIWM_ITEM_EFFECT || item->kind == REDIWM_ITEM_SHADOW) {
paints = false;
} else {
+ // What the output pass draws from: the buffer, or the texture left when GLES2
+ // uploaded it and let the buffer go, or a single-pixel colour.
const struct wlr_scene_buffer *sb = wlr_scene_buffer_from_node(l->source);
paints = paints && item->content.opacity > 0 &&
- (sb->buffer || (l->surface && l->surface->surface->buffer));
+ (sb->buffer || sb->private.texture || sb->private.is_single_pixel_buffer ||
+ (l->surface && l->surface->surface->buffer));
}
const bool restyled = !l->has_shown || !paints || snap.x != l->shown.x ||
snap.y != l->shown.y || snap.width != l->shown.width ||
@@ -854,85 +731,32 @@ static void present_leaf(struct group *g, struct leaf *l,
forget_shown(l);
if (paints) {
emit_snap(l, snap);
+ damage_box(l, snap, false);
l->shown = snap;
l->shown_content = item->content;
l->has_shown = true;
}
}
- if (item->kind == REDIWM_ITEM_RECT) {
- if (!l->has_applied || !view_state_equal(&next, &l->applied)) {
- struct wlr_scene_rect *v = wlr_scene_rect_from_node(l->view);
- wlr_scene_node_set_position(l->view, next.x, next.y);
- wlr_scene_node_set_enabled(l->view, next.enabled);
- wlr_scene_rect_set_size(v, snap.width > 0 ? snap.width : 0,
- snap.height > 0 ? snap.height : 0);
- wlr_scene_rect_set_color(v, item->content.color);
- l->applied = next;
- l->has_applied = true;
- }
- } else if (item->kind != REDIWM_ITEM_EFFECT) {
+ if (item->kind != REDIWM_ITEM_RECT && item->kind != REDIWM_ITEM_EFFECT) {
struct wlr_scene_buffer *b = wlr_scene_buffer_from_node(l->source);
- struct wlr_scene_buffer *v = wlr_scene_buffer_from_node(l->view);
struct wlr_buffer *backing = b->buffer;
// wlroots may cache a single-pixel buffer as a color and release the
// source node's buffer reference. The mapped surface still owns it.
if (!backing && l->surface && l->surface->surface->buffer)
backing = &l->surface->surface->buffer->base;
if (l->dirty || l->last_buffer != backing) {
- struct wlr_scene_buffer_set_buffer_options options = {
- .damage = backing && (l->surface || l->owned_damage) &&
- l->dirty && !l->full_damage
- ? &l->damage : NULL,
- .wait_timeline = b->private.wait_timeline,
- .wait_point = b->private.wait_point,
- };
+ const pixman_region32_t *damage =
+ backing && (l->surface || l->owned_damage) && l->dirty && !l->full_damage
+ ? &l->damage : NULL;
if (!restyled && l->has_shown)
- damage_event_for_buffer(l, options.damage,
+ damage_event_for_buffer(l, damage,
l->surface ? l->damage_width : backing ? backing->width : 0,
l->surface ? l->damage_height : backing ? backing->height : 0, snap);
- unmark_view_buffer(l);
- wlr_scene_buffer_set_buffer_with_options(v, backing, &options);
- mark_view_buffer(l, backing);
l->last_buffer = backing;
}
- // Read after the buffer update above, which can change it.
- next.opaque = v->private.buffer_is_opaque;
- pixman_region32_t mirrored;
- pixman_region32_init(&mirrored);
- if (!next.opaque && snap.width > 0 && snap.height > 0)
- next.opaque_hash = mirror_opaque(&mirrored, &b->opaque_region, item->width,
- item->height, snap.width, snap.height);
- if (!l->has_applied || !view_state_equal(&next, &l->applied)) {
- const struct rediwm_content *content = &item->content;
- wlr_scene_node_set_position(l->view, next.x, next.y);
- wlr_scene_node_set_enabled(l->view, next.enabled);
- wlr_scene_buffer_set_source_box(v, &content->src_box);
- wlr_scene_buffer_set_dest_size(v, snap.width > 0 ? snap.width : 1,
- snap.height > 0 ? snap.height : 1);
- wlr_scene_buffer_set_transform(v, content->transform);
- wlr_scene_buffer_set_opacity(v, content->opacity);
- wlr_scene_buffer_set_filter_mode(v, content->filter_mode);
- wlr_scene_buffer_set_transfer_function(v, content->transfer_function);
- wlr_scene_buffer_set_primaries(v, content->primaries);
- wlr_scene_buffer_set_color_encoding(v, content->color_encoding);
- wlr_scene_buffer_set_color_range(v, content->color_range);
- // Mirror intrinsic opacity into the explicit region too. wlroots updates
- // buffer_is_opaque on buffer replacement without recomputing visibility
- // when the size is unchanged. Changing this region invalidates occlusion,
- // so an opaque -> translucent single-pixel buffer reveals the nodes below.
- // A client's own region (see mirror_opaque) is used when the view's
- // buffer does not know it is opaque.
- if (next.opaque && snap.width > 0 && snap.height > 0)
- pixman_region32_union_rect(&mirrored, &mirrored, 0, 0, snap.width,
- snap.height);
- wlr_scene_buffer_set_opaque_region(v, &mirrored);
- l->applied = next;
- l->has_applied = true;
- }
- pixman_region32_fini(&mirrored);
}
if (item->kind == REDIWM_ITEM_SHADOW || l->has_shadow_drawn)
- damage_shadow(l, item->kind == REDIWM_ITEM_SHADOW && next.enabled &&
+ damage_shadow(l, item->kind == REDIWM_ITEM_SHADOW && enabled &&
item->content.opacity > 0 && item->shadow->color[3] > 0,
snap);
l->dirty = false;
@@ -950,8 +774,8 @@ bool wlr_client_buffer_apply_damage(struct wlr_client_buffer *client_buffer,
// A plain buffer replaced on a scene node gets a new texture and a full
// upload. Wrapping it in a client buffer instead lets the next frame's
// damage update that texture in place, as for shm clients. The source node's
-// lock is marked ignorable (like wlr_scene's own surface lock): the view is
-// synchronized from the source before every frame and told the damage.
+// lock is marked ignorable (like wlr_scene's own surface lock): the output pass
+// reads the buffer from the node and is told the damage at the next sync.
bool rediwm_projection_present_owned(struct rediwm_projection *p,
struct wlr_scene_buffer *source,
struct wlr_renderer *renderer,
@@ -1012,20 +836,151 @@ void rediwm_projection_damage_buffer(struct rediwm_projection *p,
l->dirty = true;
schedule(p);
}
+static uint32_t region_area(const pixman_region32_t *region) {
+ int count = 0;
+ const pixman_box32_t *box = pixman_region32_rectangles((pixman_region32_t *)region, &count);
+ uint32_t area = 0;
+ for (int i = 0; i < count; i++)
+ area += (uint32_t)(box[i].x2 - box[i].x1) * (uint32_t)(box[i].y2 - box[i].y1);
+ return area;
+}
+static struct leaf *transport_leaf(struct rediwm_projection *p, struct wlr_scene_node *node) {
+ struct wlr_addon *addon = wlr_addon_find(&node->addons, p, &source_lookup_impl);
+ struct leaf *l;
+ return addon ? wl_container_of(addon, l, source_lookup) : NULL;
+}
+static struct leaf *feedback_leaf(struct rediwm_projection *p, struct wlr_scene_node *node) {
+ struct leaf *l = transport_leaf(p, node);
+ return l && l->feedback ? l : NULL;
+}
+// What of an item nothing above hides, as the output pass last saw it (layout space).
+void rediwm_projection_note_visible(struct rediwm_projection *p, struct wlr_scene_node *node,
+ const pixman_region32_t *visible) {
+ struct leaf *l = transport_leaf(p, node);
+ if (!l) return;
+ pixman_region32_copy(&l->visible, visible);
+ l->has_visible = true;
+}
+void rediwm_projection_feedback_begin(struct rediwm_projection *p) {
+ // Whatever this build does not reach (off every output, hidden, gone) shows
+ // nothing: damage that only changes what such a leaf shows is dropped.
+ struct leaf *leaf;
+ wl_list_for_each(leaf, &p->leaves, link) {
+ pixman_region32_clear(&leaf->visible);
+ leaf->has_visible = true;
+ }
+ struct feedback *f;
+ wl_list_for_each(f, &p->feedback, link) memset(f->area, 0, sizeof(f->area));
+ struct wlr_scene_output *out;
+ wl_list_for_each(out, &p->scene->outputs, link) {
+ const unsigned i = out->private.index % FEEDBACK_OUTPUTS;
+ if (p->shown_output[i].known &&
+ (p->shown_output[i].scale != out->output->scale ||
+ p->shown_output[i].transform != out->output->transform ||
+ p->shown_output[i].subpixel != out->output->subpixel))
+ p->forced |= 1ull << i;
+ p->shown_output[i].scale = out->output->scale;
+ p->shown_output[i].transform = out->output->transform;
+ p->shown_output[i].subpixel = out->output->subpixel;
+ p->shown_output[i].known = true;
+ }
+}
+// `visible` is what of the surface nothing above it hides, over the whole layout.
+void rediwm_projection_feedback_note(struct rediwm_projection *p, struct wlr_scene_node *node,
+ const pixman_region32_t *visible) {
+ struct leaf *l = feedback_leaf(p, node);
+ if (!l || !pixman_region32_not_empty((pixman_region32_t *)visible)) return;
+ struct wlr_scene_output *out;
+ wl_list_for_each(out, &p->scene->outputs, link) {
+ if (!out->output->enabled) continue;
+ struct wlr_box box = {.x = out->x, .y = out->y};
+ wlr_output_effective_resolution(out->output, &box.width, &box.height);
+ pixman_region32_t shown;
+ pixman_region32_init(&shown);
+ pixman_region32_intersect_rect(&shown, (pixman_region32_t *)visible, box.x, box.y, box.width,
+ box.height);
+ l->feedback->area[out->private.index % FEEDBACK_OUTPUTS] = region_area(&shown);
+ pixman_region32_fini(&shown);
+ }
+}
+// The outputs and primary output of one surface from the last report of every
+// output, and the signals of what changed.
+static void update_feedback(struct leaf *l) {
+ struct feedback *f = l->feedback;
+ struct wlr_scene *scene = l->projection->scene;
+ struct wlr_scene_output *out;
+ uint64_t total = 0;
+ wl_list_for_each(out, &scene->outputs, link)
+ if (out->output->enabled) total += f->area[out->private.index % FEEDBACK_OUTPUTS];
+ uint32_t largest = 0;
+ uint64_t active = 0;
+ size_t count = 0;
+ struct wlr_scene_output *primary = NULL;
+ wl_list_for_each(out, &scene->outputs, link) {
+ if (!out->output->enabled) continue;
+ const uint32_t overlap = f->area[out->private.index % FEEDBACK_OUTPUTS];
+ // Ten percent of what is visible or less, and the output is ignored.
+ if (overlap > 0.1 * total) {
+ if (overlap >= largest) {
+ largest = overlap;
+ primary = out;
+ }
+ active |= 1ull << (out->private.index % FEEDBACK_OUTPUTS);
+ count++;
+ }
+ }
+ struct wlr_scene_buffer *b = wlr_scene_buffer_from_node(l->source);
+ const uint64_t before = f->active;
+ struct wlr_scene_output *before_primary = f->primary;
+ f->active = active;
+ f->primary = primary;
+ wl_list_for_each(out, &scene->outputs, link) {
+ const uint64_t mask = 1ull << (out->private.index % FEEDBACK_OUTPUTS);
+ if ((active & mask) && !(before & mask))
+ wl_signal_emit_mutable(&b->events.output_enter, out);
+ else if (!(active & mask) && (before & mask))
+ wl_signal_emit_mutable(&b->events.output_leave, out);
+ }
+ if (before == active && before_primary == primary && !(active & l->projection->forced)) return;
+ struct wlr_scene_output *outputs[FEEDBACK_OUTPUTS];
+ struct wlr_scene_outputs_update_event event = {.active = outputs, .size = count};
+ size_t i = 0;
+ wl_list_for_each(out, &scene->outputs, link)
+ if (active & (1ull << (out->private.index % FEEDBACK_OUTPUTS))) outputs[i++] = out;
+ wl_signal_emit_mutable(&b->events.outputs_update, &event);
+}
+void rediwm_projection_feedback_end(struct rediwm_projection *p) {
+ struct feedback *f, *next;
+ wl_list_for_each_safe(f, next, &p->feedback, link) update_feedback(f->leaf);
+ p->forced = 0;
+}
+// wlr_scene_output_send_frame_done for the world: the surfaces shown on any
+// output (the surface itself picks the output that paces it).
+void rediwm_projection_send_frame_done(struct rediwm_projection *p, struct wlr_scene_output *out,
+ struct timespec *now) {
+ struct feedback *f, *next;
+ wl_list_for_each_safe(f, next, &p->feedback, link) {
+ if (!f->active || !f->leaf->seen || !f->leaf->item.enabled) continue;
+ struct wlr_scene_frame_done_event event = {.output = out, .when = *now};
+ wl_signal_emit_mutable(&wlr_scene_buffer_from_node(f->leaf->source)->events.frame_done, &event);
+ }
+}
struct rediwm_projection *
-rediwm_projection_create(struct wlr_scene_tree *source,
- struct wlr_scene_tree *view, struct wlr_scene *scene) {
+rediwm_projection_create(struct wlr_scene_tree *source, struct wlr_scene *scene) {
struct rediwm_projection *p = calloc(1, sizeof(*p));
if (!p)
return NULL;
p->source = source;
- p->view = view;
p->scene = scene;
wl_list_init(&p->leaves);
wl_list_init(&p->groups);
wl_list_init(&p->paint);
wl_list_init(&p->surfaces);
+ wl_list_init(&p->feedback);
wl_list_init(&p->new_surface.link);
+ pixman_region32_init(&p->pending);
+ // wlroots ignores a disabled tree: it computes no outputs, frame callbacks or
+ // damage for the source nodes; the graph does all three.
wlr_scene_node_set_enabled(&source->node, false);
return p;
}
@@ -1055,40 +1010,94 @@ static void resolve(struct rediwm_projection *p, double z, double cx, double cy,
// The fixed subtree is laid out as is; everything else follows the camera.
const struct rediwm_xform t = fixed && node == &fixed->node ? identity : camera;
g->seen = true;
- rediwm_xform_point(t, node->x, node->y, &g->x, &g->y);
g->enabled = node->enabled;
wl_list_insert(p->paint.prev, &g->paint);
resolve_node(p, g, node, 0, 0, true, t, NULL, NULL);
}
}
-// Graph -> view tree, then hide what the graph no longer reaches.
+static void damage_restacked(struct rediwm_projection *p);
+// Graph -> damage, then forget what the graph no longer reaches.
static void present(struct rediwm_projection *p) {
- struct wlr_scene_node *previous_group = NULL;
- struct group *g, *next_group;
- wl_list_for_each_safe(g, next_group, &p->paint, paint) {
- wlr_scene_node_set_position(&g->view->node, lround(g->x), lround(g->y));
- wlr_scene_node_set_enabled(&g->view->node, g->enabled);
- if (previous_group) {
- if (g->view->node.link.prev != &previous_group->link)
- wlr_scene_node_place_above(&g->view->node, previous_group);
- } else if (g->view->node.link.prev != &p->view->children) {
- wlr_scene_node_lower_to_bottom(&g->view->node);
- }
- previous_group = &g->view->node;
- struct wlr_scene_node *previous = NULL;
+ struct group *g;
+ wl_list_for_each(g, &p->paint, paint) {
struct leaf *l, *next;
- wl_list_for_each_safe(l, next, &g->items, paint) present_leaf(g, l, &previous);
+ wl_list_for_each_safe(l, next, &g->items, paint) present_leaf(l);
}
struct leaf *l;
wl_list_for_each(l, &p->leaves, link) if (!l->seen) {
forget_shown(l);
damage_shadow(l, false, (struct rediwm_snap){0});
- wlr_scene_node_set_enabled(l->view, false);
- // The cached state no longer describes the view; reapply on return.
- l->has_applied = false;
+ l->ranked = false;
}
- wl_list_for_each(g, &p->groups, link) if (!g->seen)
- wlr_scene_node_set_enabled(&g->view->node, false);
+ damage_restacked(p);
+}
+// A leaf that is above what it was below, or the reverse, changes every pixel of
+// the two where they overlap, and nothing else tells the screen: wlroots damaged a
+// node it restacked. The leaves still there are checked in paint order against
+// the order of the last sync; when it differs, the ones that must have moved (all
+// but a longest run that kept its order) are damaged whole. Any pair that swapped
+// has at least one of them outside that run, and the overlap lies in its box.
+static void damage_restacked(struct rediwm_projection *p) {
+ size_t n = 0;
+ bool ordered = true, have = false;
+ uint32_t last = 0;
+ struct group *g;
+ struct leaf *l;
+ wl_list_for_each(g, &p->paint, paint) wl_list_for_each(l, &g->items, paint) {
+ if (!l->ranked) continue;
+ if (have && l->rank < last) ordered = false;
+ last = l->rank;
+ have = true;
+ n++;
+ }
+ if (!ordered) {
+ struct leaf **leaves = malloc(n * sizeof(*leaves));
+ size_t *tails = malloc(n * sizeof(*tails));
+ long *before = malloc(n * sizeof(*before));
+ bool *kept = calloc(n, sizeof(*kept));
+ if (leaves && tails && before && kept) {
+ size_t count = 0, length = 0;
+ wl_list_for_each(g, &p->paint, paint) wl_list_for_each(l, &g->items, paint)
+ if (l->ranked) leaves[count++] = l;
+ // Longest strictly increasing run of the old ranks.
+ for (size_t i = 0; i < count; i++) {
+ size_t lo = 0, hi = length;
+ while (lo < hi) {
+ const size_t mid = (lo + hi) / 2;
+ if (leaves[tails[mid]]->rank < leaves[i]->rank) lo = mid + 1;
+ else hi = mid;
+ }
+ before[i] = lo > 0 ? (long)tails[lo - 1] : -1;
+ tails[lo] = i;
+ if (lo == length) length++;
+ }
+ for (long i = length ? (long)tails[length - 1] : -1; i >= 0; i = before[i]) kept[i] = true;
+ for (size_t i = 0; i < count; i++) {
+ struct leaf *moved = leaves[i];
+ if (kept[i]) continue;
+ // A shadow shows no box of its own (`shown`), but it lies over or under
+ // what was restacked all the same.
+ if (moved->has_shown) damage_box(moved, moved->shown, false);
+ if (moved->has_shadow_drawn) damage_box(moved, moved->shadow_drawn, false);
+ }
+ } else {
+ // Out of memory: treat the whole layout as changed.
+ pixman_region32_union_rect(&p->pending, &p->pending, INT32_MIN / 2, INT32_MIN / 2, INT32_MAX, INT32_MAX);
+ }
+ free(leaves);
+ free(tails);
+ free(before);
+ free(kept);
+ }
+ uint32_t rank = 0;
+ wl_list_for_each(g, &p->paint, paint) wl_list_for_each(l, &g->items, paint) {
+ l->rank = rank++;
+ l->ranked = true;
+ }
+}
+static void apply_damage(struct rediwm_projection *p) {
+ if (pixman_region32_not_empty(&p->pending)) rediwm_scene_damage_layout(p->scene, &p->pending);
+ pixman_region32_clear(&p->pending);
}
void rediwm_projection_sync_fixed(struct rediwm_projection *p, double z, double cx,
double cy, double ox, double oy,
@@ -1097,13 +1106,14 @@ void rediwm_projection_sync_fixed(struct rediwm_projection *p, double z, double
return;
resolve(p, z, cx, cy, ox, oy, fixed);
present(p);
+ apply_damage(p);
}
void rediwm_projection_sync(struct rediwm_projection *p, double z, double cx,
double cy, double ox, double oy) {
rediwm_projection_sync_fixed(p, z, cx, cy, ox, oy, NULL);
}
// Shell/layer/lock nodes have identity layout transforms. Resolve them into the
-// same item type at the output boundary; they have no projected view tree.
+// same item type at the output boundary.
static struct rediwm_item layout_item(struct wlr_scene_node *node, int x, int y) {
struct rediwm_item item = {.enabled = node->enabled, .scale = 1};
if (node->type == WLR_SCENE_NODE_RECT) {
@@ -1136,16 +1146,16 @@ static struct rediwm_item layout_item(struct wlr_scene_node *node, int x, int y)
}
static bool visit_items(struct rediwm_projection *p, struct wlr_scene_node *node,
int x, int y, bool reverse, rediwm_item_iterator iterator, void *data) {
- if (!node->enabled) return true;
- if (node == &p->view->node) {
+ if (!node->enabled && node != &p->source->node) return true;
+ if (node == &p->source->node) {
for (struct wl_list *link = reverse ? p->paint.prev : p->paint.next;
link != &p->paint; link = reverse ? link->prev : link->next) {
struct group *g = wl_container_of(link, g, paint);
- if (!g->enabled || !g->view->node.enabled) continue;
+ if (!g->enabled) continue;
for (struct wl_list *leaf_link = reverse ? g->items.prev : g->items.next;
leaf_link != &g->items; leaf_link = reverse ? leaf_link->prev : leaf_link->next) {
struct leaf *l = wl_container_of(leaf_link, l, paint);
- if (l->item.enabled && !iterator(&l->item, l->view, data)) return false;
+ if (l->item.enabled && !iterator(&l->item, l->source, data)) return false;
}
}
return true;
@@ -1167,6 +1177,101 @@ static bool visit_items(struct rediwm_projection *p, struct wlr_scene_node *node
bool rediwm_projection_for_each_item(struct rediwm_projection *p, bool reverse, rediwm_item_iterator iterator, void *data) {
return visit_items(p, &p->scene->tree.node, 0, 0, reverse, iterator, data);
}
+// A node's opaque region (in its own units) as it lands on screen, never larger
+// than the real one.
+//
+// wlroots knows a client surface is opaque from its raw buffer's format (an XRGB
+// buffer covers the whole surface) or from the client's own opaque region, and
+// keeps that in the node's opaque region; the node's buffer is a wlr_client_buffer,
+// which reveals no pixel format, so its own flag is false for every client. A node
+// shown 1:1 uses the region as is. Otherwise each rectangle is scaled with the
+// node and pulled one pixel inward, so rounding and the filter's reach beyond an
+// opaque edge can never mark a translucent pixel opaque.
+void rediwm_mirror_opaque(pixman_region32_t *out, const pixman_region32_t *source, int source_width,
+ int source_height, int width, int height) {
+ int count = 0;
+ const pixman_box32_t *box = pixman_region32_rectangles((pixman_region32_t *)source, &count);
+ const bool exact = width == source_width && height == source_height;
+ for (int i = 0; i < count; i++) {
+ if (exact) {
+ pixman_region32_union_rect(out, out, box[i].x1, box[i].y1, box[i].x2 - box[i].x1, box[i].y2 - box[i].y1);
+ } else if (source_width > 0 && source_height > 0) {
+ const double sx = (double)width / source_width;
+ const double sy = (double)height / source_height;
+ const int x1 = (int)ceil(box[i].x1 * sx) + 1;
+ const int y1 = (int)ceil(box[i].y1 * sy) + 1;
+ const int x2 = (int)floor(box[i].x2 * sx) - 1;
+ const int y2 = (int)floor(box[i].y2 * sy) - 1;
+ if (x2 > x1 && y2 > y1) pixman_region32_union_rect(out, out, x1, y1, x2 - x1, y2 - y1);
+ }
+ }
+ pixman_region32_intersect_rect(out, out, 0, 0, width, height);
+}
+// ---- Hit testing (stage 6 of docs/plans/scene-graph.md) --------------------------
+// What wlr_scene_node_at gave on the world's view tree, from the graph: the items
+// from the top of the paint order down, each tested at the pixels it covers once
+// rounded, then against the window's shape and the source buffer's own input
+// region. The layout trees are still wlroots' to pick (D1).
+static struct wlr_scene_node *pick_world(struct rediwm_projection *p, double lx, double ly,
+ double *nx, double *ny) {
+ const double px = floor(lx), py = floor(ly);
+ for (struct wl_list *gl = p->paint.prev; gl != &p->paint; gl = gl->prev) {
+ struct group *g = wl_container_of(gl, g, paint);
+ if (!g->enabled) continue;
+ for (struct wl_list *ll = g->items.prev; ll != &g->items; ll = ll->prev) {
+ struct leaf *l = wl_container_of(ll, l, paint);
+ const struct rediwm_item *item = &l->item;
+ // An effect takes no input, and a leaf with no pixels once rounded is not shown.
+ if (!item->enabled || item->kind == REDIWM_ITEM_EFFECT) continue;
+ const struct rediwm_snap s = rediwm_edges_snap(item->edges);
+ if (s.width <= 0 || s.height <= 0 || px < s.x || px >= s.x + s.width || py < s.y ||
+ py >= s.y + s.height)
+ continue;
+ double x = lx - s.x, y = ly - s.y;
+ if (l->source->type == WLR_SCENE_NODE_BUFFER) {
+ x *= (double)item->width / s.width;
+ y *= (double)item->height / s.height;
+ // A window's rounded corners are transparent: a point the shape cuts away
+ // goes to what is below. The point is in source units; the shape is in
+ // layout space.
+ if (item->clip && item->width > 0 && item->height > 0) {
+ const struct rediwm_edges *e = &item->edges;
+ const double cx = e->x1 + x * (e->x2 - e->x1) / item->width;
+ const double cy = e->y1 + y * (e->y2 - e->y1) / item->height;
+ if (rediwm_clip_distance(item->clip, cx, cy) > 0) continue;
+ }
+ struct wlr_scene_buffer *source = wlr_scene_buffer_from_node(l->source);
+ if (source->point_accepts_input && !source->point_accepts_input(source, &x, &y)) continue;
+ }
+ *nx = x;
+ *ny = y;
+ return l->source;
+ }
+ }
+ return NULL;
+}
+static struct wlr_scene_node *pick_layout(struct wlr_scene_node *node, double lx, double ly,
+ double *nx, double *ny) {
+ return wlr_scene_node_at(node, lx, ly, nx, ny);
+}
+// The topmost node at a layout point and the point in its own coordinates, or NULL.
+// A hit in the world is the source node.
+struct wlr_scene_node *rediwm_projection_node_at(struct rediwm_projection *p, double lx, double ly,
+ double *nx, double *ny) {
+ struct wlr_scene_node *hit = NULL;
+ double x = 0, y = 0;
+ struct wl_list *children = &p->scene->tree.children;
+ for (struct wl_list *link = children->prev; link != children && !hit; link = link->prev) {
+ struct wlr_scene_node *child = wl_container_of(link, child, link);
+ if (child == &p->source->node) hit = pick_world(p, lx, ly, &x, &y);
+ else hit = pick_layout(child, lx, ly, &x, &y);
+ }
+ if (hit) {
+ if (nx) *nx = x;
+ if (ny) *ny = y;
+ }
+ return hit;
+}
static void watched_commit(struct wl_listener *listener, void *data) {
(void)data;
struct watched_surface *watch = wl_container_of(listener, watch, commit);
@@ -1210,6 +1315,7 @@ void rediwm_projection_destroy(struct rediwm_projection *p) {
struct group *g, *next_group;
wl_list_for_each_safe(g, next_group, &p->groups, link) destroy_group(g);
wl_list_remove(&p->new_surface.link);
+ pixman_region32_fini(&p->pending);
struct watched_surface *watch, *next;
wl_list_for_each_safe(watch, next, &p->surfaces, link)
watched_destroy(&watch->destroy, NULL);
diff --git a/src/projection.h b/src/projection.h
index 6f19a8d..2749c70 100644
--- a/src/projection.h
+++ b/src/projection.h
@@ -10,18 +10,19 @@ struct rediwm_projection;
struct rediwm_item;
struct rediwm_clip_spec;
// Synchronous traversal of the whole displayed graph (bottom-to-top unless
-// reverse is true). World
-// geometry comes from resolved items, never the view tree. `transport` owns
-// buffer resources and surface feedback until the legacy adapter is removed.
-// Callbacks must not mutate the scene; pointers are borrowed for this call.
+// reverse is true). World geometry comes from resolved items; `transport` is the
+// scene node that owns the item's buffer, texture and wait points: the source
+// node for the world, the node itself for the layout trees. Callbacks must not
+// mutate the scene; pointers are borrowed for this call.
typedef bool (*rediwm_item_iterator)(const struct rediwm_item *,
struct wlr_scene_node *transport, void *);
bool rediwm_projection_for_each_item(struct rediwm_projection *, bool reverse, rediwm_item_iterator, void *);
// Whether a commit changed how buffer pixels map onto the surface, so damage
// from before it cannot be combined with damage after it.
bool rediwm_surface_state_remapped(const struct wlr_surface_state *);
-struct rediwm_projection *rediwm_projection_create(struct wlr_scene_tree *,
- struct wlr_scene_tree *,
+// `source` is the world's tree, disabled so that wlroots ignores it; the
+// projection resolves it into the graph the output pass draws.
+struct rediwm_projection *rediwm_projection_create(struct wlr_scene_tree *source,
struct wlr_scene *);
void rediwm_projection_destroy(struct rediwm_projection *);
void rediwm_projection_sync(struct rediwm_projection *, double, double, double,
@@ -42,12 +43,14 @@ uint64_t rediwm_projection_damage_cursor(struct rediwm_projection *);
// Optional root subtree presented in layout coordinates, independent of the camera.
void rediwm_projection_sync_fixed(struct rediwm_projection *, double, double, double,
double, double, struct wlr_scene_tree *);
-struct wlr_scene_node *rediwm_projection_source(struct wlr_scene_node *);
+// The topmost node at a layout point, with the point in the node's own coordinates
+// (source units for a client surface), or NULL. Hits in the world are source nodes.
+struct wlr_scene_node *rediwm_projection_node_at(struct rediwm_projection *, double lx, double ly,
+ double *nx, double *ny);
// Window scale relative to its parent camera, around the frame origin.
bool rediwm_projection_set_tree_zoom(struct wlr_scene_node *, double);
// Relative presentation scale. Composes with parent camera and window zoom.
bool rediwm_projection_set_tree_scale(struct wlr_scene_node *, double);
-double rediwm_projection_node_zoom(struct wlr_scene_node *);
// One rounded-rectangle shape for every leaf under the tree, in the tree's own
// units and anchored at its origin; NULL removes it. Returns false for a size
// that is not positive or a radius or border that is negative or not finite.
@@ -79,5 +82,26 @@ bool rediwm_projection_present_owned(struct rediwm_projection *,
struct wlr_renderer *,
struct wlr_buffer *,
const struct pixman_region32 *);
-struct wlr_scene_node *rediwm_projection_node(struct rediwm_projection *,
- struct wlr_scene_node *);
+// A node's opaque region (in the node's own units, `source_width` by `source_height`)
+// as it lands on a box of `width` by `height` device pixels: never larger than the
+// real one, one pixel inward where the node is scaled.
+void rediwm_mirror_opaque(struct pixman_region32 *out, const struct pixman_region32 *source,
+ int source_width, int source_height, int width, int height);
+// Surface feedback (stage 6): each time the output pass builds, it reports how
+// much of every client surface nothing above hides, over the whole layout.
+// `begin` clears the last report, `note` reports one surface (a node of the
+// graph's items; anything but a client surface of the world is ignored) and
+// `end` works out and sends what changed: outputs entered and left, the primary
+// output.
+// What of an item nothing above hides, in layout space, as the pass saw it.
+struct wlr_scene_output;
+void rediwm_projection_note_visible(struct rediwm_projection *, struct wlr_scene_node *,
+ const struct pixman_region32 *visible);
+void rediwm_projection_feedback_begin(struct rediwm_projection *);
+void rediwm_projection_feedback_note(struct rediwm_projection *, struct wlr_scene_node *,
+ const struct pixman_region32 *visible);
+void rediwm_projection_feedback_end(struct rediwm_projection *);
+// Frame callbacks of the world's surfaces, beside wlr_scene_output_send_frame_done.
+struct timespec;
+void rediwm_projection_send_frame_done(struct rediwm_projection *, struct wlr_scene_output *,
+ struct timespec *now);
diff --git a/src/projection.zig b/src/projection.zig
index e16a8f9..32404d6 100644
--- a/src/projection.zig
+++ b/src/projection.zig
@@ -1,6 +1,7 @@
+const std = @import("std");
const wlr = @import("wlroots");
pub const Projection = opaque {
- extern fn rediwm_projection_create(source: *wlr.SceneTree, view: *wlr.SceneTree, scene: *wlr.Scene) ?*Projection;
+ extern fn rediwm_projection_create(source: *wlr.SceneTree, scene: *wlr.Scene) ?*Projection;
pub const create = rediwm_projection_create;
extern fn rediwm_projection_watch(projection: *Projection, compositor: *wlr.Compositor) void;
pub const watch = rediwm_projection_watch;
@@ -19,9 +20,15 @@ pub const Projection = opaque {
/// in place with `damage` when the renderer allows; null replaces all.
/// The caller may drop `buffer` afterwards. True when updated in place.
pub const presentOwned = rediwm_projection_present_owned;
+ extern fn rediwm_projection_node_at(projection: *Projection, lx: f64, ly: f64, nx: ?*f64, ny: ?*f64) ?*wlr.SceneNode;
+ /// The topmost node at a layout point (a source node for the world), and
+ /// the point in the node's own coordinates.
+ pub const nodeAt = rediwm_projection_node_at;
+ extern fn rediwm_projection_send_frame_done(projection: *Projection, output: *wlr.SceneOutput, now: *std.posix.timespec) void;
+ /// Frame callbacks of the world's client surfaces for one output, beside
+ /// `wlr.SceneOutput.sendFrameDone`, which reaches the layout trees only.
+ pub const sendFrameDone = rediwm_projection_send_frame_done;
};
-extern fn rediwm_projection_source(node: *wlr.SceneNode) *wlr.SceneNode;
-pub const source = rediwm_projection_source;
extern fn rediwm_projection_set_tree_zoom(node: *wlr.SceneNode, scale: f64) bool;
pub const setTreeZoom = rediwm_projection_set_tree_zoom;
extern fn rediwm_projection_set_tree_scale(node: *wlr.SceneNode, factor: f64) bool;
diff --git a/src/projection_test.c b/src/projection_test.c
index 6f85e14..8203145 100644
--- a/src/projection_test.c
+++ b/src/projection_test.c
@@ -39,46 +39,54 @@ static void clear_damage(struct wlr_scene_output *out) {
pixman_region32_clear(&out->damage_ring.current);
pixman_region32_clear(&out->private.pending_commit_damage);
}
+static struct leaf *find_leaf(struct rediwm_projection *p, struct wlr_scene_node *source) {
+ struct wlr_addon *addon = wlr_addon_find(&source->addons, p, &source_lookup_impl);
+ struct leaf *l;
+ return addon ? (l = wl_container_of(addon, l, source_lookup)) : NULL;
+}
+// Where the graph puts a leaf once rounded in layout space.
static void assert_position(struct rediwm_projection *p,
struct wlr_scene_node *source, int x, int y) {
- struct wlr_scene_node *view = rediwm_projection_node(p, source);
- assert(view && rediwm_projection_source(view) == source);
- int actual_x = 0, actual_y = 0;
- assert(wlr_scene_node_coords(view, &actual_x, &actual_y));
- assert(actual_x == x && actual_y == y);
-}
-static bool visible_at(struct wlr_scene_node *node, int x, int y) {
- return pixman_region32_contains_point(&node->private.visible, x, y, NULL);
+ struct leaf *l = find_leaf(p, source);
+ assert(l);
+ const struct rediwm_snap s = rediwm_edges_snap(l->item.edges);
+ assert(s.x == x && s.y == y);
}
-// Runs while a leaf's view node is being destroyed, after its group's view has
-// already finished and freed the group, and before the leaf's own teardown. A
-// leaf that still listed itself in that group would point into freed memory
-// here; no allocator reliably shows that (glibc does not poison small chunks on
-// free), so check the links themselves. Lookup, not a pointer: the leaf may
-// already be gone, which is why the caller counts the checks that ran.
+// Runs when a window's source tree is destroyed, after the projection dropped its
+// group and before the leaves are destroyed with their nodes. A leaf that still
+// listed itself in that group would point into freed memory here; no allocator
+// reliably shows that (glibc does not poison small chunks on free), so check
+// the links themselves.
struct probe {
- struct wlr_addon addon;
- struct wlr_scene_node *view;
+ struct wl_listener listener;
+ struct leaf *leaves[8];
+ size_t count;
int *checks;
};
-static void probe_destroy(struct wlr_addon *addon) {
- struct probe *probe = wl_container_of(addon, probe, addon);
- struct leaf *l = lookup(probe->view);
- if (l) {
- assert(l->paint.next == &l->paint && l->paint.prev == &l->paint);
+static void probe_destroy(struct wl_listener *listener, void *data) {
+ (void)data;
+ struct probe *probe = wl_container_of(listener, probe, listener);
+ for (size_t i = 0; i < probe->count; i++) {
+ assert(probe->leaves[i]->paint.next == &probe->leaves[i]->paint &&
+ probe->leaves[i]->paint.prev == &probe->leaves[i]->paint);
++*probe->checks;
}
- wlr_addon_finish(addon);
+ wl_list_remove(&listener->link);
free(probe);
}
-static const struct wlr_addon_interface probe_impl = {.name = "test probe", .destroy = probe_destroy};
-static void probe_leaf(struct leaf *l, int *checks) {
+static void probe_group(struct group *g, int *checks) {
struct probe *probe = calloc(1, sizeof(*probe));
assert(probe);
- probe->view = l->view;
+ struct leaf *l;
+ wl_list_for_each(l, &g->items, paint) {
+ assert(probe->count < 8);
+ probe->leaves[probe->count++] = l;
+ }
probe->checks = checks;
- wlr_addon_init(&probe->addon, &l->view->addons, probe, &probe_impl);
+ probe->listener.notify = probe_destroy;
+ wl_signal_add(&g->source->events.destroy, &probe->listener);
}
+static bool near(double a, double b) { return fabs(a - b) < 1e-9; }
static size_t items_of(struct group *g, struct leaf **out, size_t max) {
size_t n = 0;
struct leaf *l;
@@ -88,32 +96,18 @@ static size_t items_of(struct group *g, struct leaf **out, size_t max) {
}
return n;
}
-// Presented views are the graph's edges rounded in layout space and nothing
-// else: every group at the rounded origin, every leaf at its snapped rectangle
-// relative to it, and nothing but this pass's leaves in the lists.
+// What a sync leaves: every group and leaf in the lists was reached by this pass,
+// and nothing else is listed.
static void assert_presented(struct rediwm_projection *p) {
struct group *g;
wl_list_for_each(g, &p->paint, paint) {
- assert(g->seen && g->view->node.x == lround(g->x) &&
- g->view->node.y == lround(g->y) && g->view->node.enabled == g->enabled);
+ assert(g->seen);
struct leaf *l;
- wl_list_for_each(l, &g->items, paint) {
- assert(l->seen && l->view->parent == g->view);
- if (l->item.kind == REDIWM_ITEM_EFFECT)
- continue; // glass owns its view
- struct rediwm_snap s = rediwm_edges_snap(l->item.edges);
- assert(l->view->x == s.x - g->view->node.x && l->view->y == s.y - g->view->node.y);
- assert(l->view->enabled == (l->item.enabled && s.width > 0 && s.height > 0));
- if (l->item.kind != REDIWM_ITEM_RECT) {
- struct wlr_scene_buffer *v = wlr_scene_buffer_from_node(l->view);
- assert(v->dst_width == (s.width > 0 ? s.width : 1) &&
- v->dst_height == (s.height > 0 ? s.height : 1));
- }
- }
+ wl_list_for_each(l, &g->items, paint) assert(l->seen);
}
}
// The typed graph: complete and in paint order before anything is presented,
-// unrounded, and the only source of the view tree's geometry.
+// unrounded, and the only source of geometry.
struct graph_probe {
struct wlr_scene_node *transport;
struct rediwm_item expected;
@@ -130,8 +124,7 @@ static bool probe_item(const struct rediwm_item *item, struct wlr_scene_node *tr
}
static void test_graph(struct wlr_scene *scene) {
struct wlr_scene_tree *source = wlr_scene_tree_create(&scene->tree);
- struct wlr_scene_tree *view = wlr_scene_tree_create(&scene->tree);
- struct rediwm_projection *p = rediwm_projection_create(source, view, scene);
+ struct rediwm_projection *p = rediwm_projection_create(source, scene);
assert(p);
struct wlr_scene_tree *frame = wlr_scene_tree_create(source);
struct wlr_scene_tree *nested = wlr_scene_tree_create(frame);
@@ -179,16 +172,12 @@ static void test_graph(struct wlr_scene *scene) {
order[2] == glass_leaf);
assert(items_of(h, order, 8) == 1 && order[0] == overlay_leaf);
- // Resolving alone moves no view: they keep what the last present gave them.
- int before_x = client_leaf->view->x, before_y = client_leaf->view->y;
- int before_w = wlr_scene_buffer_from_node(client_leaf->view)->dst_width;
- int group_x = g->view->node.x;
- struct view_state applied = client_leaf->applied;
+ // Resolving alone shows nothing: what the last present showed is kept.
+ const struct rediwm_snap shown_before = client_leaf->shown;
const double z = .85, cx = 6.5, cy = -2.5, ox = -17, oy = 31;
resolve(p, z, cx, cy, ox, oy, NULL);
- assert(client_leaf->view->x == before_x && client_leaf->view->y == before_y);
- assert(wlr_scene_buffer_from_node(client_leaf->view)->dst_width == before_w);
- assert(g->view->node.x == group_x && view_state_equal(&client_leaf->applied, &applied));
+ assert(client_leaf->has_shown && client_leaf->shown.x == shown_before.x &&
+ client_leaf->shown.y == shown_before.y && client_leaf->shown.width == shown_before.width);
// The graph holds the exact, unrounded edges: the camera, then the window's
// zoom about its origin (37, 29), applied to the client at (29, 37) sized
@@ -201,14 +190,13 @@ static void test_graph(struct wlr_scene *scene) {
assert(fabs(e.x2 - e.x1 - z * w * 100) < 1e-9 && fabs(e.y2 - e.y1 - z * w * 60) < 1e-9);
assert(e.x1 != floor(e.x1) && e.y1 != floor(e.y1)); // Fractional until presented.
// The output consumer sees the newly resolved graph even before present:
- // stale view geometry must never become a second source of truth.
- struct graph_probe probe = {.transport = client_leaf->view, .expected = client_leaf->item};
+ // what was last shown must never become a second source of truth.
+ struct graph_probe probe = {.transport = client_leaf->source, .expected = client_leaf->item};
assert(rediwm_projection_for_each_item(p, false, probe_item, &probe) && probe.count == 1);
probe.count = 0;
assert(rediwm_projection_for_each_item(p, true, probe_item, &probe) && probe.count == 1);
assert(fabs(client_leaf->item.scale - z * w) < 1e-12);
assert(client_leaf->item.width == 100 && client_leaf->item.height == 60);
- assert(fabs(g->x - (z * 37 + tx)) < 1e-9 && fabs(g->y - (z * 29 + ty)) < 1e-9);
// Edges, not origin and size: a size is the difference of two rounded edges.
const struct rediwm_snap s = rediwm_edges_snap(e);
assert(s.width == lround(e.x2) - lround(e.x1) && s.x == lround(e.x1));
@@ -223,18 +211,22 @@ static void test_graph(struct wlr_scene *scene) {
assert(rediwm_projection_set_tree_zoom(&frame->node, .85));
wlr_scene_buffer_set_filter_mode(client, WLR_SCALE_FILTER_BILINEAR);
- // Presenting applies exactly that graph, and only that graph.
+ // Presenting shows exactly that graph, and only that graph.
present(p);
assert_presented(p);
- assert(g->view->node.x == lround(g->x));
- assert(glass_leaf->view->x == 0 && !glass_leaf->has_applied); // Left to glass.
+ {
+ const struct rediwm_snap now = rediwm_edges_snap(client_leaf->item.edges);
+ assert(client_leaf->shown.x == now.x && client_leaf->shown.y == now.y &&
+ client_leaf->shown.width == now.width && client_leaf->shown.height == now.height);
+ }
const double zooms[] = {.25, .5, .85, 1, 1.25};
for (size_t i = 0; i < sizeof(zooms) / sizeof(zooms[0]); ++i)
for (int x = -9; x <= 9; x += 3) {
wlr_scene_node_set_position(&frame->node, x * 7, -x * 5);
rediwm_projection_sync_fixed(p, zooms[i], x * .5, -x * .25, ox, oy, other);
assert_presented(p);
- assert(h->x == other->node.x && h->y == other->node.y); // Fixed: no camera.
+ // Fixed: no camera.
+ assert(near(overlay_leaf->item.edges.x1, other->node.x) && near(overlay_leaf->item.edges.y1, other->node.y));
}
wlr_scene_node_set_position(&frame->node, 37, 29);
@@ -244,14 +236,13 @@ static void test_graph(struct wlr_scene *scene) {
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
assert(items_of(g, order, 8) == 3 && order[0] == client_leaf && order[1] == glass_leaf &&
order[2] == border_leaf);
- assert(border_leaf->view->link.prev == &glass_leaf->view->link);
wlr_scene_node_reparent(&client->node, other);
wlr_scene_node_set_enabled(&other->node, false);
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
assert(items_of(g, order, 8) == 2 && order[0] == glass_leaf && order[1] == border_leaf);
assert(items_of(h, order, 8) == 2 && order[0] == overlay_leaf && order[1] == client_leaf);
assert(!h->enabled && !client_leaf->item.enabled && !overlay_leaf->item.enabled);
- assert(border_leaf->item.enabled && !h->view->node.enabled);
+ assert(border_leaf->item.enabled);
assert_presented(p);
wlr_scene_node_set_enabled(&other->node, true);
@@ -259,8 +250,8 @@ static void test_graph(struct wlr_scene *scene) {
wlr_scene_node_reparent(&other->node, &scene->tree);
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
assert(wl_list_length(&p->paint) == 1 && wl_list_empty(&h->items));
- assert(!h->seen && !h->view->node.enabled && !client_leaf->seen && !client_leaf->view->enabled);
- assert(client_leaf->paint.next == &client_leaf->paint && !client_leaf->has_applied);
+ assert(!h->seen && !client_leaf->seen && !client_leaf->has_shown);
+ assert(client_leaf->paint.next == &client_leaf->paint);
wlr_scene_node_reparent(&other->node, source);
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
assert(wl_list_length(&p->paint) == 2 && wl_list_length(&h->items) == 2);
@@ -276,9 +267,8 @@ static void test_graph(struct wlr_scene *scene) {
assert(wl_list_length(&g->items) == 2);
effect_node = NULL;
int checks = 0;
- struct leaf *listed;
- wl_list_for_each(listed, &g->items, paint) probe_leaf(listed, &checks);
- wlr_scene_node_destroy(&view->node); // View first: the group's addons finish first.
+ probe_group(g, &checks);
+ wlr_scene_node_destroy(&frame->node); // The group goes first, then its leaves.
assert(checks == 2); // Both leaves were checked after the group was freed.
assert(wl_list_empty(&p->groups) && wl_list_empty(&p->leaves) && wl_list_empty(&p->paint));
rediwm_projection_destroy(p);
@@ -287,7 +277,6 @@ static void test_graph(struct wlr_scene *scene) {
wlr_buffer_drop(glass_buffer);
}
// Stage 4: the clip shape. Pure geometry first, with no scene at all.
-static bool near(double a, double b) { return fabs(a - b) < 1e-9; }
static void test_clip_geometry(void) {
// Resolve composes the camera and the window's zoom into the transform, takes
// the rectangle's edges from it, scales radius and border, and caps a radius
@@ -407,8 +396,7 @@ static void test_clip_opaque(void) {
}
static void test_clip_projection(struct wlr_scene *scene) {
struct wlr_scene_tree *source = wlr_scene_tree_create(&scene->tree);
- struct wlr_scene_tree *view = wlr_scene_tree_create(&scene->tree);
- struct rediwm_projection *p = rediwm_projection_create(source, view, scene);
+ struct rediwm_projection *p = rediwm_projection_create(source, scene);
assert(p);
struct wlr_scene_tree *frame = wlr_scene_tree_create(source);
struct wlr_scene_tree *nested = wlr_scene_tree_create(frame);
@@ -526,7 +514,6 @@ static void test_clip_projection(struct wlr_scene *scene) {
effect_node = NULL;
wlr_scene_node_destroy(&frame->node);
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- wlr_scene_node_destroy(&view->node);
rediwm_projection_destroy(p);
wlr_scene_node_destroy(&source->node);
wlr_buffer_drop(buffer);
@@ -545,8 +532,7 @@ static bool layout_damaged(struct wlr_scene_output *out, double x, double y) {
}
static void test_clip_output(struct wlr_scene *scene, struct wlr_scene_output *out) {
struct wlr_scene_tree *source = wlr_scene_tree_create(&scene->tree);
- struct wlr_scene_tree *view = wlr_scene_tree_create(&scene->tree);
- struct rediwm_projection *p = rediwm_projection_create(source, view, scene);
+ struct rediwm_projection *p = rediwm_projection_create(source, scene);
assert(p);
struct wlr_scene_tree *under_tree = wlr_scene_tree_create(source);
struct wlr_scene_tree *frame = wlr_scene_tree_create(source);
@@ -567,18 +553,18 @@ static void test_clip_output(struct wlr_scene *scene, struct wlr_scene_output *o
// Points inside the window reach it; the corner pixel, which the arc cuts away,
// goes to the window below, and so does the one just outside the box.
double nx, ny;
- struct wlr_scene_node *hit = wlr_scene_node_at(&view->node, 360, 240, &nx, &ny);
- assert(hit == client_leaf->view);
- hit = wlr_scene_node_at(&view->node, 300.5, 200.5, &nx, &ny);
- assert(hit == under_leaf->view);
- hit = wlr_scene_node_at(&view->node, 419.5, 279.5, &nx, &ny); // bottom-right corner
- assert(hit == under_leaf->view);
- hit = wlr_scene_node_at(&view->node, 310.5, 200.5, &nx, &ny); // on the straight edge
- assert(hit == client_leaf->view);
+ struct wlr_scene_node *hit = rediwm_projection_node_at(p, 360, 240, &nx, &ny);
+ assert(hit == client_leaf->source);
+ hit = rediwm_projection_node_at(p, 300.5, 200.5, &nx, &ny);
+ assert(hit == under_leaf->source);
+ hit = rediwm_projection_node_at(p, 419.5, 279.5, &nx, &ny); // bottom-right corner
+ assert(hit == under_leaf->source);
+ hit = rediwm_projection_node_at(p, 310.5, 200.5, &nx, &ny); // on the straight edge
+ assert(hit == client_leaf->source);
// Without a shape the corner is the window's again.
assert(rediwm_projection_set_tree_clip(&frame->node, NULL));
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- assert(wlr_scene_node_at(&view->node, 300.5, 200.5, &nx, &ny) == client_leaf->view);
+ assert(rediwm_projection_node_at(p, 300.5, 200.5, &nx, &ny) == client_leaf->source);
clear_damage(out);
// A shape appearing, a different border colour, and the shape going away each
@@ -629,7 +615,6 @@ static void test_clip_output(struct wlr_scene *scene, struct wlr_scene_output *o
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
assert(!pixman_region32_not_empty(&out->damage_ring.current));
- wlr_scene_node_destroy(&view->node);
rediwm_projection_destroy(p);
wlr_scene_node_destroy(&source->node);
wlr_buffer_drop(under_buffer);
@@ -640,8 +625,7 @@ static void test_clip_output(struct wlr_scene *scene, struct wlr_scene_output *o
// hidden with its window, or goes away, and never when nothing changed.
static void test_shadow_output(struct wlr_scene *scene, struct wlr_scene_output *out) {
struct wlr_scene_tree *source = wlr_scene_tree_create(&scene->tree);
- struct wlr_scene_tree *view = wlr_scene_tree_create(&scene->tree);
- struct rediwm_projection *p = rediwm_projection_create(source, view, scene);
+ struct rediwm_projection *p = rediwm_projection_create(source, scene);
assert(p);
struct wlr_scene_tree *frame = wlr_scene_tree_create(source);
struct wlr_scene_tree *shadow_tree = wlr_scene_tree_create(frame);
@@ -691,7 +675,6 @@ static void test_shadow_output(struct wlr_scene *scene, struct wlr_scene_output
assert(layout_damaged(out, 130, 140));
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- wlr_scene_node_destroy(&view->node);
rediwm_projection_destroy(p);
wlr_scene_node_destroy(&source->node);
}
@@ -715,8 +698,7 @@ static bool event_is(const struct rediwm_damage_event *e, uint64_t leaf, int x,
}
static void test_damage_events(struct wlr_scene *scene) {
struct wlr_scene_tree *source = wlr_scene_tree_create(&scene->tree);
- struct wlr_scene_tree *view = wlr_scene_tree_create(&scene->tree);
- struct rediwm_projection *p = rediwm_projection_create(source, view, scene);
+ struct rediwm_projection *p = rediwm_projection_create(source, scene);
assert(p);
uint64_t cursor = rediwm_projection_damage_cursor(p), other = cursor;
struct wlr_scene_tree *window = wlr_scene_tree_create(source);
@@ -803,73 +785,63 @@ static void test_damage_events(struct wlr_scene *scene) {
assert(events_since(p, &stale, &complete).count == 0 && complete);
pixman_region32_fini(&damage);
- wlr_scene_node_destroy(&view->node);
rediwm_projection_destroy(p);
wlr_scene_node_destroy(&source->node);
wlr_buffer_drop(buffer);
}
-// A client surface's opaque region has to reach its view, or nothing below the
-// window is ever culled. The buffers here reveal no format, like a
-// wlr_client_buffer, so only the node's own region can say they are opaque.
-static void test_opaque(struct wlr_scene *scene) {
- struct wlr_scene_tree *source = wlr_scene_tree_create(&scene->tree);
- struct wlr_scene_tree *view = wlr_scene_tree_create(&scene->tree);
- struct rediwm_projection *p = rediwm_projection_create(source, view, scene);
- assert(p);
- struct wlr_buffer *below_buffer = buffer_create(), *client_buffer = buffer_create();
- struct wlr_scene_buffer *below = wlr_scene_buffer_create(source, below_buffer);
- struct wlr_scene_buffer *client = wlr_scene_buffer_create(source, client_buffer);
- assert(below && client);
- wlr_scene_node_set_position(&below->node, 20, 10);
- wlr_scene_node_set_position(&client->node, 20, 10);
- rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- struct wlr_scene_node *below_view = rediwm_projection_node(p, &below->node);
- assert(below_view && visible_at(below_view, 100, 60));
-
- pixman_region32_t region;
- pixman_region32_init_rect(&region, 0, 0, 200, 120);
- wlr_scene_buffer_set_opaque_region(client, &region);
- rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- assert(!visible_at(below_view, 100, 60) && !visible_at(below_view, 21, 11));
+// The output pass hides what a client's opaque region covers, from the region as
+// the surface node keeps it. The buffers of a client reveal no format, like a
+// wlr_client_buffer, so only the node's own region can say they are opaque: it
+// has to land on screen exactly, or one pixel inside where it is scaled.
+static void test_opaque(void) {
+ pixman_region32_t source, out;
+ pixman_region32_init_rect(&source, 50, 30, 100, 60);
+ pixman_region32_init(&out);
+ // Shown 1:1, a region is used as is, clipped to the box.
+ rediwm_mirror_opaque(&out, &source, 200, 120, 200, 120);
+ assert(pixman_region32_n_rects(&out) == 1);
+ assert(pixman_region32_contains_point(&out, 50, 30, NULL) && pixman_region32_contains_point(&out, 149, 89, NULL));
+ assert(!pixman_region32_contains_point(&out, 49, 30, NULL) && !pixman_region32_contains_point(&out, 150, 89, NULL));
+ pixman_region32_clear(&out);
+ pixman_region32_clear(&source);
+ pixman_region32_union_rect(&source, &source, 0, 0, 300, 300);
+ rediwm_mirror_opaque(&out, &source, 200, 120, 200, 120);
+ assert(pixman_region32_contains_point(&out, 199, 119, NULL) && !pixman_region32_contains_point(&out, 200, 0, NULL));
+ // Nothing says nothing.
+ pixman_region32_clear(&out);
+ pixman_region32_clear(&source);
+ rediwm_mirror_opaque(&out, &source, 200, 120, 200, 120);
+ assert(!pixman_region32_not_empty(&out));
- // Only the client's own region occludes, and a changed region is applied
- // although the view's geometry did not change.
- pixman_region32_clear(&region);
- pixman_region32_union_rect(&region, &region, 50, 30, 100, 60);
- wlr_scene_buffer_set_opaque_region(client, &region);
- rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- assert(!visible_at(below_view, 100, 60) && !visible_at(below_view, 70, 40));
- assert(visible_at(below_view, 30, 20) && visible_at(below_view, 215, 125));
- pixman_region32_clear(&region);
- wlr_scene_buffer_set_opaque_region(client, &region);
- rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- assert(visible_at(below_view, 100, 60));
-
- // Scaled with the view and pulled one pixel in: the middle is culled, the
- // edge pixels, which the filter may blend with what is outside, are drawn.
- pixman_region32_union_rect(&region, &region, 0, 0, 200, 120);
- wlr_scene_buffer_set_opaque_region(client, &region);
- rediwm_projection_sync(p, .5, 0, 0, 0, 0);
- assert(!visible_at(below_view, 60, 35));
- assert(visible_at(below_view, 10, 5) && visible_at(below_view, 109, 64));
-
- // A translucent node hides nothing, whatever its region says.
- wlr_scene_buffer_set_opacity(client, .5f);
- rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- assert(visible_at(below_view, 100, 60));
- wlr_scene_buffer_set_opacity(client, 1.f);
- rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- assert(!visible_at(below_view, 100, 60));
-
- pixman_region32_fini(&region);
- rediwm_projection_destroy(p);
- wlr_buffer_drop(below_buffer);
- wlr_buffer_drop(client_buffer);
+ // Scaled with the node and pulled one pixel in: the middle is opaque, the edge
+ // pixels, which the filter may blend with what is outside, are not.
+ pixman_region32_union_rect(&source, &source, 0, 0, 200, 120);
+ rediwm_mirror_opaque(&out, &source, 200, 120, 100, 60);
+ assert(pixman_region32_contains_point(&out, 40, 25, NULL));
+ assert(!pixman_region32_contains_point(&out, 0, 0, NULL) && !pixman_region32_contains_point(&out, 99, 59, NULL));
+ assert(pixman_region32_contains_point(&out, 1, 1, NULL) && pixman_region32_contains_point(&out, 98, 58, NULL));
+ // A rectangle thinner than the inset vanishes.
+ pixman_region32_clear(&out);
+ pixman_region32_clear(&source);
+ pixman_region32_union_rect(&source, &source, 10, 10, 2, 2);
+ rediwm_mirror_opaque(&out, &source, 200, 120, 100, 60);
+ assert(!pixman_region32_not_empty(&out));
+ // A node with no size shows no region.
+ pixman_region32_union_rect(&source, &source, 0, 0, 50, 50);
+ rediwm_mirror_opaque(&out, &source, 0, 0, 100, 60);
+ assert(!pixman_region32_not_empty(&out));
+ pixman_region32_fini(&source);
+ pixman_region32_fini(&out);
+}
+static bool in_group(struct group *g, struct leaf *l) {
+ struct leaf *listed;
+ wl_list_for_each(listed, &g->items, paint) if (listed == l) return true;
+ return false;
}
+static int snap_width(struct leaf *l) { return rediwm_edges_snap(l->item.edges).width; }
static void test_groups(struct wlr_scene *scene, struct wlr_scene_output *out) {
struct wlr_scene_tree *source = wlr_scene_tree_create(&scene->tree);
- struct wlr_scene_tree *view = wlr_scene_tree_create(&scene->tree);
- struct rediwm_projection *p = rediwm_projection_create(source, view, scene);
+ struct rediwm_projection *p = rediwm_projection_create(source, scene);
assert(p);
struct wlr_scene_tree *frame = wlr_scene_tree_create(source);
struct wlr_scene_tree *nested = wlr_scene_tree_create(frame);
@@ -889,17 +861,15 @@ static void test_groups(struct wlr_scene *scene, struct wlr_scene_output *out) {
struct group *g = get_group(p, &frame->node);
struct group *h = get_group(p, &other->node);
struct leaf *l = get_leaf(p, &client->node);
- assert(l->view->parent == g->view);
- assert(get_leaf(p, &border->node)->view->parent == g->view);
- assert(wl_list_length(&view->children) == 2);
+ struct leaf *border_leaf = get_leaf(p, &border->node);
+ assert(in_group(g, l) && in_group(g, border_leaf) && in_group(h, get_leaf(p, &overlay->node)));
+ assert(wl_list_length(&p->paint) == 2);
assert_position(p, &client->node, 29, 37);
assert_position(p, &border->node, 35, 26);
- int local_x = l->view->x, local_y = l->view->y;
clear_damage(out);
wlr_scene_node_set_position(&frame->node, 83, 71);
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- // Ordinary movement changes one group origin; child setters are no-ops.
- assert(l->view->x == local_x && l->view->y == local_y);
+ // Ordinary movement moves every leaf of the group.
assert_position(p, &client->node, 75, 79);
assert_position(p, &border->node, 81, 68);
assert(damaged(out, 50, 60) && damaged(out, 200, 150));
@@ -911,7 +881,7 @@ static void test_groups(struct wlr_scene *scene, struct wlr_scene_output *out) {
rediwm_projection_sync_fixed(p, .5, 10, 20, 0, 0, frame);
assert_position(p, &client->node, 75, 79);
assert_position(p, &overlay->node, 40, 20);
- assert(wlr_scene_buffer_from_node(l->view)->dst_width == 200);
+ assert(snap_width(l) == 200);
rediwm_projection_sync(p, .5, 10, 20, 0, 0);
assert_position(p, &client->node, 33, 30);
@@ -928,9 +898,8 @@ static void test_groups(struct wlr_scene *scene, struct wlr_scene_output *out) {
lround(z * (-x + 8) + ty));
assert_position(p, &border->node, lround(z * (x - 2) + tx),
lround(z * (-x - 3) + ty));
- struct wlr_scene_buffer *v = wlr_scene_buffer_from_node(l->view);
- assert(v->dst_width == lround(z * (x - 8 + 200) + tx) -
- lround(z * (x - 8) + tx));
+ assert(snap_width(l) == lround(z * (x - 8 + 200) + tx) -
+ lround(z * (x - 8) + tx));
}
}
// Window zoom multiplies the camera scale while preserving its world origin.
@@ -940,69 +909,69 @@ static void test_groups(struct wlr_scene *scene, struct wlr_scene_output *out) {
rediwm_projection_sync(p, .5, 3, -7, 0, 0);
assert_position(p, &client->node, lround(.5 * -17 - 1.5 + (.85 * .5) * -8),
lround(.5 * 23 + 3.5 + (.85 * .5) * 8));
- assert(rediwm_projection_node_zoom(l->view) == (.85 * .5));
+ assert(l->item.scale == (.85 * .5));
// A relative tree scale composes with camera and window zoom, preserving origin.
assert(rediwm_projection_set_tree_scale(&nested->node, .5));
rediwm_projection_sync(p, .5, 3, -7, 0, 0);
- assert(fabs(rediwm_projection_node_zoom(l->view) - ((.85 * .5) * .5)) < .0001);
+ assert(fabs(l->item.scale - ((.85 * .5) * .5)) < .0001);
assert_position(p, &client->node, lround(.5 * -17 - 1.5 + (.85 * .5) * -12 + (.85 * .5) * .5 * 4),
lround(.5 * 23 + 3.5 + (.85 * .5) * 5 + (.85 * .5) * .5 * 3));
assert(rediwm_projection_set_tree_scale(&nested->node, 1.0));
rediwm_projection_sync(p, .5, 3, -7, 0, 0);
- assert(fabs(rediwm_projection_node_zoom(l->view) - (.85 * .5)) < .0001);
+ assert(fabs(l->item.scale - (.85 * .5)) < .0001);
assert(rediwm_projection_set_tree_zoom(&frame->node, 1.0));
// Reorder a whole window and a leaf within it, retaining source paint order.
wlr_scene_node_raise_to_top(&frame->node);
wlr_scene_node_raise_to_top(&nested->node);
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- assert(g->view->node.link.prev == &h->view->node.link);
- assert(l->view->link.prev == &get_leaf(p, &border->node)->view->link);
- // Input lookup and surface routing remain attached to the leaf when a
- // subsurface changes source root, rather than retaining a stale group.
+ struct leaf *order[8];
+ assert(p->paint.next == &h->paint && h->paint.next == &g->paint && g->paint.next == &p->paint);
+ assert(items_of(g, order, 8) == 2 && order[0] == border_leaf && order[1] == l);
+ // The source node and its input stay attached to the leaf when a subsurface
+ // changes source root, rather than retaining a stale group.
wlr_scene_node_reparent(&client->node, other);
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- assert(l->view->parent == h->view);
+ assert(in_group(h, l) && !in_group(g, l));
assert_position(p, &client->node, 94, 63);
- double input_x = 40, input_y = 24;
- assert(accepts(wlr_scene_buffer_from_node(l->view), &input_x, &input_y));
+ double input_x, input_y;
+ assert(rediwm_projection_node_at(p, 94 + 40, 63 + 24, &input_x, &input_y) == &client->node);
assert(input_x == 40 && input_y == 24);
wlr_scene_node_set_enabled(&other->node, false);
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- int x = 0, y = 0;
- assert(!wlr_scene_node_coords(l->view, &x, &y));
+ assert(!l->item.enabled && !rediwm_projection_node_at(p, 94 + 40, 63 + 24, &input_x, &input_y));
wlr_scene_node_set_enabled(&other->node, true);
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
assert_position(p, &client->node, 94, 63);
// A former source root can become nested, leave the projected tree, and
- // return. Its unused group must hide while its leaves change group, and
+ // return. Its unused group is not reached while its leaves change group, and
// neither its former position nor window zoom may leak into other leaves.
wlr_scene_node_reparent(&frame->node, other);
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- assert(!g->view->node.enabled);
- assert(get_leaf(p, &border->node)->view->parent == h->view);
+ assert(!g->seen);
+ assert(in_group(h, border_leaf));
assert_position(p, &border->node, 71, 80);
assert_position(p, &client->node, 94, 63);
wlr_scene_node_reparent(&frame->node, &scene->tree);
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- assert(!wlr_scene_node_coords(get_leaf(p, &border->node)->view, &x, &y));
+ assert(!border_leaf->seen);
wlr_scene_node_reparent(&frame->node, source);
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- assert(g->view->node.enabled);
- assert(get_leaf(p, &border->node)->view->parent == g->view);
+ assert(g->seen);
+ assert(in_group(g, border_leaf));
assert_position(p, &border->node, -19, 20);
- // Destruction can precede synchronization after reparenting. The old view
- // group still owns this leaf, but the surviving source must be recreatable.
+ // A leaf moved out of a window's tree before the tree is destroyed keeps its
+ // leaf: the surviving source node needs nothing recreated.
struct wlr_scene_tree *temporary = wlr_scene_tree_create(source);
struct wlr_scene_rect *survivor = wlr_scene_rect_create(temporary, 12, 12, color);
assert(temporary && survivor);
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
wlr_scene_node_reparent(&survivor->node, other);
wlr_scene_node_destroy(&temporary->node);
- assert(!rediwm_projection_node(p, &survivor->node));
+ assert(find_leaf(p, &survivor->node));
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
assert_position(p, &survivor->node, 90, 60);
wlr_scene_node_destroy(&survivor->node);
@@ -1014,21 +983,195 @@ static void test_groups(struct wlr_scene *scene, struct wlr_scene_output *out) {
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
wlr_scene_node_reparent(&direct->node, other);
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- assert(get_leaf(p, &direct->node)->view->parent == h->view);
+ assert(in_group(h, get_leaf(p, &direct->node)));
wlr_scene_node_destroy(&direct->node);
assert(wl_list_length(&p->groups) == 2 && wl_list_length(&p->leaves) == 3);
- // Source-first teardown destroys its group without dangling leaf listeners;
- // view-first teardown removes every adapter before the source is destroyed.
+ // Source-first teardown destroys its group without dangling leaf listeners.
wlr_scene_node_destroy(&frame->node);
assert(wl_list_length(&p->groups) == 1 && wl_list_length(&p->leaves) == 2);
rediwm_projection_sync(p, 1, 0, 0, 0, 0);
- wlr_scene_node_destroy(&view->node);
+ wlr_scene_node_destroy(&other->node);
assert(wl_list_empty(&p->groups) && wl_list_empty(&p->leaves));
rediwm_projection_destroy(p);
wlr_scene_node_destroy(&source->node);
wlr_buffer_drop(buffer);
}
+// Stage 6b: the screen's damage comes from the graph. A restack damages what
+// changed order, a change of what a leaf itself shows is cut to what was visible
+// of it at the last build, and a window going away is damaged at once.
+static void test_graph_damage(struct wlr_scene *scene, struct wlr_scene_output *out) {
+ struct wlr_scene_tree *source = wlr_scene_tree_create(&scene->tree);
+ struct rediwm_projection *p = rediwm_projection_create(source, scene);
+ assert(p);
+ struct wlr_buffer *buffer = buffer_create(); // 200x120
+ struct wlr_scene_tree *frame_a = wlr_scene_tree_create(source);
+ struct wlr_scene_tree *frame_b = wlr_scene_tree_create(source);
+ struct wlr_scene_buffer *a = wlr_scene_buffer_create(frame_a, buffer);
+ struct wlr_scene_buffer *b = wlr_scene_buffer_create(frame_b, buffer);
+ wlr_scene_node_set_position(&frame_a->node, 20, 20);
+ wlr_scene_node_set_position(&frame_b->node, 60, 40);
+ rediwm_projection_sync(p, 1, 0, 0, 0, 0);
+ clear_damage(out);
+
+ // Raising the window below changes the pixels where the two overlap, and says
+ // nothing about the rest of the screen.
+ wlr_scene_node_raise_to_top(&frame_a->node);
+ rediwm_projection_sync(p, 1, 0, 0, 0, 0);
+ assert(layout_damaged(out, 100, 60) && layout_damaged(out, 210, 130));
+ assert(!layout_damaged(out, 350, 300) && !layout_damaged(out, 5, 5));
+ clear_damage(out);
+ rediwm_projection_sync(p, 1, 0, 0, 0, 0); // Same order: nothing.
+ assert(!pixman_region32_not_empty(&out->damage_ring.current));
+
+ // What changes only what a leaf shows is cut to what of it was visible at the
+ // last build: the right part of `a` was hidden, so its change is not damaged.
+ struct leaf *la = get_leaf(p, &a->node), *lb = get_leaf(p, &b->node);
+ pixman_region32_t visible;
+ pixman_region32_init_rect(&visible, 20, 20, 50, 120);
+ rediwm_projection_note_visible(p, &a->node, &visible);
+ rediwm_projection_damage_buffer(p, &a->node, NULL);
+ rediwm_projection_sync(p, 1, 0, 0, 0, 0);
+ assert(layout_damaged(out, 30, 60) && !layout_damaged(out, 150, 60));
+ clear_damage(out);
+ // Nothing visible, nothing to damage; a leaf the pass never saw is damaged whole.
+ pixman_region32_clear(&visible);
+ rediwm_projection_note_visible(p, &a->node, &visible);
+ rediwm_projection_damage_buffer(p, &a->node, NULL);
+ rediwm_projection_sync(p, 1, 0, 0, 0, 0);
+ assert(!pixman_region32_not_empty(&out->damage_ring.current));
+ assert(!lb->has_visible);
+ rediwm_projection_damage_buffer(p, &b->node, NULL);
+ rediwm_projection_sync(p, 1, 0, 0, 0, 0);
+ assert(layout_damaged(out, 70, 50) && layout_damaged(out, 250, 150));
+ clear_damage(out);
+ // A leaf that is moved damages where it was only where it was visible, and
+ // where it is whatever the last build saw.
+ pixman_region32_init_rect(&visible, 60, 40, 40, 120);
+ rediwm_projection_note_visible(p, &b->node, &visible);
+ wlr_scene_node_set_position(&frame_b->node, 200, 150);
+ rediwm_projection_sync(p, 1, 0, 0, 0, 0);
+ assert(layout_damaged(out, 70, 60) && !layout_damaged(out, 150, 60)); // old box, cut
+ assert(layout_damaged(out, 250, 200)); // new box, whole
+ clear_damage(out);
+ (void)la;
+
+ // A window going away damages what it showed without waiting for a sync: a
+ // capture can build a frame before the next one.
+ rediwm_projection_note_visible(p, &a->node, &(pixman_region32_t){.extents = {20, 20, 220, 140}, .data = NULL});
+ wlr_scene_node_destroy(&frame_a->node);
+ assert(layout_damaged(out, 30, 30) && layout_damaged(out, 210, 130));
+ pixman_region32_fini(&visible);
+ rediwm_projection_destroy(p);
+ wlr_scene_node_destroy(&source->node);
+ wlr_buffer_drop(buffer);
+}
+// Stage 6a: what the output pass reports of a surface becomes the signals wlroots
+// would have sent. Two outputs side by side, a node over the seam.
+static int outputs_updates, frame_dones, update_size;
+static struct wlr_scene_output *update_active[4];
+static void on_outputs_update(struct wl_listener *listener, void *data) {
+ (void)listener;
+ const struct wlr_scene_outputs_update_event *event = data;
+ outputs_updates++;
+ update_size = (int)event->size;
+ for (size_t i = 0; i < event->size && i < 4; i++) update_active[i] = event->active[i];
+}
+static void on_frame_done(struct wl_listener *listener, void *data) {
+ (void)listener;
+ (void)data;
+ frame_dones++;
+}
+static void report(struct rediwm_projection *p, struct wlr_scene_node *node, int x, int y, int w, int h) {
+ pixman_region32_t visible;
+ pixman_region32_init(&visible);
+ if (w > 0) pixman_region32_union_rect(&visible, &visible, x, y, w, h);
+ rediwm_projection_feedback_begin(p);
+ rediwm_projection_feedback_note(p, node, &visible);
+ rediwm_projection_feedback_end(p);
+ pixman_region32_fini(&visible);
+}
+static void test_feedback(struct wlr_scene *scene, struct wlr_backend *backend, struct wlr_scene_output *left,
+ struct wlr_output *left_output) {
+ struct wlr_output *right_output = wlr_headless_add_output(backend, 320, 240);
+ assert(right_output);
+ struct wlr_output_state state;
+ wlr_output_state_init(&state);
+ wlr_output_state_set_enabled(&state, true);
+ assert(wlr_output_commit_state(right_output, &state));
+ wlr_output_state_finish(&state);
+ struct wlr_scene_output *right = wlr_scene_output_create(scene, right_output);
+ assert(right);
+ int seam = 0, unused = 0;
+ wlr_output_effective_resolution(left_output, &seam, &unused);
+ wlr_scene_output_set_position(right, seam, 0);
+
+ struct wlr_scene_tree *source = wlr_scene_tree_create(&scene->tree);
+ struct rediwm_projection *p = rediwm_projection_create(source, scene);
+ assert(p);
+ struct wlr_buffer *buffer = buffer_create();
+ struct wlr_scene_buffer *node = wlr_scene_buffer_create(source, buffer);
+ wlr_scene_node_set_position(&node->node, seam - 26, 50);
+ rediwm_projection_sync(p, 1, 0, 0, 0, 0);
+ struct leaf *l = get_leaf(p, &node->node);
+ l->feedback = calloc(1, sizeof(*l->feedback));
+ assert(l->feedback);
+ l->feedback->leaf = l;
+ wl_list_insert(&p->feedback, &l->feedback->link);
+ struct wl_listener updated = {.notify = on_outputs_update}, done = {.notify = on_frame_done};
+ wl_signal_add(&node->events.outputs_update, &updated);
+ wl_signal_add(&node->events.frame_done, &done);
+ struct timespec now = {0};
+
+ // Over the seam: both outputs show more than a tenth, the one with most is primary.
+ report(p, &node->node, seam - 26, 50, 200, 100); // 26 columns left, 174 right
+ assert(outputs_updates == 1 && update_size == 2 && l->feedback->primary == right);
+ assert(l->feedback->active == (1ull << left->private.index | 1ull << right->private.index));
+ report(p, &node->node, seam - 26, 50, 200, 100);
+ assert(outputs_updates == 1); // Unchanged: no signal.
+ // A sliver on the other side is ignored (10 % rule): 2 of 28 columns.
+ report(p, &node->node, seam - 26, 50, 28, 100);
+ assert(outputs_updates == 2 && update_size == 1 && update_active[0] == left && l->feedback->primary == left);
+ // Frames are sent for what is shown, and for no output it is not.
+ rediwm_projection_send_frame_done(p, left, &now);
+ assert(frame_dones == 1);
+ // A hidden leaf hears none, whatever it was told last.
+ wlr_scene_node_set_enabled(&node->node, false);
+ rediwm_projection_sync(p, 1, 0, 0, 0, 0);
+ rediwm_projection_send_frame_done(p, left, &now);
+ assert(frame_dones == 1);
+ wlr_scene_node_set_enabled(&node->node, true);
+ rediwm_projection_sync(p, 1, 0, 0, 0, 0);
+ report(p, &node->node, 0, 0, 0, 0); // hidden
+ assert(outputs_updates == 3 && update_size == 0 && !l->feedback->active && !l->feedback->primary);
+ rediwm_projection_send_frame_done(p, left, &now);
+ assert(frame_dones == 1); // nothing shown, nothing sent
+ // An active output whose scale changed hears again, whatever else is the same.
+ report(p, &node->node, seam - 26, 50, 26, 100);
+ assert(outputs_updates == 4 && update_size == 1);
+ report(p, &node->node, seam - 26, 50, 26, 100);
+ assert(outputs_updates == 4);
+ wlr_output_state_init(&state);
+ wlr_output_state_set_scale(&state, 1.25f);
+ assert(wlr_output_commit_state(left_output, &state));
+ wlr_output_state_finish(&state);
+ report(p, &node->node, seam - 26, 50, 26, 100);
+ assert(outputs_updates == 5);
+ report(p, &node->node, seam - 26, 50, 26, 100);
+ assert(outputs_updates == 5);
+ wlr_output_state_init(&state);
+ wlr_output_state_set_scale(&state, 1.f);
+ assert(wlr_output_commit_state(left_output, &state));
+ wlr_output_state_finish(&state);
+
+ wl_list_remove(&updated.link);
+ wl_list_remove(&done.link);
+ rediwm_projection_destroy(p);
+ wlr_scene_node_destroy(&source->node);
+ wlr_buffer_drop(buffer);
+ wlr_scene_output_destroy(right);
+ wlr_output_destroy(right_output);
+}
int main(void) {
struct wl_display *display = wl_display_create();
assert(display);
@@ -1046,8 +1189,7 @@ int main(void) {
struct wlr_scene_output *out = wlr_scene_output_create(scene, output);
assert(out);
struct wlr_scene_tree *source = wlr_scene_tree_create(&scene->tree);
- struct wlr_scene_tree *view = wlr_scene_tree_create(&scene->tree);
- struct rediwm_projection *p = rediwm_projection_create(source, view, scene);
+ struct rediwm_projection *p = rediwm_projection_create(source, scene);
assert(p);
struct wlr_buffer *a = buffer_create(), *b = buffer_create();
struct wlr_scene_buffer *node = wlr_scene_buffer_create(source, a);
@@ -1173,12 +1315,14 @@ int main(void) {
test_clip_output(scene, out);
test_shadow_output(scene, out);
test_damage_events(scene);
- test_opaque(scene);
+ test_graph_damage(scene, out);
+ test_feedback(scene, backend, out, output);
+ test_opaque();
wlr_scene_node_destroy(&scene->tree.node);
wlr_buffer_drop(a);
wlr_buffer_drop(b);
wlr_backend_destroy(backend);
wl_display_destroy(display);
- puts("PASS: projection damage, grouping, geometry, graph, opaque regions and lifecycle");
+ puts("PASS: projection damage, feedback, grouping, geometry, graph, opaque regions and lifecycle");
return 0;
}
diff --git a/src/scene_data.zig b/src/scene_data.zig
index 0d28167..81ef527 100644
--- a/src/scene_data.zig
+++ b/src/scene_data.zig
@@ -142,11 +142,9 @@ pub fn toNodeLocal(node: *wlr.SceneNode, lx: f64, ly: f64) geometry.Vec2 {
pub fn hitTest(server: *@import("Server.zig"), lx: f64, ly: f64) Hit {
server.world.syncPresentation();
- const root = &server.scene.tree.node;
var nx: f64 = undefined;
var ny: f64 = undefined;
- const displayed = root.at(lx, ly, &nx, &ny) orelse return .none;
- var node = @import("projection.zig").source(displayed);
+ var node = server.world.projection.nodeAt(lx, ly, &nx, &ny) orelse return .none;
// Let the latched preview receive input through other dimmed windows.
// Shell UI and layers keep their normal priority, as do points outside
diff --git a/src/scene_output.c b/src/scene_output.c
index d07aad9..ebb0eaa 100644
--- a/src/scene_output.c
+++ b/src/scene_output.c
@@ -10,6 +10,11 @@
#include "glass.h"
#include <math.h>
#include <stdlib.h>
+#ifdef REDIWM_DAMAGE_AUDIT
+#include <drm_fourcc.h>
+#include <wlr/render/allocator.h>
+#include <wlr/render/wlr_renderer.h>
+#endif
#include <wlr/render/drm_syncobj.h>
#include <wlr/render/swapchain.h>
#include <wlr/render/wlr_texture.h>
@@ -202,6 +207,9 @@ static void clip_cover(pixman_region32_t *out, const struct rediwm_clip *c, doub
struct collector {
struct rediwm_output_renderer *renderer;
const struct output_view *view;
+ // The logical boxes of the other enabled outputs.
+ struct wlr_box other[15];
+ int others;
pixman_region32_t covered;
// A window's items are contiguous and share one clip, so its cover is built
// once for the run rather than for each of its six or so items.
@@ -221,35 +229,54 @@ static bool same_clip(const struct rediwm_clip *a, const struct rediwm_clip *b)
static bool collect(const struct rediwm_item *item, struct wlr_scene_node *transport, void *data) {
struct collector *collector = data;
struct rediwm_output_renderer *r = collector->renderer;
- if (!item->enabled) return true;
+ if (!item->enabled) { return true; }
struct rediwm_snap s = rediwm_edges_snap(item->edges);
- if (s.width <= 0 || s.height <= 0) return true;
+ if (s.width <= 0 || s.height <= 0) { return true; }
struct wlr_box box = {s.x, s.y, s.width, s.height}, intersection;
- if (!wlr_box_intersection(&intersection, &box, &collector->view->logical)) return true;
+ const bool here = wlr_box_intersection(&intersection, &box, &collector->view->logical);
+ // An item on another output only is not drawn for this one, but it still hides
+ // what is below it there, which the surface feedback below counts (stage 6).
+ bool elsewhere = false;
+ for (int i = 0; i < collector->others && !elsewhere; i++) {
+ struct wlr_box other;
+ elsewhere = wlr_box_intersection(&other, &box, &collector->other[i]);
+ }
+ if (!here && !elsewhere) { return true; }
+ // Visit top-to-bottom so fully occluded items never enter the render list
+ // and never allocate/copy content. The graph, not the view's visible region,
+ // supplies the bounds and paint order.
+ pixman_region32_t visible;
+ pixman_region32_init_rect(&visible, box.x, box.y, box.width, box.height);
+ pixman_region32_subtract(&visible, &visible, &collector->covered);
+ // What a client surface shows of itself on every output is what it is told:
+ // this counts for an item that draws nothing as well (opacity 0), as it does
+ // for wlroots.
+ if (item->kind == REDIWM_ITEM_SURFACE)
+ rediwm_projection_feedback_note(r->projection, transport, &visible);
+ if (item->kind != REDIWM_ITEM_EFFECT)
+ rediwm_projection_note_visible(r->projection, transport, &visible);
+ if (here)
+ pixman_region32_intersect_rect(&visible, &visible, intersection.x, intersection.y,
+ intersection.width, intersection.height);
struct rediwm_glass_info glass = {0};
+ bool skip = false;
if (item->kind == REDIWM_ITEM_RECT) {
- if (item->content.color[3] == 0) return true;
+ skip = item->content.color[3] == 0;
} else if (item->kind == REDIWM_ITEM_EFFECT) {
// Glass is drawn here (stage 5c); without the blur program there is none,
// and the surface's own tint shows, as glass.c's fallback did.
- if (!r->has_backdrops || item->content.opacity == 0 ||
- !rediwm_glass_effect_info(rediwm_projection_source(transport), &glass) || glass.opacity <= 0)
- return true;
+ skip = !here || !r->has_backdrops || item->content.opacity == 0 ||
+ !rediwm_glass_effect_info(transport, &glass) || glass.opacity <= 0;
} else if (item->kind == REDIWM_ITEM_SHADOW) {
// No buffer: the pixels are the shadow's, and never opaque.
- if (item->content.opacity == 0 || item->shadow->color[3] == 0) return true;
+ skip = item->content.opacity == 0 || item->shadow->color[3] == 0;
} else {
struct wlr_scene_buffer *b = wlr_scene_buffer_from_node(transport);
- if (item->content.opacity == 0 ||
- (!b->buffer && !b->private.texture && !b->private.is_single_pixel_buffer)) return true;
+ skip = item->content.opacity == 0 ||
+ (!b->buffer && !b->private.texture && !b->private.is_single_pixel_buffer);
}
- // Visit top-to-bottom so fully occluded items never enter the render list
- // and never allocate/copy content. The graph, not the view's visible region,
- // supplies the bounds and paint order.
- pixman_region32_t visible;
- pixman_region32_init_rect(&visible, intersection.x, intersection.y, intersection.width, intersection.height);
- pixman_region32_subtract(&visible, &visible, &collector->covered);
- if (!pixman_region32_not_empty(&visible) &&
+ if (skip) { pixman_region32_fini(&visible); return true; }
+ if (here && !pixman_region32_not_empty(&visible) &&
pixman_region32_contains_rectangle(&collector->reads, &(pixman_box32_t){intersection.x, intersection.y,
intersection.x + intersection.width, intersection.y + intersection.height}) == PIXMAN_REGION_OUT) {
pixman_region32_fini(&visible);
@@ -270,8 +297,7 @@ static bool collect(const struct rediwm_item *item, struct wlr_scene_node *trans
e->padded = (struct wlr_box){box.x - pad, box.y - pad, box.width + 2 * pad, box.height + 2 * pad};
pixman_region32_union_rect(&collector->reads, &collector->reads,
e->padded.x, e->padded.y, e->padded.width, e->padded.height);
- struct wlr_scene_node *front = rediwm_projection_node(r->projection, &glass.target->node);
- e->front = front ? front : &glass.target->node;
+ e->front = &glass.target->node;
return true;
}
bool full = item->kind == REDIWM_ITEM_RECT && item->content.color[3] == 1;
@@ -282,7 +308,7 @@ static bool collect(const struct rediwm_item *item, struct wlr_scene_node *trans
if (b->buffer && item->content.opacity == 1) {
full = b->private.buffer_is_opaque;
if (!full) {
- pixman_region32_intersect_rect(&e->opaque, &b->opaque_region, 0, 0, s.width, s.height);
+ rediwm_mirror_opaque(&e->opaque, &b->opaque_region, item->width, item->height, s.width, s.height);
pixman_region32_translate(&e->opaque, s.x, s.y);
}
}
@@ -300,6 +326,12 @@ static bool collect(const struct rediwm_item *item, struct wlr_scene_node *trans
pixman_region32_intersect(&e->opaque, &e->opaque, &collector->cover);
}
pixman_region32_union(&collector->covered, &collector->covered, &e->opaque);
+ if (!here) {
+ // Only what it hides, for the feedback of what is below.
+ pixman_region32_fini(&e->visible);
+ pixman_region32_fini(&e->opaque);
+ r->entries.size -= sizeof(*e);
+ }
return true;
}
static void clear_entries(struct rediwm_output_renderer *r) {
@@ -310,9 +342,9 @@ static void clear_entries(struct rediwm_output_renderer *r) {
}
r->entries.size = 0;
}
-// Share the adapter's texture cache with glass/capture and the legacy path.
-// Buffer replacement and scene destruction already clear it in wlroots. Do
-// not keep an extra buffer lock: shm clients must still update in place.
+// The node's own texture cache, as wlr_scene keeps it. Buffer replacement and
+// scene destruction already clear it in wlroots. Do not keep an extra buffer
+// lock: shm clients must still update in place.
static void texture_renderer_destroy(struct wl_listener *listener, void *data) {
(void)data;
struct wlr_scene_buffer *b = wl_container_of(listener, b, private.renderer_destroy);
@@ -737,6 +769,97 @@ done:
pixman_region32_fini(&core);
return ok;
}
+#ifdef REDIWM_DAMAGE_AUDIT
+// Debug audit of the damage (`zig build -Ddamage-audit=true`, TESTING.md): after a
+// frame is drawn into the swapchain buffer with only the damage it was given, the
+// same entries are drawn whole into a private buffer and the two are compared. A
+// difference is a region the damage should have covered; it is logged with the
+// entries over it. Reads two frames back every time: slow, and off by default.
+static struct { struct wlr_output *output; struct wlr_buffer *buffer; } audit_slots[8];
+static bool audit_read(struct wlr_renderer *renderer, struct wlr_buffer *buffer, uint8_t *pixels) {
+ struct wlr_texture *texture = wlr_texture_from_buffer(renderer, buffer);
+ if (!texture) return false;
+ bool ok = wlr_texture_read_pixels(texture, &(struct wlr_texture_read_pixels_options){
+ .data = pixels, .format = DRM_FORMAT_ARGB8888, .stride = (uint32_t)buffer->width * 4});
+ wlr_texture_destroy(texture);
+ return ok;
+}
+static void audit_damage(struct rediwm_output_renderer *r, struct wlr_scene_output *out,
+ struct wlr_buffer *real, struct entry *entries, size_t len, const struct output_view *v,
+ const pixman_region32_t *damage) {
+ struct wlr_output *output = out->output;
+ int slot = -1;
+ for (int i = 0; i < 8; i++) {
+ if (audit_slots[i].output == output) { slot = i; break; }
+ if (slot < 0 && !audit_slots[i].output) slot = i;
+ }
+ if (slot < 0) return;
+ if (audit_slots[slot].output != output || (audit_slots[slot].buffer &&
+ (audit_slots[slot].buffer->width != real->width || audit_slots[slot].buffer->height != real->height))) {
+ if (audit_slots[slot].buffer) wlr_buffer_drop(audit_slots[slot].buffer);
+ audit_slots[slot].buffer = NULL;
+ audit_slots[slot].output = output;
+ }
+ if (!audit_slots[slot].buffer)
+ audit_slots[slot].buffer = wlr_allocator_create_buffer(output->allocator, real->width, real->height,
+ &output->swapchain->format);
+ struct wlr_buffer *copy = audit_slots[slot].buffer;
+ if (!copy) return;
+ struct wlr_render_pass *pass = rediwm_scene_pass_begin(r->pass, copy, &(struct wlr_buffer_pass_options){0});
+ if (!pass) return;
+ pixman_region32_t whole;
+ pixman_region32_init_rect(&whole, 0, 0, real->width, real->height);
+ wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){
+ .box = {0, 0, real->width, real->height}, .color = {0, 0, 0, 1}, .clip = &whole});
+ // Blurs are kept as the real pass left them: this audits damage, not glass.
+ for (size_t i = 0; i < len; i++) entries[i].reblur = false;
+ for (size_t i = len; i > 0; i--) render_entry(r, &entries[i - 1], out, pass, v, &whole, false);
+ wlr_output_add_software_cursors_to_render_pass(output, pass, &whole);
+ bool submitted = wlr_render_pass_submit(pass);
+ pixman_region32_fini(&whole);
+ if (!submitted) return;
+ const size_t bytes = (size_t)real->width * real->height * 4;
+ uint8_t *a = malloc(bytes), *b = malloc(bytes);
+ if (a && b && audit_read(output->renderer, real, a) && audit_read(output->renderer, copy, b)) {
+ // GLES2 at a fractional scale can differ by a level or two with render history.
+ const int tolerance = floor(v->scale) != v->scale ? 3 : 1;
+ long differing = 0, inside = 0;
+ int x1 = real->width, y1 = real->height, x2 = 0, y2 = 0, worst = 0;
+ for (int y = 0; y < real->height; y++) {
+ for (int x = 0; x < real->width; x++) {
+ const size_t o = ((size_t)y * real->width + x) * 4;
+ int d = 0;
+ for (int c = 0; c < 4; c++) { int e = abs((int)a[o + c] - (int)b[o + c]); if (e > d) d = e; }
+ if (d <= tolerance) continue;
+ differing++;
+ if (pixman_region32_contains_point((pixman_region32_t *)damage, x, y, NULL)) inside++;
+ if (d > worst) worst = d;
+ if (x < x1) x1 = x;
+ if (y < y1) y1 = y;
+ if (x + 1 > x2) x2 = x + 1;
+ if (y + 1 > y2) y2 = y + 1;
+ }
+ }
+ if (differing) {
+ const pixman_box32_t *ex = pixman_region32_extents((pixman_region32_t *)damage);
+ wlr_log(WLR_ERROR, "damage audit %s: %ld pixels differ (worst %d, %ld inside the damage) in %d,%d-%d,%d; "
+ "damage %d,%d-%d,%d", output->name, differing, worst, inside, x1, y1, x2, y2,
+ ex->x1, ex->y1, ex->x2, ex->y2);
+ const struct wlr_box mine = {x1, y1, x2 - x1, y2 - y1};
+ for (size_t i = 0; i < len; i++) {
+ struct wlr_box hit;
+ if (!wlr_box_intersection(&hit, &entries[i].box, &mine)) continue;
+ wlr_log(WLR_ERROR, "damage audit: entry %zu id %llu kind %d opacity %.3f box %d,%d %dx%d clip %d", i,
+ (unsigned long long)entries[i].item.id, (int)entries[i].item.kind,
+ entries[i].item.content.opacity, entries[i].box.x, entries[i].box.y, entries[i].box.width,
+ entries[i].box.height, entries[i].item.clip != NULL);
+ }
+ }
+ }
+ free(a);
+ free(b);
+}
+#endif
bool rediwm_scene_output_build_state(struct rediwm_output_renderer *r,
struct rediwm_projection *projection, struct wlr_scene_output *out, struct wlr_output_state *state) {
if ((state->committed & WLR_OUTPUT_STATE_ENABLED) && !state->enabled) return true;
@@ -761,7 +884,15 @@ bool rediwm_scene_output_build_state(struct rediwm_output_renderer *r,
v.width != output->width || v.height != output->height)
rediwm_scene_output_damage_whole(out);
r->projection = projection;
+ rediwm_projection_feedback_begin(projection);
struct collector collector = {.renderer = r, .view = &v};
+ struct wlr_scene_output *other;
+ wl_list_for_each(other, &out->scene->outputs, link) {
+ if (other == out || !other->output->enabled || collector.others == 15) continue;
+ struct wlr_box *box = &collector.other[collector.others++];
+ *box = (struct wlr_box){.x = other->x, .y = other->y};
+ wlr_output_effective_resolution(other->output, &box->width, &box->height);
+ }
pixman_region32_init(&collector.covered);
pixman_region32_init(&collector.reads);
bool collected = rediwm_projection_for_each_item(projection, true, collect, &collector);
@@ -772,6 +903,7 @@ bool rediwm_scene_output_build_state(struct rediwm_output_renderer *r,
clear_entries(r);
return false;
}
+ rediwm_projection_feedback_end(projection);
struct entry *entries = r->entries.data;
size_t len = r->entries.size / sizeof(*entries);
// Effects decide before the damage is handed on: a re-blur changes the
@@ -830,6 +962,9 @@ bool rediwm_scene_output_build_state(struct rediwm_output_renderer *r,
// Successful reads still need release points when another item failed to
// import. No sample event is sent for a failed GPU submission.
if (submitted) for (size_t i = 0; i < len; i++) if (entries[i].sampled) sample(&entries[i], out, false);
+#ifdef REDIWM_DAMAGE_AUDIT
+ if (submitted && ok) audit_damage(r, out, buffer, entries, len, &v, &damage);
+#endif
ok = ok && submitted;
pixman_region32_fini(&background);
pixman_region32_fini(&damage);
diff --git a/src/screenshot/capture.zig b/src/screenshot/capture.zig
index ae38f3f..21c6ee1 100644
--- a/src/screenshot/capture.zig
+++ b/src/screenshot/capture.zig
@@ -459,7 +459,7 @@ pub const Manager = struct {
log.err("processPendingJob: scene buildState failed for {s}", .{job.output_name});
}
var now = Output.timestamp();
- scene_output.sendFrameDone(&now);
+ mgr.server.sendFrameDone(scene_output, &now);
} else {
// Commit frame state to keep output pipeline in sync
_ = job.output.commitFrameState(&state);
diff --git a/tests/ipc_client.py b/tests/ipc_client.py
index f3ac3b6..52d585d 100755
--- a/tests/ipc_client.py
+++ b/tests/ipc_client.py
@@ -551,7 +551,11 @@ def spawn_compositor(
if env_extra:
env.update(env_extra)
- log_file = (tmp_dir / "compositor.log").open("w")
+ # REDIWM_TEST_LOG_DIR keeps every compositor log (the temporary directory is
+ # removed when a test passes), e.g. for the `-Ddamage-audit` build.
+ keep = os.environ.get("REDIWM_TEST_LOG_DIR")
+ log_path = Path(keep) / f"compositor-{os.getpid()}-{time.monotonic_ns()}.log" if keep else tmp_dir / "compositor.log"
+ log_file = log_path.open("w")
proc = subprocess.Popen(
[str(binary or ROOT / "zig-out/bin/rediwm")],
env=env,
diff --git a/tests/output_scale.py b/tests/output_scale.py
index cf645e1..b298fde 100644
--- a/tests/output_scale.py
+++ b/tests/output_scale.py
@@ -90,6 +90,12 @@ def run_case(binary, override='auto'):
'client not mapped')
wid = window['id']
+ def draw_lines():
+ return [l for l in (tmp / 'client.log').read_text().splitlines() if l.startswith('draw ')]
+
+ def surface_events():
+ return [l for l in (tmp / 'client.log').read_text().splitlines() if l.startswith(('enter ', 'leave '))]
+
def move_and_check(out, scale):
# Camera world coordinates are exposed separately from layout coordinates.
ipc.action('move_window_to', {'id': wid, 'x': out['x'] + 80, 'y': out['y'] + 80})
@@ -97,8 +103,7 @@ def run_case(binary, override='auto'):
wait_for(lambda: ipc.dump_buffer('titlebar', window_id=wid)['scale'] == scale,
f'chrome did not switch to {scale}')
expected_draw = f'draw {round(scale * 120)} {round(400 * scale)} {round(260 * scale)}'
- wait_for(lambda: (tmp / 'client.log').read_text().strip().splitlines()[-1:] == [expected_draw],
- f'client did not receive {scale} scale')
+ wait_for(lambda: draw_lines()[-1:] == [expected_draw], f'client did not receive {scale} scale')
wait_for(lambda: (ipc.get_window_debug(wid)['buffer_width'],
ipc.get_window_debug(wid)['buffer_height']) ==
(round(400 * scale), round(260 * scale)), 'client buffer size mismatch')
@@ -111,6 +116,19 @@ def run_case(binary, override='auto'):
move_and_check(outputs[1], 1.5)
move_and_check(outputs[0], 1)
move_and_check(outputs[1], 1.5)
+ # The surface is told which outputs show it: only the one it is on, and
+ # both while it spans the seam, where it renders at the denser one.
+ names = [out['name'] for out in outputs]
+ wait_for(lambda: surface_events()[-1:] == [f'enter {names[1]}'] and f'leave {names[0]}' in surface_events(),
+ 'surface events did not follow the move')
+ seam = max(out['x'] for out in outputs)
+ ipc.action('move_window_to', {'id': wid, 'x': seam - 150, 'y': outputs[0]['y'] + 80})
+ wait_for(lambda: surface_events()[-1:] == [f'enter {names[0]}'], 'spanning window did not enter both outputs')
+ wait_for(lambda: draw_lines()[-1:] == ['draw 180 600 390'], 'spanning window did not render at the denser output')
+ ipc.action('move_window_to', {'id': wid, 'x': outputs[0]['x'] + 80, 'y': outputs[0]['y'] + 80})
+ wait_for(lambda: surface_events()[-1:] == [f'leave {names[1]}'], 'window did not leave the other output')
+ wait_for(lambda: draw_lines()[-1:] == ['draw 120 400 260'], 'window did not return to the lighter output')
+ move_and_check(outputs[1], 1.5)
(tmp / 'rediwm-config.toml').write_text(config(1.25))
ipc.reload_config()
wait_for(lambda: next(o for o in ipc.get_outputs() if o['name'] == outputs[1]['name'])['scale'] == 1.25,
diff --git a/tests/output_scale_client.c b/tests/output_scale_client.c
index 20f5c29..1a8ed13 100644
--- a/tests/output_scale_client.c
+++ b/tests/output_scale_client.c
@@ -18,6 +18,11 @@ static struct wp_fractional_scale_manager_v1 *manager;
static struct wp_viewporter *viewporter;
static struct zxdg_decoration_manager_v1 *decorations;
static struct wl_surface *surface;
+// Every wl_output, by name, so enter and leave can say which output.
+enum { OUTPUTS = 8 };
+static struct wl_output *outputs[OUTPUTS];
+static char output_names[OUTPUTS][32];
+static int output_count;
static int configured;
static uint32_t density = 120;
@@ -46,6 +51,38 @@ static void draw(void) {
printf("draw %u %d %d\n", density, width, height);
fflush(stdout);
}
+static const char *output_name(struct wl_output *output) {
+ for (int i = 0; i < output_count; i++) if (outputs[i] == output) return output_names[i];
+ return "unknown";
+}
+static void output_geometry(void *data, struct wl_output *o, int32_t x, int32_t y, int32_t w, int32_t h,
+ int32_t subpixel, const char *make, const char *model, int32_t transform) {
+ (void)data; (void)o; (void)x; (void)y; (void)w; (void)h; (void)subpixel; (void)make; (void)model; (void)transform;
+}
+static void output_mode(void *data, struct wl_output *o, uint32_t flags, int32_t w, int32_t h, int32_t refresh) {
+ (void)data; (void)o; (void)flags; (void)w; (void)h; (void)refresh;
+}
+static void output_done(void *data, struct wl_output *o) { (void)data; (void)o; }
+static void output_scale(void *data, struct wl_output *o, int32_t factor) { (void)data; (void)o; (void)factor; }
+static void output_named(void *data, struct wl_output *o, const char *name) {
+ (void)data;
+ for (int i = 0; i < output_count; i++) if (outputs[i] == o) snprintf(output_names[i], sizeof(output_names[i]), "%s", name);
+}
+static void output_description(void *data, struct wl_output *o, const char *text) { (void)data; (void)o; (void)text; }
+static const struct wl_output_listener output_listener = {
+ .geometry = output_geometry, .mode = output_mode, .done = output_done, .scale = output_scale,
+ .name = output_named, .description = output_description};
+static void entered(void *data, struct wl_surface *s, struct wl_output *output) {
+ (void)data; (void)s;
+ printf("enter %s\n", output_name(output));
+ fflush(stdout);
+}
+static void left(void *data, struct wl_surface *s, struct wl_output *output) {
+ (void)data; (void)s;
+ printf("leave %s\n", output_name(output));
+ fflush(stdout);
+}
+static const struct wl_surface_listener surface_listener = { .enter = entered, .leave = left };
static void preferred(void *data, struct wp_fractional_scale_v1 *object, uint32_t scale) {
(void)data; (void)object; density = scale; draw();
}
@@ -67,6 +104,11 @@ static void global(void *data, struct wl_registry *registry, uint32_t name, cons
else BIND("wp_fractional_scale_manager_v1", manager, wp_fractional_scale_manager_v1, 1);
else BIND("wp_viewporter", viewporter, wp_viewporter, 1);
else BIND("zxdg_decoration_manager_v1", decorations, zxdg_decoration_manager_v1, 1);
+ else if (!strcmp(interface, "wl_output") && output_count < OUTPUTS && version >= 4) {
+ outputs[output_count] = wl_registry_bind(registry, name, &wl_output_interface, 4);
+ wl_output_add_listener(outputs[output_count], &output_listener, NULL);
+ output_count++;
+ }
#undef BIND
}
static void removed(void *data, struct wl_registry *registry, uint32_t name) {
@@ -82,6 +124,7 @@ int main(void) {
assert(compositor && shm && wm && manager && viewporter && decorations);
xdg_wm_base_add_listener(wm, &wm_listener, NULL);
surface = wl_compositor_create_surface(compositor);
+ wl_surface_add_listener(surface, &surface_listener, NULL);
struct wp_viewport *viewport = wp_viewporter_get_viewport(viewporter, surface);
wp_viewport_set_destination(viewport, 400, 260);
struct wp_fractional_scale_v1 *scale = wp_fractional_scale_manager_v1_get_fractional_scale(manager, surface);