[gtk/gbsneto/filechooser-column-view: 1/47] flowbox: Stop using gtk_render_background




commit 95169ee4c85c939816e9a21fdaddd911db57d64a
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Oct 8 08:28:46 2022 -0400

    flowbox: Stop using gtk_render_background
    
    The gtk_render_ apis are getting deprecated.

 gtk/gtkflowbox.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c
index 16ae39cfb5..38eeeaff64 100644
--- a/gtk/gtkflowbox.c
+++ b/gtk/gtkflowbox.c
@@ -2570,6 +2570,8 @@ gtk_flow_box_snapshot (GtkWidget   *widget,
           cairo_path_t *path;
           GtkBorder border;
           const GdkRGBA *border_color;
+          GtkSnapshot *bg_snapshot;
+          GskRenderNode *node;
 
           if (vertical)
             path_from_vertical_line_rects (cr, (GdkRectangle *)lines->data, lines->len);
@@ -2583,7 +2585,16 @@ gtk_flow_box_snapshot (GtkWidget   *widget,
 
           cairo_save (cr);
           cairo_clip (cr);
-          gtk_render_background (context, cr, x, y, width, height);
+
+          bg_snapshot = gtk_snapshot_new ();
+          gtk_snapshot_render_background (bg_snapshot, context, x, y, width, height);
+          node = gtk_snapshot_free_to_node (bg_snapshot);
+          if (node)
+            {
+              gsk_render_node_draw (node, cr);
+              gsk_render_node_unref (node);
+            }
+
           cairo_restore (cr);
 
           cairo_append_path (cr, path);


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