mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-13 08:22:16 -04:00
color_management_v1: add create windows scrgb
v2: Remove assert blocking feature, gate feature behind compositor
enabling it, and set get_info_allowed to false for the
descriptor returned
v3: Whoops, made a minor error without testing it first. Thanks, CI.
v4: Add default luminance level response for linear color. Thanks,
Dominick DiMaggio @njdom24
v5: Revert v4, and instead use new implementation of
set_luminances to apply a color luminance range
v6: Move luminances declaration to the correct place
This commit is contained in:
parent
5994c3d055
commit
5a13fa848a
1 changed files with 19 additions and 4 deletions
|
|
@ -908,9 +908,25 @@ static void manager_handle_create_parametric_creator(struct wl_client *client,
|
|||
|
||||
static void manager_handle_create_windows_scrgb(struct wl_client *client,
|
||||
struct wl_resource *manager_resource, uint32_t id) {
|
||||
wl_resource_post_error(manager_resource,
|
||||
WP_COLOR_MANAGER_V1_ERROR_UNSUPPORTED_FEATURE,
|
||||
"get_windows_scrgb is not supported");
|
||||
struct wlr_color_manager_v1 *manager = manager_from_resource(manager_resource);
|
||||
if (!manager->features.windows_scrgb) {
|
||||
wl_resource_post_error(manager_resource,
|
||||
WP_COLOR_MANAGER_V1_ERROR_UNSUPPORTED_FEATURE,
|
||||
"get_windows_scrgb is not supported");
|
||||
return;
|
||||
}
|
||||
|
||||
struct wlr_image_description_v1_data data = {
|
||||
.tf_named = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR,
|
||||
.primaries_named = WP_COLOR_MANAGER_V1_PRIMARIES_SRGB,
|
||||
.has_luminances = true,
|
||||
.luminances = (struct wlr_color_luminances){
|
||||
.min = 0.02,
|
||||
.max = 80,
|
||||
.reference = 203,
|
||||
},
|
||||
};
|
||||
image_desc_create_ready(manager, manager_resource, id, &data, false);
|
||||
}
|
||||
|
||||
static const struct wp_color_manager_v1_interface manager_impl = {
|
||||
|
|
@ -1003,7 +1019,6 @@ struct wlr_color_manager_v1 *wlr_color_manager_v1_create(struct wl_display *disp
|
|||
assert(!options->features.set_primaries);
|
||||
assert(!options->features.set_tf_power);
|
||||
assert(!options->features.extended_target_volume);
|
||||
assert(!options->features.windows_scrgb);
|
||||
|
||||
struct wlr_color_manager_v1 *manager = calloc(1, sizeof(*manager));
|
||||
if (manager == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue