[gtk/wip/otte/gl-hdr: 8/14] gdk: Add GDK_DEBUG=hdr




commit 593335e9e971199ff90df2495407a33a565ed8ef
Author: Benjamin Otte <otte redhat com>
Date:   Sat Oct 2 22:38:05 2021 +0200

    gdk: Add GDK_DEBUG=hdr
    
    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            | 1 +
 gdk/gdkdebug.h       | 1 +
 gdk/gdkdrawcontext.c | 4 ++++
 3 files changed, 6 insertions(+)
---
diff --git a/gdk/gdk.c b/gdk/gdk.c
index 8f0cbbb3bb..b050c5916b 100644
--- 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 },
 };
 
 
diff --git a/gdk/gdkdebug.h b/gdk/gdkdebug.h
index 82332e6fb5..52460a7a82 100644
--- a/gdk/gdkdebug.h
+++ b/gdk/gdkdebug.h
@@ -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;
diff --git a/gdk/gdkdrawcontext.c b/gdk/gdkdrawcontext.c
index 1515917b07..b1988c4034 100644
--- a/gdk/gdkdrawcontext.c
+++ b/gdk/gdkdrawcontext.c
@@ -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);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]