[gtk/matthiasc/color-profiles: 11/12] wayland: Implement can_hdr
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/color-profiles: 11/12] wayland: Implement can_hdr
- Date: Sat, 2 Oct 2021 00:41:07 +0000 (UTC)
commit d61e9e8ebe9734cbfc6f5b257e37084ab2cbfeda
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Oct 1 20:35:27 2021 -0400
wayland: Implement can_hdr
Check that we have and hdr config. Easy.
gdk/wayland/gdkglcontext-wayland.c | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c
index 1a26a21ae1..8e5b5e8b3e 100644
--- a/gdk/wayland/gdkglcontext-wayland.c
+++ b/gdk/wayland/gdkglcontext-wayland.c
@@ -347,6 +347,16 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
gdk_wayland_surface_notify_committed (surface);
}
+static gboolean
+gdk_wayland_gl_context_can_hdr (GdkGLContext *context)
+{
+ GdkSurface *surface = gdk_gl_context_get_surface (context);
+ GdkDisplay *display = gdk_surface_get_display (surface);
+ GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
+
+ return display_wayland->egl_config_hdr != 0;
+}
+
static void
gdk_wayland_gl_context_class_init (GdkWaylandGLContextClass *klass)
{
@@ -363,6 +373,7 @@ gdk_wayland_gl_context_class_init (GdkWaylandGLContextClass *klass)
context_class->make_current = gdk_wayland_gl_context_make_current;
context_class->clear_current = gdk_wayland_gl_context_clear_current;
context_class->get_damage = gdk_wayland_gl_context_get_damage;
+ context_class->can_hdr = gdk_wayland_gl_context_can_hdr;
context_class->backend_type = GDK_GL_EGL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]