popover: Stop using gtk_render_background

The gtk_render_ apis are getting deprecated.
This commit is contained in:
Matthias Clasen 2022-10-08 08:38:10 -04:00
parent 0c99e69423
commit da5d5bd71f

View File

@ -125,7 +125,6 @@
#include "gtkcssboxesimplprivate.h" #include "gtkcssboxesimplprivate.h"
#include "gtknativeprivate.h" #include "gtknativeprivate.h"
#include "gtkrender.h"
#include "gtkstylecontextprivate.h" #include "gtkstylecontextprivate.h"
#include "gtkroundedboxprivate.h" #include "gtkroundedboxprivate.h"
#include "gsk/gskroundedrectprivate.h" #include "gsk/gskroundedrectprivate.h"
@ -1549,6 +1548,8 @@ create_arrow_render_node (GtkPopover *popover)
GtkBorder border; GtkBorder border;
cairo_t *cr; cairo_t *cr;
GtkSnapshot *snapshot; GtkSnapshot *snapshot;
GtkSnapshot *bg_snapshot;
GskRenderNode *node;
snapshot = gtk_snapshot_new (); snapshot = gtk_snapshot_new ();
@ -1570,10 +1571,18 @@ create_arrow_render_node (GtkPopover *popover)
gtk_style_context_save_to_node (context, priv->arrow_node); gtk_style_context_save_to_node (context, priv->arrow_node);
/* Render the arrow background */ /* Render the arrow background */
gtk_render_background (context, cr, bg_snapshot = gtk_snapshot_new ();
0, 0, gtk_snapshot_render_background (bg_snapshot,
gtk_widget_get_width (widget), context,
gtk_widget_get_height (widget)); 0, 0,
gtk_widget_get_width (widget),
gtk_widget_get_height (widget));
node = gtk_snapshot_free_to_node (bg_snapshot);
if (node)
{
gsk_render_node_draw (node, cr);
gsk_render_node_unref (node);
}
/* Render the border of the arrow tip */ /* Render the border of the arrow tip */
if (border.bottom > 0) if (border.bottom > 0)