Use GtkLoader for image loading
authorMatthias Clasen <mclasen@redhat.com>
Sat, 18 Sep 2021 18:13:22 +0000 (14:13 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 18 Sep 2021 21:35:00 +0000 (17:35 -0400)
This avoids blocking on image loading while
we have better things to do.

gtk/gdkpixbufutils.c

index 59c87a97e9185d33486c9c2ca54724892cf604d9..fdc4b06b766ea9a3d896e5a168eecc0299a45120 100644 (file)
@@ -19,6 +19,7 @@
 #include <gdk/gdk.h>
 #include "gdkpixbufutilsprivate.h"
 #include "gtkscalerprivate.h"
+#include "gtkloaderprivate.h"
 
 #include "gdk/gdktextureprivate.h"
 
@@ -588,7 +589,7 @@ gdk_paintable_new_from_bytes_scaled (GBytes *bytes,
   if (gdk_texture_can_load (bytes))
     {
       /* We know these formats can't be scaled */
-      inner = GDK_PAINTABLE (gdk_texture_new_from_bytes (bytes, NULL));
+      inner = GDK_PAINTABLE (gtk_loader_new (bytes));
       if (inner == NULL)
         return NULL;
     }