From fe3a7df31e5cdeec0042c0da5485031fb6a1057b Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Mon, 4 Feb 2013 11:48:45 +0000 Subject: [PATCH] color: Show sRGB and AdobeRGB profiles when selecting a profile for a display The logic here is that you can make expensive hardware emulate a known color space, for which you shouldn't need to generate a custom profile for. --- panels/color/cc-color-panel.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/panels/color/cc-color-panel.c b/panels/color/cc-color-panel.c index 05ffa5303..f5e22c611 100644 --- a/panels/color/cc-color-panel.c +++ b/panels/color/cc-color-panel.c @@ -601,6 +601,7 @@ gcm_prefs_is_profile_suitable_for_device (CdProfile *profile, CdColorspace device_colorspace = 0; gboolean ret = FALSE; CdDeviceKind device_kind; + CdStandardSpace standard_space; /* not the right colorspace */ device_colorspace = cd_device_get_colorspace (device); @@ -608,6 +609,22 @@ gcm_prefs_is_profile_suitable_for_device (CdProfile *profile, if (device_colorspace != profile_colorspace) goto out; + /* if this is a display matching with one of the standard spaces that displays + * could emulate, also mark it as suitable */ + if (cd_device_get_kind (device) == CD_DEVICE_KIND_DISPLAY && + cd_profile_get_kind (profile) == CD_PROFILE_KIND_DISPLAY_DEVICE) + { + data_source = cd_profile_get_metadata_item (profile, + CD_PROFILE_METADATA_STANDARD_SPACE); + standard_space = cd_standard_space_from_string (data_source); + if (standard_space == CD_STANDARD_SPACE_SRGB || + standard_space == CD_STANDARD_SPACE_ADOBE_RGB) + { + ret = TRUE; + goto out; + } + } + /* not the correct kind */ device_kind = cd_device_get_kind (device); profile_kind_tmp = cd_profile_get_kind (profile);