renderer: add field to indicate color transform support

This commit is contained in:
Manuel Stoeckl 2024-04-14 12:20:08 -04:00 committed by Simon Ser
parent 391410deb5
commit 82b4bc3f5f
4 changed files with 10 additions and 0 deletions

View File

@ -40,6 +40,13 @@ struct wlr_renderer {
struct wl_signal lost;
} events;
struct {
/**
* Does the renderer support color transforms on its output?
*/
bool output_color_transform;
} features;
// private state
const struct wlr_renderer_impl *impl;

View File

@ -526,6 +526,7 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
return NULL;
}
wlr_renderer_init(&renderer->wlr_renderer, &renderer_impl, WLR_BUFFER_CAP_DMABUF);
renderer->wlr_renderer.features.output_color_transform = false;
wl_list_init(&renderer->buffers);
wl_list_init(&renderer->textures);

View File

@ -327,6 +327,7 @@ struct wlr_renderer *wlr_pixman_renderer_create(void) {
wlr_log(WLR_INFO, "Creating pixman renderer");
wlr_renderer_init(&renderer->wlr_renderer, &renderer_impl, WLR_BUFFER_CAP_DATA_PTR);
renderer->wlr_renderer.features.output_color_transform = false;
wl_list_init(&renderer->buffers);
wl_list_init(&renderer->textures);

View File

@ -2403,6 +2403,7 @@ struct wlr_renderer *vulkan_renderer_create_for_device(struct wlr_vk_device *dev
renderer->dev = dev;
wlr_renderer_init(&renderer->wlr_renderer, &renderer_impl, WLR_BUFFER_CAP_DMABUF);
renderer->wlr_renderer.features.output_color_transform = true;
wl_list_init(&renderer->stage.buffers);
wl_list_init(&renderer->foreign_textures);
wl_list_init(&renderer->textures);