diff options
author | Simon Ser <contact@emersion.fr> | 2020-12-11 18:14:58 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-12-21 16:30:47 +0100 |
commit | defcd9b025c8a6ce844f8b2c772ee763cbc334b5 (patch) | |
tree | ee9b919b4fcabbc73695dfa7f8777b22f0b8d2be /include/backend | |
parent | de896caceb9f6354a99c9435c3a429ff52b6ca4a (diff) |
backend/wayland: re-use wl_buffers
Instead of re-importing a buffer each time we submit a new frame, re-use
the wl_buffer objects if possible.
Diffstat (limited to 'include/backend')
-rw-r--r-- | include/backend/wayland.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/backend/wayland.h b/include/backend/wayland.h index 0ff52b51..1c874b35 100644 --- a/include/backend/wayland.h +++ b/include/backend/wayland.h @@ -25,9 +25,11 @@ struct wlr_wl_backend { struct wlr_renderer *renderer; struct wlr_drm_format *format; struct wlr_allocator *allocator; + struct wl_list buffers; // wlr_wl_buffer.link size_t requested_outputs; size_t last_output_num; struct wl_listener local_display_destroy; + /* remote state */ struct wl_display *remote_display; struct wl_event_source *remote_display_src; @@ -47,6 +49,9 @@ struct wlr_wl_backend { struct wlr_wl_buffer { struct wlr_buffer *buffer; struct wl_buffer *wl_buffer; + bool released; + struct wl_list link; // wlr_wl_backend.buffers + struct wl_listener buffer_destroy; }; struct wlr_wl_presentation_feedback { @@ -130,6 +135,7 @@ struct wlr_wl_input_device *create_wl_input_device( struct wlr_wl_seat *seat, enum wlr_input_device_type type); bool create_wl_seat(struct wl_seat *wl_seat, struct wlr_wl_backend *wl); void destroy_wl_seats(struct wlr_wl_backend *wl); +void destroy_wl_buffer(struct wlr_wl_buffer *buffer); extern const struct wl_seat_listener seat_listener; |