gsk: Restore bigendian support
authorMatthias Clasen <mclasen@redhat.com>
Sun, 22 Oct 2023 20:19:31 +0000 (16:19 -0400)
committerChristian Hergert <chergert@redhat.com>
Tue, 31 Oct 2023 20:46:32 +0000 (13:46 -0700)
Restore the bigendian support that was lost in b0e26873f66a8f52,
by just not using GL_BGRA with GLES on bigendian. Should be a
very rare combination, but still.

gsk/gl/gskglglyphlibrary.c
gsk/gl/gskgliconlibrary.c

index 3c04b46973836b5532d00c904a9e24590545de6b..2e6d4da7fb7553e8c7a57a1d1a3690c0e69a886e 100644 (file)
@@ -119,7 +119,11 @@ gsk_gl_glyph_library_init_atlas (GskGLTextureLibrary *self,
 
   memset (pixel_data, 255, sizeof pixel_data);
 
-  if (!gdk_gl_context_has_bgra (gdk_gl_context_get_current ()))
+  if (!gdk_gl_context_has_bgra (gdk_gl_context_get_current ())
+#if G_BYTE_ORDER == G_BIG_ENDIAN
+      || gdk_gl_context_get_use_es (gdk_gl_context_get_current ())
+#endif
+     )
     {
       gl_format = GL_RGBA;
       gl_type = GL_UNSIGNED_BYTE;
index 156469dde0f249b311595363a643f76495c8d1fc..e57016a1a244fb690fd822453ad007308d46a764 100644 (file)
@@ -111,7 +111,11 @@ gsk_gl_icon_library_add (GskGLIconLibrary     *self,
   gdk_gl_context_push_debug_group_printf (gdk_gl_context_get_current (),
                                           "Uploading texture");
 
-  if (!gdk_gl_context_has_bgra (gdk_gl_context_get_current ()))
+  if (!gdk_gl_context_has_bgra (gdk_gl_context_get_current ())
+#if G_BYTE_ORDER == G_BIG_ENDIAN
+      || gdk_gl_context_get_use_es (gdk_gl_context_get_current ())
+#endif
+     )
     {
       pixel_data = free_data = g_malloc (width * height * 4);
       gdk_memory_convert (pixel_data, width * 4,