From fa823a37aed99ce3f1cc43f9b21b3e2952535613 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 23 Jun 2022 13:00:28 +0530 Subject: [PATCH] Backport https://github.com/glfw/glfw/commit/6281f498c875f49d8ac5c5a02d968fb1792fd9f5 --- glfw/egl_context.c | 4 ++++ glfw/egl_context.h | 1 + glfw/internal.h | 2 ++ 3 files changed, 7 insertions(+) diff --git a/glfw/egl_context.c b/glfw/egl_context.c index a02efb493..a714a12dc 100644 --- a/glfw/egl_context.c +++ b/glfw/egl_context.c @@ -428,6 +428,8 @@ bool _glfwInitEGL(void) extensionSupportedEGL("EGL_KHR_get_all_proc_addresses"); _glfw.egl.KHR_context_flush_control = extensionSupportedEGL("EGL_KHR_context_flush_control"); + _glfw.egl.EXT_present_opaque = + extensionSupportedEGL("EGL_EXT_present_opaque"); return true; } @@ -598,6 +600,8 @@ bool _glfwCreateContextEGL(_GLFWwindow* window, if (_glfw.egl.KHR_gl_colorspace) setAttrib(EGL_GL_COLORSPACE_KHR, EGL_GL_COLORSPACE_SRGB_KHR); } + if (_glfw.egl.EXT_present_opaque) + setAttrib(EGL_PRESENT_OPAQUE_EXT, !fbconfig->transparent); setAttrib(EGL_NONE, EGL_NONE); diff --git a/glfw/egl_context.h b/glfw/egl_context.h index 2c8b3add8..b35138a7e 100644 --- a/glfw/egl_context.h +++ b/glfw/egl_context.h @@ -186,6 +186,7 @@ typedef struct _GLFWlibraryEGL bool EXT_platform_base; bool EXT_platform_x11; bool EXT_platform_wayland; + bool EXT_present_opaque; bool ANGLE_platform_angle; bool ANGLE_platform_angle_opengl; bool ANGLE_platform_angle_d3d; diff --git a/glfw/internal.h b/glfw/internal.h index 822d3d356..5a5d7847c 100644 --- a/glfw/internal.h +++ b/glfw/internal.h @@ -52,6 +52,8 @@ #define GLFW_INCLUDE_NONE #include "glfw3.h" +#define EGL_PRESENT_OPAQUE_EXT 0x31df + #define _GLFW_INSERT_FIRST 0 #define _GLFW_INSERT_LAST 1