[gtk/matthiasc/color-profiles: 5/5] ngl: Update rendering for each frame




commit 40f4fb13caecef9d3e54c8168f2eae29af455529
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Oct 1 16:47:55 2021 -0400

    ngl: Update rendering for each frame
    
    Look at whether the render nodes we are given
    require HDR, and update the surface if that is
    the case.

 gsk/ngl/gsknglrenderer.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gsk/ngl/gsknglrenderer.c b/gsk/ngl/gsknglrenderer.c
index 7263d0b1e4..3fed9bfcc7 100644
--- a/gsk/ngl/gsknglrenderer.c
+++ b/gsk/ngl/gsknglrenderer.c
@@ -24,6 +24,7 @@
 #include <gdk/gdkdisplayprivate.h>
 #include <gsk/gskdebugprivate.h>
 #include <gsk/gskrendererprivate.h>
+#include <gsk/gskrendernodeprivate.h>
 
 #include "gsknglcommandqueueprivate.h"
 #include "gskngldriverprivate.h"
@@ -31,6 +32,8 @@
 #include "gsknglrenderjobprivate.h"
 #include "gsknglrendererprivate.h"
 
+#include <gdk/wayland/gdkwayland.h>
+
 struct _GskNglRendererClass
 {
   GskRendererClass parent_class;
@@ -200,6 +203,11 @@ gsk_ngl_renderer_render (GskRenderer          *renderer,
   viewport.size.width = gdk_surface_get_width (surface) * scale_factor;
   viewport.size.height = gdk_surface_get_height (surface) * scale_factor;
 
+  if (GDK_IS_WAYLAND_SURFACE (surface))
+    gdk_wayland_surface_set_rendering (surface, gsk_render_node_is_hdr (root)
+                                                ? GDK_RENDERING_HDR
+                                                : GDK_RENDERING_SDR);
+
   gdk_gl_context_make_current (self->context);
   gdk_draw_context_begin_frame (GDK_DRAW_CONTEXT (self->context), update_area);
 


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