diff options
-rw-r--r-- | gtk/gtkcolorbutton.c | 2 | ||||
-rw-r--r-- | gtk/gtkcolorswatch.c | 2 | ||||
-rw-r--r-- | gtk/gtkcssimage.c | 6 | ||||
-rw-r--r-- | gtk/gtkiconview.c | 2 | ||||
-rw-r--r-- | gtk/gtkoverlay.c | 1 | ||||
-rw-r--r-- | gtk/gtksnapshot.c | 8 | ||||
-rw-r--r-- | gtk/gtksnapshot.h | 3 | ||||
-rw-r--r-- | gtk/gtkstack.c | 1 | ||||
-rw-r--r-- | gtk/gtktextutil.c | 4 | ||||
-rw-r--r-- | gtk/gtktreeview.c | 2 | ||||
-rw-r--r-- | gtk/gtkwidget.c | 11 | ||||
-rw-r--r-- | tests/testlist3.c | 2 |
12 files changed, 13 insertions, 31 deletions
diff --git a/gtk/gtkcolorbutton.c b/gtk/gtkcolorbutton.c index 084105a0f4..97c039f4a9 100644 --- a/gtk/gtkcolorbutton.c +++ b/gtk/gtkcolorbutton.c @@ -326,7 +326,7 @@ set_color_icon (GdkDragContext *context, GtkSnapshot *snapshot; GdkPaintable *paintable; - snapshot = gtk_snapshot_new (FALSE, NULL, "ColorDragIcon"); + snapshot = gtk_snapshot_new (FALSE, "ColorDragIcon"); gtk_snapshot_append_color (snapshot, rgba, &GRAPHENE_RECT_INIT(0, 0, 48, 32), diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c index 5f4a8eeb41..acd58d84d9 100644 --- a/gtk/gtkcolorswatch.c +++ b/gtk/gtkcolorswatch.c @@ -170,7 +170,7 @@ drag_set_color_icon (GdkDragContext *context, GtkSnapshot *snapshot; GdkPaintable *paintable; - snapshot = gtk_snapshot_new (FALSE, NULL, "ColorDragIcon"); + snapshot = gtk_snapshot_new (FALSE, "ColorDragIcon"); gtk_snapshot_append_color (snapshot, color, &GRAPHENE_RECT_INIT(0, 0, 48, 32), diff --git a/gtk/gtkcssimage.c b/gtk/gtkcssimage.c index fca30c97b6..842893eec2 100644 --- a/gtk/gtkcssimage.c +++ b/gtk/gtkcssimage.c @@ -243,7 +243,6 @@ _gtk_css_image_draw (GtkCssImage *image, { GtkSnapshot *snapshot; GskRenderNode *node; - cairo_region_t *clip; g_return_if_fail (GTK_IS_CSS_IMAGE (image)); g_return_if_fail (cr != NULL); @@ -252,8 +251,7 @@ _gtk_css_image_draw (GtkCssImage *image, cairo_save (cr); - clip = cairo_region_create_rectangle (&(cairo_rectangle_int_t) { 0, 0, width, height }); - snapshot = gtk_snapshot_new (FALSE, clip, "Fallback<%s>", G_OBJECT_TYPE_NAME (image)); + snapshot = gtk_snapshot_new (FALSE, "Fallback<%s>", G_OBJECT_TYPE_NAME (image)); gtk_css_image_snapshot (image, snapshot, width, height); node = gtk_snapshot_free_to_node (snapshot); @@ -263,8 +261,6 @@ _gtk_css_image_draw (GtkCssImage *image, gsk_render_node_unref (node); } - cairo_region_destroy (clip); - cairo_restore (cr); } diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 64121b19d3..4c431e1b96 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -6708,7 +6708,7 @@ gtk_icon_view_create_drag_icon (GtkIconView *icon_view, if (index == item->index) { - snapshot = gtk_snapshot_new (FALSE, NULL, "IconView DragIcon"); + snapshot = gtk_snapshot_new (FALSE, "IconView DragIcon"); gtk_icon_view_snapshot_item (icon_view, snapshot, item, icon_view->priv->item_padding, icon_view->priv->item_padding, diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c index 54230b6879..f101bce05b 100644 --- a/gtk/gtkoverlay.c +++ b/gtk/gtkoverlay.c @@ -675,7 +675,6 @@ gtk_overlay_snapshot (GtkWidget *widget, GtkSnapshot *child_snapshot; child_snapshot = gtk_snapshot_new (gtk_snapshot_get_record_names (snapshot), - NULL, "OverlayCaptureMainChild"); gtk_snapshot_offset (child_snapshot, main_alloc.x, main_alloc.y); gtk_widget_snapshot (main_widget, child_snapshot); diff --git a/gtk/gtksnapshot.c b/gtk/gtksnapshot.c index 05b07aa5f7..4a0cdd9865 100644 --- a/gtk/gtksnapshot.c +++ b/gtk/gtksnapshot.c @@ -198,7 +198,6 @@ gtk_snapshot_new_internal (gboolean record_names, /** * gtk_snapshot_new: * @record_names: whether to keep node names (for debugging purposes) - * @clip: (nullable): the clip region to use, or %NULL * @name: a printf-style format string to create the node name * @...: arguments for @name * @@ -207,9 +206,8 @@ gtk_snapshot_new_internal (gboolean record_names, * Returns: a newly-allocated #GtkSnapshot */ GtkSnapshot * -gtk_snapshot_new (gboolean record_names, - const cairo_region_t *clip, - const char *name, +gtk_snapshot_new (gboolean record_names, + const char *name, ...) { char *str; @@ -226,7 +224,7 @@ gtk_snapshot_new (gboolean record_names, str = NULL; return gtk_snapshot_new_internal (record_names, - (cairo_region_t *) clip, + NULL, str); } diff --git a/gtk/gtksnapshot.h b/gtk/gtksnapshot.h index add8cdd0b5..05de9ab599 100644 --- a/gtk/gtksnapshot.h +++ b/gtk/gtksnapshot.h @@ -53,9 +53,8 @@ GType gtk_snapshot_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_ALL GtkSnapshot * gtk_snapshot_new (gboolean record_names, - const cairo_region_t *clip, const char *name, - ...) G_GNUC_PRINTF (3, 4); + ...) G_GNUC_PRINTF (2, 3); GDK_AVAILABLE_IN_ALL GskRenderNode * gtk_snapshot_free_to_node (GtkSnapshot *snapshot); GDK_AVAILABLE_IN_ALL diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index 0b05f42352..a774abddf4 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -1946,7 +1946,6 @@ gtk_stack_snapshot (GtkWidget *widget, gtk_widget_get_allocation (priv->last_visible_child->widget, &priv->last_visible_surface_allocation); last_visible_snapshot = gtk_snapshot_new (gtk_snapshot_get_record_names (snapshot), - NULL, "StackCaptureLastVisibleChild"); gtk_widget_snapshot (priv->last_visible_child->widget, last_visible_snapshot); priv->last_visible_node = gtk_snapshot_free_to_node (last_visible_snapshot); diff --git a/gtk/gtktextutil.c b/gtk/gtktextutil.c index ae17123e0a..2507da9a84 100644 --- a/gtk/gtktextutil.c +++ b/gtk/gtktextutil.c @@ -226,7 +226,7 @@ gtk_text_util_create_drag_icon (GtkWidget *widget, limit_layout_lines (layout); - snapshot = gtk_snapshot_new (FALSE, NULL, "TextDragIcon"); + snapshot = gtk_snapshot_new (FALSE, "TextDragIcon"); style_context = gtk_widget_get_style_context (widget); gtk_style_context_get_color (style_context, @@ -332,7 +332,7 @@ gtk_text_util_create_rich_drag_icon (GtkWidget *widget, layout_width = MIN (layout_width, DRAG_ICON_MAX_WIDTH); layout_height = MIN (layout_height, DRAG_ICON_MAX_HEIGHT); - snapshot = gtk_snapshot_new (FALSE, NULL, "RichTextDragIcon"); + snapshot = gtk_snapshot_new (FALSE, "RichTextDragIcon"); cr = gtk_snapshot_append_cairo (snapshot, &GRAPHENE_RECT_INIT (0, 0, layout_width, layout_height), "Text"); diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 39b7193308..2ef45e0d9a 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -13868,7 +13868,7 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view, bin_window_width = gtk_widget_get_width (GTK_WIDGET (tree_view)); - snapshot = gtk_snapshot_new (FALSE, NULL, "TreeView DragIcon"); + snapshot = gtk_snapshot_new (FALSE, "TreeView DragIcon"); gtk_snapshot_render_background (snapshot, context, 0, 0, diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index b45ad3dd9b..14f121b31a 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -5320,15 +5320,9 @@ gtk_widget_draw_internal (GtkWidget *widget, if (mode == RENDER_SNAPSHOT) { GtkSnapshot *snapshot; - cairo_region_t *clip; GskRenderNode *node; - clip = cairo_region_create_rectangle (&(cairo_rectangle_int_t) { - widget->priv->clip.x - widget->priv->allocation.x, - widget->priv->clip.y - widget->priv->allocation.y, - widget->priv->clip.width, - widget->priv->clip.height}); - snapshot = gtk_snapshot_new (FALSE, clip, "Fallback<%s>", G_OBJECT_TYPE_NAME (widget)); + snapshot = gtk_snapshot_new (FALSE, "Fallback<%s>", G_OBJECT_TYPE_NAME (widget)); gtk_widget_snapshot (widget, snapshot); node = gtk_snapshot_free_to_node (snapshot); if (node != NULL) @@ -5336,8 +5330,6 @@ gtk_widget_draw_internal (GtkWidget *widget, gsk_render_node_draw (node, cr); gsk_render_node_unref (node); } - - cairo_region_destroy (clip); } else { @@ -13887,7 +13879,6 @@ gtk_widget_render (GtkWidget *widget, return; snapshot = gtk_snapshot_new (should_record_names (widget, renderer), - NULL, "Render<%s>", G_OBJECT_TYPE_NAME (widget)); gtk_widget_snapshot (widget, snapshot); root = gtk_snapshot_free_to_node (snapshot); diff --git a/tests/testlist3.c b/tests/testlist3.c index f11b01146d..cfd1bcb6da 100644 --- a/tests/testlist3.c +++ b/tests/testlist3.c @@ -18,7 +18,7 @@ drag_begin (GtkWidget *widget, row = gtk_widget_get_ancestor (widget, GTK_TYPE_LIST_BOX_ROW); gtk_widget_get_allocation (row, &alloc); - snapshot = gtk_snapshot_new (FALSE, NULL, "DragIcon"); + snapshot = gtk_snapshot_new (FALSE, "DragIcon"); cr = gtk_snapshot_append_cairo (snapshot, &GRAPHENE_RECT_INIT(0, 0, alloc.width, alloc.height), "DragText"); |