mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
output: fix performance issues with wlr_output_schedule_frame
This commit is contained in:
parent
a7cba7d83f
commit
704130cc11
3 changed files with 27 additions and 5 deletions
|
|
@ -21,9 +21,10 @@ static void surface_frame_callback(void *data, struct wl_callback *cb,
|
|||
uint32_t time) {
|
||||
struct wlr_wl_backend_output *output = data;
|
||||
assert(output);
|
||||
wlr_output_send_frame(&output->wlr_output);
|
||||
wl_callback_destroy(cb);
|
||||
output->frame_callback = NULL;
|
||||
|
||||
wlr_output_send_frame(&output->wlr_output);
|
||||
}
|
||||
|
||||
static struct wl_callback_listener frame_listener = {
|
||||
|
|
@ -50,6 +51,11 @@ static bool wlr_wl_output_swap_buffers(struct wlr_output *wlr_output) {
|
|||
struct wlr_wl_backend_output *output =
|
||||
(struct wlr_wl_backend_output *)wlr_output;
|
||||
|
||||
if (output->frame_callback != NULL) {
|
||||
wlr_log(L_ERROR, "Skipping buffer swap");
|
||||
return false;
|
||||
}
|
||||
|
||||
output->frame_callback = wl_surface_frame(output->surface);
|
||||
wl_callback_add_listener(output->frame_callback, &frame_listener, output);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue