renderer: add field to indicate color transform support

master
Manuel Stoeckl 7 months ago committed by Simon Ser
parent 391410deb5
commit 82b4bc3f5f

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

@ -526,6 +526,7 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
return NULL; return NULL;
} }
wlr_renderer_init(&renderer->wlr_renderer, &renderer_impl, WLR_BUFFER_CAP_DMABUF); 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->buffers);
wl_list_init(&renderer->textures); wl_list_init(&renderer->textures);

@ -327,6 +327,7 @@ struct wlr_renderer *wlr_pixman_renderer_create(void) {
wlr_log(WLR_INFO, "Creating pixman renderer"); wlr_log(WLR_INFO, "Creating pixman renderer");
wlr_renderer_init(&renderer->wlr_renderer, &renderer_impl, WLR_BUFFER_CAP_DATA_PTR); 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->buffers);
wl_list_init(&renderer->textures); wl_list_init(&renderer->textures);

@ -2403,6 +2403,7 @@ struct wlr_renderer *vulkan_renderer_create_for_device(struct wlr_vk_device *dev
renderer->dev = dev; renderer->dev = dev;
wlr_renderer_init(&renderer->wlr_renderer, &renderer_impl, WLR_BUFFER_CAP_DMABUF); 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->stage.buffers);
wl_list_init(&renderer->foreign_textures); wl_list_init(&renderer->foreign_textures);
wl_list_init(&renderer->textures); wl_list_init(&renderer->textures);

Loading…
Cancel
Save