mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-18 06:59:44 -05:00
scene: add support for color-management-v1 primaries
This commit is contained in:
parent
071773cb27
commit
0c272a3842
1 changed files with 13 additions and 0 deletions
|
|
@ -188,6 +188,7 @@ static void surface_reconfigure(struct wlr_scene_surface *scene_surface) {
|
||||||
}
|
}
|
||||||
|
|
||||||
enum wlr_color_transfer_function tf = WLR_COLOR_TRANSFER_FUNCTION_SRGB;
|
enum wlr_color_transfer_function tf = WLR_COLOR_TRANSFER_FUNCTION_SRGB;
|
||||||
|
enum wlr_color_named_primaries primaries = WLR_COLOR_NAMED_PRIMARIES_SRGB;
|
||||||
const struct wlr_image_description_v1_data *img_desc =
|
const struct wlr_image_description_v1_data *img_desc =
|
||||||
wlr_surface_get_image_description_v1_data(surface);
|
wlr_surface_get_image_description_v1_data(surface);
|
||||||
if (img_desc != NULL) {
|
if (img_desc != NULL) {
|
||||||
|
|
@ -204,6 +205,17 @@ static void surface_reconfigure(struct wlr_scene_surface *scene_surface) {
|
||||||
default:
|
default:
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (img_desc->primaries_named) {
|
||||||
|
case WP_COLOR_MANAGER_V1_PRIMARIES_SRGB:
|
||||||
|
primaries = WLR_COLOR_NAMED_PRIMARIES_SRGB;
|
||||||
|
break;
|
||||||
|
case WP_COLOR_MANAGER_V1_PRIMARIES_BT2020:
|
||||||
|
primaries = WLR_COLOR_NAMED_PRIMARIES_BT2020;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
abort();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wlr_scene_buffer_set_opaque_region(scene_buffer, &opaque);
|
wlr_scene_buffer_set_opaque_region(scene_buffer, &opaque);
|
||||||
|
|
@ -212,6 +224,7 @@ static void surface_reconfigure(struct wlr_scene_surface *scene_surface) {
|
||||||
wlr_scene_buffer_set_transform(scene_buffer, state->transform);
|
wlr_scene_buffer_set_transform(scene_buffer, state->transform);
|
||||||
wlr_scene_buffer_set_opacity(scene_buffer, opacity);
|
wlr_scene_buffer_set_opacity(scene_buffer, opacity);
|
||||||
wlr_scene_buffer_set_transfer_function(scene_buffer, tf);
|
wlr_scene_buffer_set_transfer_function(scene_buffer, tf);
|
||||||
|
wlr_scene_buffer_set_primaries(scene_buffer, primaries);
|
||||||
|
|
||||||
scene_buffer_unmark_client_buffer(scene_buffer);
|
scene_buffer_unmark_client_buffer(scene_buffer);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue