diff options
| author | srdusr <[email protected]> | 2025-11-20 15:52:00 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2025-11-20 15:52:00 +0200 |
| commit | 04466601f4714dcbc1f3b0ef134febede6febb6a (patch) | |
| tree | 53d65fec45a7236a0efad5986960cffdbe60b5f0 /crates/wayland/src/udev/gpu.rs | |
| parent | 0d752ed0401fabbd22763eea1a8ff587d585f55d (diff) | |
| download | srdwm-04466601f4714dcbc1f3b0ef134febede6febb6a.tar.gz srdwm-04466601f4714dcbc1f3b0ef134febede6febb6a.zip | |
Add border/titlebar decoration rendering to the GPU render path
The GPU (SRDWM_GPU=1/general.gpu) path had real window content but
square corners and no border/titlebar. A prior pass investigated a full
port of the Pixman path's decoration rendering and deliberately did not
attempt it blind, given no working GPU-capable hardware on this machine
to verify a single pixel of it against. Asked directly, twice, to build
it anyway rather than leave it.
Scoped smaller than a full port: border top/bottom strips and the
titlebar bitmap now render, reusing the exact cached MemoryRenderBuffers
the Pixman path already builds (renderer-agnostic pixel buffers,
imported for GlesRenderer the same generic way cursor::render_elements
already does for either renderer). Left out on purpose: occlusion-
fragment clipping against overlapping windows, and the left/right border
side strips plus the drop shadow.
Full workspace build/test/clippy clean. Explicitly not visually
verified - same reason as before, no GPU-capable hardware on this
machine.
Diffstat (limited to 'crates/wayland/src/udev/gpu.rs')
| -rw-r--r-- | crates/wayland/src/udev/gpu.rs | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/crates/wayland/src/udev/gpu.rs b/crates/wayland/src/udev/gpu.rs index 7b06ae3..ad6526e 100644 --- a/crates/wayland/src/udev/gpu.rs +++ b/crates/wayland/src/udev/gpu.rs @@ -6,19 +6,28 @@ //! 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 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. +//! (`udev/session.rs`'s `SessionEvent` handlers), and the real cursor, +//! real window content, and now border/titlebar decorations all render +//! on top of the clear color (`udev/render.rs`'s own GPU branch). +//! Content is still plain `surface_content_elements` - square corners, +//! no rounding/masking - 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 reuse the exact same cached `MemoryRenderBuffer`s the +//! Pixman path builds (renderer-agnostic pixel buffers, imported here +//! for `GlesRenderer` the same generic way the cursor bitmap already is) +//! but deliberately skip two things the Pixman path has: occlusion- +//! fragment clipping against overlapping windows (each window's own +//! border/titlebar draws in full, front-to-back painter's-order -- +//! correct when windows don't overlap, imprecise when they do) and +//! left/right border side strips plus the drop shadow. Real, remaining +//! scope, not attempted here to keep this addition reviewable against +//! what it actually changes. 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}; |