diff --git a/gdk/gdkmemoryformat.c b/gdk/gdkmemoryformat.c index 8cb7891634..6a7c1bde44 100644 --- a/gdk/gdkmemoryformat.c +++ b/gdk/gdkmemoryformat.c @@ -20,7 +20,7 @@ #include "config.h" #include "gdkmemoryformatprivate.h" -#include "gdkglcontext.h" +#include "gdkglcontextprivate.h" #include "gsk/gl/fp16private.h" @@ -353,7 +353,7 @@ static const GdkMemoryFormatDescription memory_formats[] = { 4, G_ALIGNOF (guchar), GDK_MEMORY_U8, - { 0, 0, G_MAXUINT, G_MAXUINT }, + { 0, 0, 0, 0 }, { GL_RGBA8, GL_BGRA, GL_UNSIGNED_BYTE, { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA } }, b8g8r8a8_premultiplied_to_float, b8g8r8a8_premultiplied_from_float, @@ -383,7 +383,7 @@ static const GdkMemoryFormatDescription memory_formats[] = { 4, G_ALIGNOF (guchar), GDK_MEMORY_U8, - { 0, 0, G_MAXUINT, G_MAXUINT }, + { 0, 0, 0, 0 }, { GL_RGBA8, GL_BGRA, GL_UNSIGNED_BYTE, { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA } }, b8g8r8a8_to_float, b8g8r8a8_from_float, @@ -758,6 +758,9 @@ gdk_memory_format_gl_format (GdkMemoryFormat format, (memory_formats[format].min_gl_version.gles_major == gl_major && memory_formats[format].min_gl_version.gles_minor > gl_minor)) return FALSE; + + if (*out_format == GL_BGRA && !gdk_gl_context_has_bgra (context)) + return FALSE; } else {