summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-15 13:19:58 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-15 13:19:58 +0300
commit3d012d707d0242780cd386868ab511846dc9b0af (patch)
tree131e1621f400f78cba1541f2fbf9591ffcb4ce08 /include
parent8d9ee60888e01e5d88c306afe0c77bad02a29e5b (diff)
Add damage presentation and reduce CPU surface latency
Add yasl_cpu_present_damage to submit partial damage rectangles. Skip commit timers for CPU surfaces to prevent display delay. Remove frame callback gating in surface_draw_frame when free buffers exist. Flush the display immediately on CPU present. Forward tearing option to window specifications.
Diffstat (limited to 'include')
-rw-r--r--include/yasl/yasl.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/yasl/yasl.h b/include/yasl/yasl.h
index 6d2b4f0..15bbe16 100644
--- a/include/yasl/yasl.h
+++ b/include/yasl/yasl.h
@@ -62,7 +62,7 @@ struct yasl_surface_options {
const char *title;
int width, height; /**< Required. */
enum yasl_surface_type type;
- bool undecorated, fixed_size;
+ bool undecorated, fixed_size, tearing;
void *userdata;
/** Called when the window needs drawing while the system blocks the event
* loop, as during a macOS live resize; draw and present before returning.
@@ -281,8 +281,12 @@ YASL_API uint64_t yasl_time_ns(void);
* 0xAARRGGBB pixels, rows tightly packed. They persist, and a resize keeps the
* overlap and zeroes the rest. Valid until the next wait. Present to show them;
* the system may also show them when it redraws the window. */
+struct yasl_damage {
+ int x, y, width, height;
+};
YASL_API uint32_t *yasl_cpu_pixels(yasl_surface *surface, int *pixel_width, int *pixel_height);
YASL_API int yasl_cpu_present(yasl_surface *surface);
+YASL_API int yasl_cpu_present_damage(yasl_surface *surface, const struct yasl_damage *damage, int count);
typedef void (*yasl_gl_proc)(void);
/** These four may run on a rendering thread; synchronize them with destruction.