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




commit e5c353c2b01ed978e09d71563875e72fe298c2f1
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 if we can actually do HDR, and
    update the surface if that is the case.

 gsk/ngl/gsknglrenderer.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gsk/ngl/gsknglrenderer.c b/gsk/ngl/gsknglrenderer.c
index 7263d0b1e4..508ac2a96a 100644
--- a/gsk/ngl/gsknglrenderer.c
+++ b/gsk/ngl/gsknglrenderer.c
@@ -22,8 +22,11 @@
 
 #include <gdk/gdkprofilerprivate.h>
 #include <gdk/gdkdisplayprivate.h>
+#include <gdk/gdkglcontextprivate.h>
+#include <gdk/gdksurfaceprivate.h>
 #include <gsk/gskdebugprivate.h>
 #include <gsk/gskrendererprivate.h>
+#include <gsk/gskrendernodeprivate.h>
 
 #include "gsknglcommandqueueprivate.h"
 #include "gskngldriverprivate.h"
@@ -200,6 +203,9 @@ 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;
 
+  gdk_surface_set_hdr (surface, gsk_render_node_is_hdr (root) &&
+                                gdk_gl_context_can_hdr (self->context));
+
   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]