gdkcontext: Make has_unpack_subimage() do the version check

Makes the code look simpler when we actually use that function.
This commit is contained in:
Benjamin Otte
2023-08-12 22:13:07 +02:00
committed by Matthias Clasen
parent 7dba2a021e
commit 5f02d8fac5
2 changed files with 3 additions and 3 deletions

View File

@@ -1528,7 +1528,8 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
if (gdk_gl_context_get_use_es (context))
{
priv->has_unpack_subimage = epoxy_has_gl_extension ("GL_EXT_unpack_subimage");
priv->has_unpack_subimage = gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 0)) ||
epoxy_has_gl_extension ("GL_EXT_unpack_subimage");
priv->has_khr_debug = epoxy_has_gl_extension ("GL_KHR_debug");
}
else

View File

@@ -1595,8 +1595,7 @@ gsk_gl_command_queue_do_upload_texture_chunk (GskGLCommandQueue *self,
{
glTexSubImage2D (GL_TEXTURE_2D, 0, x, y, width, height, gl_format, gl_type, data);
}
else if (stride % bpp == 0 &&
(gdk_gl_context_check_version (self->context, NULL, "3.0") || gdk_gl_context_has_unpack_subimage (self->context)))
else if (stride % bpp == 0 && gdk_gl_context_has_unpack_subimage (self->context))
{
glPixelStorei (GL_UNPACK_ROW_LENGTH, stride / bpp);