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 --- docs/guide.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/guide.md b/docs/guide.md index 2926011..4949f88 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -154,6 +154,12 @@ is unpaced: scheduling continuously will use CPU continuously. Use an applicatio timer to limit redraws there. Suspended/hidden windows need not draw at each requested interval. +`yasl_surface_read_pixels()` copies the last presented CPU frame, for example +for a screenshot or a debugging tool. Call it outside draw callbacks. A frame +is available from a successful present until the next draw starts, and again +once that draw presents. Call it with no buffer first to learn the extent. The +copy is YASL's frame, not the composited screen, and native rendering has none. + `yasl_surface_timing()` reports estimates and their provenance. All timestamps are monotonic nanoseconds. `YASL_TIMING_SUBMISSION` is CPU submission time, `YASL_TIMING_FRAME_CALLBACK` is a compositor pacing signal, and only -- cgit v1.2.3