srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/wayland/src/udev/gpu.rs
diff options
context:
space:
mode:
authorsrdusr <[email protected]>2025-08-08 23:28:00 +0200
committersrdusr <[email protected]>2025-08-08 23:28:00 +0200
commit9e811d2f2f1037ba4ec08ab0e05b350e6cf69e66 (patch)
tree2fa3f095b5f67769eca0eb9115faaf93fa37c0ae /crates/wayland/src/udev/gpu.rs
parent5f26a48fbb772ccc9c9ffb1209ff00d3c11d88c7 (diff)
downloadsrdwm-9e811d2f2f1037ba4ec08ab0e05b350e6cf69e66.tar.gz
srdwm-9e811d2f2f1037ba4ec08ab0e05b350e6cf69e66.zip
Render real window content on the GPU render path
Past clear-color + cursor: a GPU-driven head now renders every visible window's real content too, via surface_content_elements (the same generic-over-renderer helper the Pixman path uses, unmodified against gpu.renderer instead of udev.renderer). Content pushed after the cursor (so the cursor stays on top), in the same front-to-back `ids` order the Pixman path's own custom_elements already relies on for correct occlusion between windows - plain painter's-algorithm draw order, no separate clip needed since content is window-shaped. Deliberately the *unrounded* path: no corner masking (that's built against PixmanRenderer specifically on this backend) and no decorations (border, titlebar) - a GPU-driven head now shows real window content, square corners, no chrome. Decorations are the remaining real gap before this path has parity with the software one. Per-window geometry/position math (geom from window_anims or w.geometry, band for a decorated window's titlebar reservation, content_offset clamped non-negative) mirrors the Pixman path's own content push exactly, including an earlier double- subtraction and negative-margin fixes - so a CSD client with a real shadow margin positions the same way on either render path. Untested on real GPU-enabled hardware as of this writing: builds, passes clippy, full test suite green, and matches the existing Pixman path's geometry logic by inspection, but SRDWM_GPU/general.gpu were both unset on the machine this was built on - noted honestly in gpu.rs's own module doc comment, DEFAULTS.md, and IMPLEMENTATION_STATUS.md.
Diffstat (limited to 'crates/wayland/src/udev/gpu.rs')
-rw-r--r--crates/wayland/src/udev/gpu.rs17
1 files changed, 13 insertions, 4 deletions
diff --git a/crates/wayland/src/udev/gpu.rs b/crates/wayland/src/udev/gpu.rs
index 8617af1..7b06ae3 100644
--- a/crates/wayland/src/udev/gpu.rs
+++ b/crates/wayland/src/udev/gpu.rs
@@ -6,10 +6,19 @@
//! percolating-boole.md`, for that phase's own scoping): every head
//! `initialize_output` succeeds for gets driven, not just the first
//! (`GpuContext::outputs`), VT-switch pause/activate is wired
-//! (`udev/session.rs`'s `SessionEvent` handlers), and the real cursor
-//! renders on top of the clear color (`udev/render.rs`'s own GPU branch).
-//! Window content and decorations are the remaining gap - a GPU-driven
-//! head still shows no windows, just its own clear color and cursor.
+//! (`udev/session.rs`'s `SessionEvent` handlers), and the real cursor and
+//! real window content both render on top of the clear color
+//! (`udev/render.rs`'s own GPU branch). Window content is plain
+//! `surface_content_elements` - square corners, no border or titlebar --
+//! not yet the masked/rounded path the Pixman branch uses (built against
+//! `PixmanRenderer` specifically) or the GLES shader `winit/render.rs`
+//! already has for its own single-output case; decorations (border,
+//! titlebar) are the remaining real gap. Untested on real GPU-enabled
+//! hardware as of this writing - `SRDWM_GPU`/`general.gpu` were both
+//! unset on the machine this was built on, so this compiles, passes the
+//! full test suite, and matches the existing Pixman path's own per-
+//! window geometry logic by inspection, but has not been visually
+//! confirmed against a real compositor session with the flag on.
use std::os::fd::{AsFd, OwnedFd};