mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
scene: use helpers to convert TF/primaries enums
This commit is contained in:
parent
47a90d6f1a
commit
2f2c0dfcc6
1 changed files with 2 additions and 24 deletions
|
|
@ -195,30 +195,8 @@ static void surface_reconfigure(struct wlr_scene_surface *scene_surface) {
|
|||
const struct wlr_image_description_v1_data *img_desc =
|
||||
wlr_surface_get_image_description_v1_data(surface);
|
||||
if (img_desc != NULL) {
|
||||
switch (img_desc->tf_named) {
|
||||
case WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_SRGB:
|
||||
tf = WLR_COLOR_TRANSFER_FUNCTION_SRGB;
|
||||
break;
|
||||
case WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_ST2084_PQ:
|
||||
tf = WLR_COLOR_TRANSFER_FUNCTION_ST2084_PQ;
|
||||
break;
|
||||
case WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR:
|
||||
tf = WLR_COLOR_TRANSFER_FUNCTION_EXT_LINEAR;
|
||||
break;
|
||||
default:
|
||||
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();
|
||||
}
|
||||
tf = wlr_color_manager_v1_transfer_function_to_wlr(img_desc->tf_named);
|
||||
primaries = wlr_color_manager_v1_primaries_to_wlr(img_desc->primaries_named);
|
||||
}
|
||||
|
||||
wlr_scene_buffer_set_opaque_region(scene_buffer, &opaque);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue