[gtk/image-loading: 21/36] rendernodeparser: Avoid gdk_texture_new_for_pixbuf




commit 72ce0096268828157598b4fb46ca41d6ecfaad17
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Sep 13 19:36:17 2021 -0400

    rendernodeparser: Avoid gdk_texture_new_for_pixbuf
    
    We can just use gdk_texture_new_from_bytes here now.
    
    Update affected test output.

 gsk/gskrendernodeparser.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
---
diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c
index 6d2294dd06..74f8389127 100644
--- a/gsk/gskrendernodeparser.c
+++ b/gsk/gskrendernodeparser.c
@@ -94,15 +94,8 @@ parse_texture (GtkCssParser *parser,
       bytes = gtk_css_data_url_parse (url, NULL, &error);
       if (bytes)
         {
-          stream = g_memory_input_stream_new_from_bytes (bytes);
+          texture = gdk_texture_new_from_bytes (bytes, &error);
           g_bytes_unref (bytes);
-          pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, &error);
-          g_object_unref (stream);
-          if (pixbuf != NULL)
-            {
-              texture = gdk_texture_new_for_pixbuf (pixbuf);
-              g_object_unref (pixbuf);
-            }
         }
     }
   else


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]