diff options
author | Simon Ser <contact@emersion.fr> | 2020-12-02 10:36:23 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-06-02 11:08:52 +0200 |
commit | de51df277010e9f67d8e87cfdda0ca0a01e9ef0a (patch) | |
tree | 3344385668cd343a8b1e0a7c8863e29c9236368c | |
parent | 91ee33e956b42c5390993da95172ee0507baeb2c (diff) |
backend/wayland: implement get_cursor_formats
-rw-r--r-- | backend/wayland/output.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/backend/wayland/output.c b/backend/wayland/output.c index ae2f942e..cdf78b2a 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -20,6 +20,7 @@ #include "render/pixel_format.h" #include "render/swapchain.h" #include "render/wlr_renderer.h" +#include "types/wlr_buffer.h" #include "util/signal.h" #include "linux-dmabuf-unstable-v1-client-protocol.h" @@ -510,6 +511,17 @@ static bool output_set_cursor(struct wlr_output *wlr_output, return true; } +static const struct wlr_drm_format_set *output_get_cursor_formats( + struct wlr_output *wlr_output, uint32_t buffer_caps) { + struct wlr_wl_output *output = get_wl_output_from_output(wlr_output); + if (buffer_caps & WLR_BUFFER_CAP_DMABUF) { + return &output->backend->linux_dmabuf_v1_formats; + } else if (buffer_caps & WLR_BUFFER_CAP_SHM) { + return &output->backend->shm_formats; + } + return NULL; +} + static void output_destroy(struct wlr_output *wlr_output) { struct wlr_wl_output *output = get_wl_output_from_output(wlr_output); if (output == NULL) { @@ -569,6 +581,7 @@ static const struct wlr_output_impl output_impl = { .rollback_render = output_rollback_render, .set_cursor = output_set_cursor, .move_cursor = output_move_cursor, + .get_cursor_formats = output_get_cursor_formats, }; bool wlr_output_is_wl(struct wlr_output *wlr_output) { |