backend/wayland: implement get_cursor_formats
This commit is contained in:
parent
91ee33e956
commit
de51df2770
|
@ -20,6 +20,7 @@
|
||||||
#include "render/pixel_format.h"
|
#include "render/pixel_format.h"
|
||||||
#include "render/swapchain.h"
|
#include "render/swapchain.h"
|
||||||
#include "render/wlr_renderer.h"
|
#include "render/wlr_renderer.h"
|
||||||
|
#include "types/wlr_buffer.h"
|
||||||
#include "util/signal.h"
|
#include "util/signal.h"
|
||||||
|
|
||||||
#include "linux-dmabuf-unstable-v1-client-protocol.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;
|
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) {
|
static void output_destroy(struct wlr_output *wlr_output) {
|
||||||
struct wlr_wl_output *output = get_wl_output_from_output(wlr_output);
|
struct wlr_wl_output *output = get_wl_output_from_output(wlr_output);
|
||||||
if (output == NULL) {
|
if (output == NULL) {
|
||||||
|
@ -569,6 +581,7 @@ static const struct wlr_output_impl output_impl = {
|
||||||
.rollback_render = output_rollback_render,
|
.rollback_render = output_rollback_render,
|
||||||
.set_cursor = output_set_cursor,
|
.set_cursor = output_set_cursor,
|
||||||
.move_cursor = output_move_cursor,
|
.move_cursor = output_move_cursor,
|
||||||
|
.get_cursor_formats = output_get_cursor_formats,
|
||||||
};
|
};
|
||||||
|
|
||||||
bool wlr_output_is_wl(struct wlr_output *wlr_output) {
|
bool wlr_output_is_wl(struct wlr_output *wlr_output) {
|
||||||
|
|
Loading…
Reference in New Issue