From de62ea96ab29cc6dd4f4e2c322bc092cdd681604 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 19 Aug 2024 16:04:15 -0400 Subject: [PATCH] Add GDK_DISABLE=color-mgmt This flag is meant to turn off color management features of GDK. If this is set, all surfaces will report sRGB as their preferred color state. --- docs/reference/gtk/running.md | 3 +++ gdk/gdk.c | 1 + gdk/gdkdebugprivate.h | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/reference/gtk/running.md b/docs/reference/gtk/running.md index 0141f53156..cf4227eb7d 100644 --- a/docs/reference/gtk/running.md +++ b/docs/reference/gtk/running.md @@ -358,6 +358,9 @@ disable certain features. `offload` : Disable graphics offload to subsurfaces +`color-mgmt` +: Disable color management + ### `GDK_GL_DISABLE` This variable can be set to a list of values, which cause GDK to diff --git a/gdk/gdk.c b/gdk/gdk.c index 4d0c986838..6003990468 100644 --- a/gdk/gdk.c +++ b/gdk/gdk.c @@ -151,6 +151,7 @@ static const GdkDebugKey gdk_feature_keys[] = { { "vulkan", GDK_FEATURE_VULKAN, "Disable Vulkan support" }, { "dmabuf", GDK_FEATURE_DMABUF, "Disable dmabuf support" }, { "offload", GDK_FEATURE_OFFLOAD, "Disable graphics offload" }, + { "color-mgmt", GDK_FEATURE_COLOR_MANAGEMENT, "Disable color management" }, }; diff --git a/gdk/gdkdebugprivate.h b/gdk/gdkdebugprivate.h index c46085fa79..277bab74a2 100644 --- a/gdk/gdkdebugprivate.h +++ b/gdk/gdkdebugprivate.h @@ -63,9 +63,10 @@ typedef enum { GDK_FEATURE_VULKAN = 1 << 6, GDK_FEATURE_DMABUF = 1 << 7, GDK_FEATURE_OFFLOAD = 1 << 8, + GDK_FEATURE_COLOR_MANAGEMENT = 1 << 9, } GdkFeatures; -#define GDK_ALL_FEATURES ((1 << 9) - 1) +#define GDK_ALL_FEATURES ((1 << 10) - 1) extern guint _gdk_debug_flags;