display: layer stack + damage-driven compositor (D3)
Turn the service into a real compositor. A layer is a server-owned surface (its own mmap'd cacheable buffer) with a screen position, z-order, and visibility. Clients create layers, draw into them by command, mark damage, and present; the compositor repaints only the damaged region — clear to the wallpaper, paint the visible layers bottom-to-top (z-sorted), flush that rectangle back -> front (WC). - compositor.zig: the pure, host-tested core — Rect (intersect/unite), Surface, fillRect, composite (opaque, clipped to a damage rect), blitTile (unaligned- safe read of a client tile). No syscall/runtime dependency. - protocol.zig: pack(format, r, g, b) — native pixel encoding for rgbx/bgrx, the shared colour vocabulary of client and server. Host-tested. - display.zig: the layer table + create/configure/destroy/fill_rect/blit_tile/ damage/present ops wired onto the compositor, plus a damage-accumulating present. - Startup self-check: two overlapping layers composited on the real framebuffer, read back to confirm the overlap shows the top layer and outside shows the bottom — logs `display: compositor self-check ok`. Gate: `zig build test` green (compositor + pack), and the display-service case's self-check passes on hardware. Both new pure modules added to the test loop.
This commit is contained in:
@@ -770,6 +770,8 @@ pub fn build(b: *std.Build) void {
|
||||
"system/services/vfs/protocol.zig", // NodeKind / DirectoryEntry sizes + op values
|
||||
"system/services/fat/on-disk.zig", // FAT on-disk struct sizes + type detection
|
||||
"system/services/fat/engine.zig", // FAT read/write over a RAM-backed image
|
||||
"system/services/display/compositor.zig", // Rect math + fill/composite/blit-tile
|
||||
"system/services/display/protocol.zig", // pack(): native pixel encoding per format
|
||||
}) |root| {
|
||||
const mod_tests = b.addTest(.{
|
||||
.root_module = b.createModule(.{
|
||||
|
||||
Reference in New Issue
Block a user