diff options
author | Timm Bäder <mail@baedert.org> | 2018-01-21 20:37:46 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2018-01-21 20:37:46 +0100 |
commit | fbd79d8fea7dd2380ba4f0772b3c6616afaa29b5 (patch) | |
tree | ac10c85a50368945d4b242c69aa9845f36488482 | |
parent | fb81686a897bd54c0b0eef1d45b4af72fb31f35e (diff) | |
download | gtk+-fbd79d8fea7dd2380ba4f0772b3c6616afaa29b5.tar.gz |
widget: Only initialize bounds rect if necessary
We only use the graphene_rect_t version of the offset_clip for the
fallback cairo nodes.
-rw-r--r-- | gtk/gtkwidget.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index d074b529fa..4ae273036e 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -14076,7 +14076,6 @@ gtk_widget_snapshot (GtkWidget *widget, { GtkWidgetClass *klass = GTK_WIDGET_GET_CLASS (widget); GtkWidgetPrivate *priv; - graphene_rect_t bounds; GtkCssValue *filter_value; RenderMode mode; double opacity; @@ -14117,12 +14116,6 @@ gtk_widget_snapshot (GtkWidget *widget, filter_value = _gtk_style_context_peek_property (_gtk_widget_get_style_context (widget), GTK_CSS_PROPERTY_FILTER); gtk_css_filter_value_push_snapshot (filter_value, snapshot); - graphene_rect_init (&bounds, - offset_clip.x, - offset_clip.y, - offset_clip.width, - offset_clip.height); - style = gtk_css_node_get_style (priv->cssnode); get_box_margin (style, &margin); get_box_border (style, &border); @@ -14133,8 +14126,15 @@ gtk_widget_snapshot (GtkWidget *widget, if (mode == RENDER_DRAW) { cairo_t *cr; + graphene_rect_t bounds; + + graphene_rect_init (&bounds, + offset_clip.x, + offset_clip.y, + offset_clip.width, + offset_clip.height); - cr = gtk_snapshot_append_cairo (snapshot, + cr = gtk_snapshot_append_cairo (snapshot, &bounds, "Fallback<%s>", G_OBJECT_TYPE_NAME (widget)); gtk_widget_draw_internal (widget, cr); @@ -14171,8 +14171,15 @@ gtk_widget_snapshot (GtkWidget *widget, */ gboolean result; cairo_t *cr; + graphene_rect_t bounds; + + graphene_rect_init (&bounds, + offset_clip.x, + offset_clip.y, + offset_clip.width, + offset_clip.height); - cr = gtk_snapshot_append_cairo (snapshot, + cr = gtk_snapshot_append_cairo (snapshot, &bounds, "DrawSignalContents<%s>", G_OBJECT_TYPE_NAME (widget)); g_signal_emit (widget, widget_signals[DRAW], 0, cr, &result); |