libweston: expose color management support

In this patch we enable the color-management protocol support, as long
as the color-manager plugin in use supports it.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This commit is contained in:
Leandro Ribeiro 2023-11-21 17:18:15 -03:00
parent 5706d7e5d2
commit 188a3ebd5e
3 changed files with 5 additions and 6 deletions

View File

@ -32,7 +32,7 @@
#include "color.h" #include "color.h"
#include "color-lcms.h" #include "color-lcms.h"
#include "color-properties.h" #include "color-management.h"
#include "shared/helpers.h" #include "shared/helpers.h"
#include "shared/xalloc.h" #include "shared/xalloc.h"
#include "shared/weston-assert.h" #include "shared/weston-assert.h"
@ -470,7 +470,6 @@ weston_color_manager_create(struct weston_compositor *compositor)
cm->base.name = "work-in-progress"; cm->base.name = "work-in-progress";
cm->base.compositor = compositor; cm->base.compositor = compositor;
cm->base.supports_client_protocol = true;
cm->base.init = cmlcms_init; cm->base.init = cmlcms_init;
cm->base.destroy = cmlcms_destroy; cm->base.destroy = cmlcms_destroy;
cm->base.destroy_color_profile = cmlcms_destroy_color_profile; cm->base.destroy_color_profile = cmlcms_destroy_color_profile;
@ -481,6 +480,10 @@ weston_color_manager_create(struct weston_compositor *compositor)
cm->base.get_surface_color_transform = cmlcms_get_surface_color_transform; cm->base.get_surface_color_transform = cmlcms_get_surface_color_transform;
cm->base.create_output_color_outcome = cmlcms_create_output_color_outcome; cm->base.create_output_color_outcome = cmlcms_create_output_color_outcome;
/* We support the CM&HDR protocol extension when using LittleCMS. */
if (weston_compositor_enable_color_management_protocol(compositor) < 0)
goto err;
/* We still do not support creating parametric color profiles. */ /* We still do not support creating parametric color profiles. */
cm->base.supported_color_features = (1 << WESTON_COLOR_FEATURE_ICC); cm->base.supported_color_features = (1 << WESTON_COLOR_FEATURE_ICC);

View File

@ -243,7 +243,6 @@ weston_color_manager_noop_create(struct weston_compositor *compositor)
cm->base.name = "no-op"; cm->base.name = "no-op";
cm->base.compositor = compositor; cm->base.compositor = compositor;
cm->base.supports_client_protocol = false;
cm->base.init = cmnoop_init; cm->base.init = cmnoop_init;
cm->base.destroy = cmnoop_destroy; cm->base.destroy = cmnoop_destroy;
cm->base.destroy_color_profile = cmnoop_destroy_color_profile; cm->base.destroy_color_profile = cmnoop_destroy_color_profile;

View File

@ -252,9 +252,6 @@ struct weston_color_manager {
/** This compositor instance */ /** This compositor instance */
struct weston_compositor *compositor; struct weston_compositor *compositor;
/** Supports the Wayland CM&HDR protocol extension? */
bool supports_client_protocol;
/** /**
* Supported color features from Wayland CM&HDR protocol extension. * Supported color features from Wayland CM&HDR protocol extension.
* *