summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-02-09 12:11:49 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-02-09 12:11:49 +0000
commit3cdfb779c745d316e0f31f3e62b394c2aad17d36 (patch)
tree750b552289d92c872589c412345f6cff5caa375d
parent360a66e945cba02701234951ff86d5b88c12ed8c (diff)
parent3a4366363042722d642b492788377407587c7886 (diff)
downloadgtk+-3cdfb779c745d316e0f31f3e62b394c2aad17d36.tar.gz
Merge branch 'wip/chergert/fix-bgr8-uploads' into 'master'
gl: handle B8G8R8 texture data when uploading See merge request GNOME/gtk!3171
-rw-r--r--gdk/gdkglcontext.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c
index 5d73080b9b..3bc52b74fb 100644
--- a/gdk/gdkglcontext.c
+++ b/gdk/gdkglcontext.c
@@ -271,6 +271,12 @@ gdk_gl_context_upload_texture (GdkGLContext *context,
gl_type = GL_UNSIGNED_BYTE;
bpp = 3;
}
+ else if (data_format == GDK_MEMORY_B8G8R8)
+ {
+ gl_format = GL_BGR;
+ gl_type = GL_UNSIGNED_BYTE;
+ bpp = 3;
+ }
else /* Fall-back, convert to cairo-surface-format */
{
copy = g_malloc (width * height * 4);