Merge branch 'matthiasc/for-main' into 'main'

Fix up criticals from GdkGLTexture

See merge request GNOME/gtk!5712
This commit is contained in:
Matthias Clasen
2023-03-24 15:53:55 +00:00

View File

@@ -320,14 +320,17 @@ static void
gdk_gl_texture_determine_format (GdkGLTexture *self)
{
GdkTexture *texture = GDK_TEXTURE (self);
GdkGLContext *context;
GLint active_texture;
GLint internal_format;
GLint width, height;
/* Abort if somebody else is GL-ing here... */
if (!gdk_gl_context_is_shared (self->context, gdk_gl_context_get_current ()) ||
context = gdk_gl_context_get_current ();
if (context == NULL ||
!gdk_gl_context_is_shared (self->context, context) ||
/* ... or glGetTexLevelParameter() isn't supported */
!gdk_gl_context_check_version (gdk_gl_context_get_current (), 0, 0, 3, 1))
!gdk_gl_context_check_version (context, 0, 0, 3, 1))
{
texture->format = GDK_MEMORY_DEFAULT;
self->has_mipmap = FALSE;