From b7944e4bbfa64a6bb1a1d9e1f172827dde53aed2 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 17:12:10 +0300 Subject: Read back the last presented CPU frame wsap_term writes PNG screenshots for its debug server and keeps its own copy of the frame because YASL had no readback. yasl_surface_read_pixels() copies the frame from the last successful present, or reports its extent when the buffer is too small. X11 and Cocoa keep it in their single CPU target until the next draw starts; X11 now also forgets it when a resize replaces the target, and Cocoa records the presented extent because a resize can change the size before the next draw. Wayland remembers which buffer it committed and forgets it when a draw reuses that buffer. The backend test checks the copy on Wayland and X11, and that draws that never present do not show through. The Cocoa path is not built or run here. Co-Authored-By: Claude Opus 5.5 --- src/platform/wayland/api.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/platform/wayland/api.h') diff --git a/src/platform/wayland/api.h b/src/platform/wayland/api.h index 6c3154c..9f290f5 100644 --- a/src/platform/wayland/api.h +++ b/src/platform/wayland/api.h @@ -39,5 +39,7 @@ bool wayland_surface_show_window_menu(struct wayland_surface *s, struct yasl_vec bool wayland_surface_drag_carry(struct wayland_surface *s, struct yasl_vector2i offset); bool wayland_surface_place_under_pointer(struct wayland_surface *s, struct yasl_vector2i at); bool wayland_surface_bell(struct wayland_surface *s); +bool wayland_surface_read_pixels(struct wayland_surface *s, uint32_t *out, size_t cap, + struct yasl_vector2i *size); #endif -- cgit v1.2.3