summaryrefslogtreecommitdiff
path: root/src/platform/wayland/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/wayland/buffer.c')
-rw-r--r--src/platform/wayland/buffer.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/platform/wayland/buffer.c b/src/platform/wayland/buffer.c
index 7ff4bd0..4f42b60 100644
--- a/src/platform/wayland/buffer.c
+++ b/src/platform/wayland/buffer.c
@@ -335,6 +335,7 @@ static void frame_done(void *data, struct wl_callback *cb, uint32_t ms)
w->clock.source = YASL_PRIVATE_TIMING_FRAME_CALLBACK;
}
+ yasl_private_surface_notify_frame_shown(&w->base);
if (w->base.presenter != YASL_PRIVATE_PRESENTER_CPU)
yasl_private_surface_notify_refresh(&w->base);
else if (w->want_draw)
@@ -550,6 +551,13 @@ bool wayland_surface_read_pixels(struct wayland_surface *w, uint32_t *out, size_
return yasl_private_copy_frame(b->pixels, (struct yasl_private_vector2i){b->width, b->height}, out, cap, size);
}
+bool surface_draw_ready(const struct wayland_surface *w)
+{
+ return w->want_draw && w->configured && !w->closed &&
+ w->base.presenter == YASL_PRIVATE_PRESENTER_CPU &&
+ buffer_pick_free_index(w->buffers, w->cur) >= 0;
+}
+
void surface_draw_frame(struct wayland_surface *w)
{
if (w->closed || !w->configured || w->base.presenter != YASL_PRIVATE_PRESENTER_CPU)