From: Benjamin Otte Date: Sat, 12 Aug 2023 20:17:29 +0000 (+0200) Subject: gl: Pass swizzle array directly X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2^2~33 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=84204a0215eb84ce92dea047845a339b31b82eb1;p=gtk4.git gl: Pass swizzle array directly There's no need to pass pointers to arrays, as arrays are already pointers. --- diff --git a/gdk/gdkgltexture.c b/gdk/gdkgltexture.c index d9d62190d9..c0c57f70cb 100644 --- a/gdk/gdkgltexture.c +++ b/gdk/gdkgltexture.c @@ -153,7 +153,7 @@ gdk_gl_texture_find_format (gboolean use_es, if (gdk_memory_format_alpha (format) != alpha) continue; - if (!gdk_memory_format_gl_format (format, use_es, gl_major, gl_minor, &q_internal_format, &q_format, &q_type, &q_swizzle)) + if (!gdk_memory_format_gl_format (format, use_es, gl_major, gl_minor, &q_internal_format, &q_format, &q_type, q_swizzle)) continue; if (q_format != gl_format || q_type != gl_type) @@ -188,7 +188,7 @@ gdk_gl_texture_do_download (GdkGLTexture *self, FALSE, major, minor, &gl_internal_format, - &gl_format, &gl_type, &gl_swizzle)) + &gl_format, &gl_type, gl_swizzle)) { if (download->stride == expected_stride && download->format == format) diff --git a/gdk/gdkmemoryformat.c b/gdk/gdkmemoryformat.c index ec5583a2ad..ff42f23617 100644 --- a/gdk/gdkmemoryformat.c +++ b/gdk/gdkmemoryformat.c @@ -739,12 +739,12 @@ gdk_memory_format_gl_format (GdkMemoryFormat format, guint *out_internal_format, guint *out_format, guint *out_type, - GLint (*out_swizzle)[4]) + GLint out_swizzle[4]) { *out_internal_format = memory_formats[format].gl.internal_format; *out_format = memory_formats[format].gl.format; *out_type = memory_formats[format].gl.type; - memcpy (out_swizzle, &memory_formats[format].gl.swizzle, sizeof(GLint) * 4); + memcpy (out_swizzle, memory_formats[format].gl.swizzle, sizeof(GLint) * 4); if (gles) { diff --git a/gdk/gdkmemoryformatprivate.h b/gdk/gdkmemoryformatprivate.h index 9f56442de5..65041791f0 100644 --- a/gdk/gdkmemoryformatprivate.h +++ b/gdk/gdkmemoryformatprivate.h @@ -52,7 +52,7 @@ gboolean gdk_memory_format_gl_format (GdkMemoryFormat guint *out_internal_format, guint *out_format, guint *out_type, - GLint (*out_gizzle)[4]); + GLint out_gizzle[4]); void gdk_memory_convert (guchar *dest_data, gsize dest_stride, diff --git a/gsk/gl/gskglcommandqueue.c b/gsk/gl/gskglcommandqueue.c index 1cbd368500..0924b73993 100644 --- a/gsk/gl/gskglcommandqueue.c +++ b/gsk/gl/gskglcommandqueue.c @@ -1456,7 +1456,7 @@ memory_format_gl_format (GdkMemoryFormat data_format, guint *gl_internalformat, guint *gl_format, guint *gl_type, - GLint (*gl_swizzle)[4]) + GLint gl_swizzle[4]) { GdkMemoryDepth depth; @@ -1577,7 +1577,7 @@ gsk_gl_command_queue_do_upload_texture_chunk (GskGLCommandQueue *self, &gl_internalformat, &gl_format, &gl_type, - &gl_swizzle); + gl_swizzle); gdk_texture_downloader_init (&downloader, texture); gdk_texture_downloader_set_format (&downloader, data_format); @@ -1683,7 +1683,7 @@ gsk_gl_command_queue_upload_texture_chunks (GskGLCommandQueue *self, &gl_internalformat, &gl_format, &gl_type, - &gl_swizzle); + gl_swizzle); glTexImage2D (GL_TEXTURE_2D, 0, gl_internalformat, width, height, 0, gl_format, gl_type, NULL);