gdk: Add GDK_DEBUG=hdr
authorBenjamin Otte <otte@redhat.com>
Sat, 2 Oct 2021 20:38:05 +0000 (22:38 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 6 Oct 2021 01:44:59 +0000 (03:44 +0200)
Forces request_hdr = TRUE for all requests.

Backends should also use this when choosing whether to honor HDR
requests for low quality compositors - as long as the compositor
pretends to support HDR, shovel HDR at it.

gdk/gdk.c
gdk/gdkdebug.h
gdk/gdkdrawcontext.c

index 8f0cbbb3bbf45dbb4fbfe5b534fa27d2b68b12ff..b050c5916bcaa5e8c9bceae0920a6a7076dd6ca0 100644 (file)
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -129,6 +129,7 @@ static const GdkDebugKey gdk_debug_keys[] = {
   { "vulkan-disable",  GDK_DEBUG_VULKAN_DISABLE, "Disable Vulkan support" },
   { "vulkan-validate", GDK_DEBUG_VULKAN_VALIDATE, "Load the Vulkan validation layer" },
   { "default-settings",GDK_DEBUG_DEFAULT_SETTINGS, "Force default values for xsettings", TRUE },
+  { "hdr",             GDK_DEBUG_HDR, "Use HDR rendering if possible", TRUE },
 };
 
 
index 82332e6fb55d473b4c76dcadcf39c1653fe7d53f..52460a7a828fb95c6e05372366217bc95d9f5057 100644 (file)
@@ -50,6 +50,7 @@ typedef enum {
   GDK_DEBUG_VULKAN_DISABLE  = 1 << 21,
   GDK_DEBUG_VULKAN_VALIDATE = 1 << 22,
   GDK_DEBUG_DEFAULT_SETTINGS= 1 << 23,
+  GDK_DEBUG_HDR             = 1 << 24,
 } GdkDebugFlags;
 
 extern guint _gdk_debug_flags;
index 1515917b0791527b2b64275e165bf1ea43ecc944..b1988c403489bf53a6af80478b6572871564588f 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "gdkdrawcontextprivate.h"
 
+#include "gdkdebug.h"
 #include "gdkintl.h"
 #include "gdkprofilerprivate.h"
 #include "gdksurfaceprivate.h"
@@ -361,6 +362,9 @@ gdk_draw_context_begin_frame_full (GdkDrawContext       *context,
       return;
     }
 
+  if (GDK_DISPLAY_DEBUG_CHECK (priv->display, HDR))
+    request_hdr = TRUE;
+
   priv->frame_region = cairo_region_copy (region);
   priv->surface->paint_context = g_object_ref (context);