popover: Stop using gtk_style_context_save_to_node

This commit is contained in:
Matthias Clasen 2022-10-08 23:13:01 -04:00
parent d03ee57cc5
commit bf9f362597

View File

@ -126,7 +126,6 @@
#include "gtkcssboxesimplprivate.h"
#include "gtknativeprivate.h"
#include "gtkstylecontextprivate.h"
#include "gtkroundedboxprivate.h"
#include "gsk/gskroundedrectprivate.h"
#include "gtkcssshadowvalueprivate.h"
@ -1545,13 +1544,13 @@ create_arrow_render_node (GtkPopover *popover)
{
GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover);
GtkWidget *widget = GTK_WIDGET (popover);
GtkStyleContext *context;
GtkBorder border;
cairo_t *cr;
GtkSnapshot *snapshot;
GtkSnapshot *bg_snapshot;
GskRenderNode *node;
GtkCssBoxes boxes;
GtkCssStyle *style;
snapshot = gtk_snapshot_new ();
@ -1569,13 +1568,11 @@ create_arrow_render_node (GtkPopover *popover)
get_border (priv->arrow_node, &border);
context = gtk_widget_get_style_context (widget);
gtk_style_context_save_to_node (context, priv->arrow_node);
style = gtk_css_node_get_style (priv->arrow_node);
/* Render the arrow background */
bg_snapshot = gtk_snapshot_new ();
gtk_css_boxes_init_border_box (&boxes,
gtk_style_context_lookup_style (context),
gtk_css_boxes_init_border_box (&boxes, style,
0, 0,
gtk_widget_get_width (widget),
gtk_widget_get_height (widget));
@ -1590,10 +1587,8 @@ create_arrow_render_node (GtkPopover *popover)
/* Render the border of the arrow tip */
if (border.bottom > 0)
{
GtkCssStyle *style;
const GdkRGBA *border_color;
style = gtk_css_node_get_style (priv->arrow_node);
border_color = gtk_css_color_value_get_rgba (style->border->border_left_color ? style->border->border_left_color : style->core->color);
gtk_popover_apply_tail_path (popover, cr);
@ -1606,8 +1601,6 @@ create_arrow_render_node (GtkPopover *popover)
cairo_restore (cr);
cairo_destroy (cr);
gtk_style_context_restore (context);
priv->arrow_render_node = gtk_snapshot_free_to_node (snapshot);
}