egl: Check for the EXT_KHR_gl_colorspace extension

This commit is contained in:
Matthias Clasen
2024-06-17 07:56:06 -04:00
parent fcf9e09d9d
commit 954938e90a
3 changed files with 5 additions and 1 deletions

View File

@@ -1874,6 +1874,8 @@ gdk_display_init_egl (GdkDisplay *self,
epoxy_has_egl_extension (priv->egl_display, "EGL_EXT_image_dma_buf_import_modifiers");
self->have_egl_dma_buf_export =
epoxy_has_egl_extension (priv->egl_display, "EGL_MESA_image_dma_buf_export");
self->have_egl_gl_colorspace =
epoxy_has_egl_extension (priv->egl_display, "EGL_KHR_gl_colorspace");
if (self->have_egl_no_config_context)
priv->egl_config_high_depth = gdk_display_create_egl_config (self,

View File

@@ -130,6 +130,7 @@ struct _GdkDisplay
guint have_egl_pixel_format_float : 1;
guint have_egl_dma_buf_import : 1;
guint have_egl_dma_buf_export : 1;
guint have_egl_gl_colorspace : 1;
GdkDmabufFormats *dmabuf_formats;
GdkDmabufDownloader *dmabuf_downloaders[4];

View File

@@ -1217,7 +1217,8 @@ gdk_surface_ensure_egl_surface (GdkSurface *self,
}
if (want_srgb_conversion != priv->egl_surface_converts_srgb &&
priv->egl_surface != NULL)
priv->egl_surface != NULL &&
display->have_egl_gl_colorspace)
{
gdk_gl_context_clear_current_if_surface (self);
eglDestroySurface (gdk_display_get_egl_display (display), priv->egl_surface);