color: Generate and store ICC profiles from EDID or EFI
Just as gsd-color does, generate color profiles. This can either be done from EFI, if available and the color device is associated with a built in panel, or from the EDID. If no source for a profile is found, none is created. The ICC profiles are also stored on disk so that they can be read by e.g. colord. The on disk stored profiles will only be used for storing, not reading the profiles, as the autogenerated ones will no matter what always be loaded to verify the on disk profiles are up to date. If a on disk profile is not, it will be replaced. This is so that fixes or improvements to the profile generation will be made available despite having run an older version earlier. After generating, add some metadata about the generated file itself needed by colord, i.e. file MD5 checksum and the file path. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2164>
This commit is contained in:
@ -49,6 +49,7 @@
|
||||
|
||||
#include "backends/meta-backend-types.h"
|
||||
#include "backends/meta-color-device.h"
|
||||
#include "backends/meta-color-store.h"
|
||||
#include "backends/meta-monitor.h"
|
||||
|
||||
#include "meta-dbus-gsd-color.h"
|
||||
@ -68,6 +69,8 @@ typedef struct _MetaColorManagerPrivate
|
||||
{
|
||||
MetaBackend *backend;
|
||||
|
||||
MetaColorStore *color_store;
|
||||
|
||||
cmsContext lcms_context;
|
||||
|
||||
CdClient *cd_client;
|
||||
@ -203,6 +206,8 @@ cd_client_connect_cb (GObject *source_object,
|
||||
return;
|
||||
}
|
||||
|
||||
priv->color_store = meta_color_store_new (color_manager);
|
||||
|
||||
update_devices (color_manager);
|
||||
g_signal_connect (monitor_manager, "monitors-changed-internal",
|
||||
G_CALLBACK (on_monitors_changed),
|
||||
@ -274,6 +279,7 @@ meta_color_manager_finalize (GObject *object)
|
||||
g_clear_object (&priv->cancellable);
|
||||
g_clear_pointer (&priv->devices, g_hash_table_unref);
|
||||
g_clear_object (&priv->gsd_color);
|
||||
g_clear_object (&priv->color_store);
|
||||
g_clear_pointer (&priv->lcms_context, cmsDeleteContext);
|
||||
|
||||
G_OBJECT_CLASS (meta_color_manager_parent_class)->finalize (object);
|
||||
@ -365,6 +371,15 @@ meta_color_manager_get_cd_client (MetaColorManager *color_manager)
|
||||
return priv->cd_client;
|
||||
}
|
||||
|
||||
MetaColorStore *
|
||||
meta_color_manager_get_color_store (MetaColorManager *color_manager)
|
||||
{
|
||||
MetaColorManagerPrivate *priv =
|
||||
meta_color_manager_get_instance_private (color_manager);
|
||||
|
||||
return priv->color_store;
|
||||
}
|
||||
|
||||
MetaColorDevice *
|
||||
meta_color_manager_get_color_device (MetaColorManager *color_manager,
|
||||
MetaMonitor *monitor)
|
||||
|
Reference in New Issue
Block a user