From: Benjamin Otte Date: Sat, 12 Aug 2023 20:13:07 +0000 (+0200) Subject: gdkcontext: Make has_unpack_subimage() do the version check X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2^2~35 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5f02d8fac55aa965dd18296ea3532e2e481b4ac3;p=gtk4.git gdkcontext: Make has_unpack_subimage() do the version check Makes the code look simpler when we actually use that function. --- diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index 43d6440510..31c39467e5 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -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 diff --git a/gsk/gl/gskglcommandqueue.c b/gsk/gl/gskglcommandqueue.c index 4dd222b5d0..1cbd368500 100644 --- a/gsk/gl/gskglcommandqueue.c +++ b/gsk/gl/gskglcommandqueue.c @@ -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);