snapshot: Remove renderer
authorBenjamin Otte <otte@redhat.com>
Sat, 24 Mar 2018 20:41:53 +0000 (21:41 +0100)
committerBenjamin Otte <otte@redhat.com>
Sat, 24 Mar 2018 20:57:20 +0000 (21:57 +0100)
Now that there's no longer a need to keep the renderer around for Cairo
rendering, don't do that then.

gtk/gtkcssimage.c
gtk/gtkiconview.c
gtk/gtkmagnifier.c
gtk/gtkoverlay.c
gtk/gtksnapshot.c
gtk/gtksnapshot.h
gtk/gtksnapshotprivate.h
gtk/gtkstack.c
gtk/gtktreeview.c
gtk/gtkwidget.c

index c61c3ee4a5978e3cbddeb2df239d20aba19cd796..fca30c97b66b4765edd067cb6de87bd7e4427e8d 100644 (file)
@@ -253,7 +253,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 (NULL, FALSE, clip, "Fallback<%s>", G_OBJECT_TYPE_NAME (image));
+  snapshot = gtk_snapshot_new (FALSE, clip, "Fallback<%s>", G_OBJECT_TYPE_NAME (image));
   gtk_css_image_snapshot (image, snapshot, width, height);
   node = gtk_snapshot_free_to_node (snapshot);
 
index e90e68b8a7150056a3e0f2d51b681b5a10cda1b9..65af792f8e48a0004d5fd7801335072bfd011cc4 100644 (file)
@@ -6724,7 +6724,7 @@ gtk_icon_view_create_drag_icon (GtkIconView *icon_view,
                                                        rect.width,
                                                        rect.height);
 
-    snapshot = gtk_snapshot_new (NULL, FALSE, NULL, "IconView DragIcon");
+    snapshot = gtk_snapshot_new (FALSE, NULL, "IconView DragIcon");
          gtk_icon_view_snapshot_item (icon_view, snapshot, item,
                                  icon_view->priv->item_padding,
                                  icon_view->priv->item_padding,
index fbcab5733c61c0aca41a8c57552ab9bd95e774c6..9b1e8b7a1b275595d2ce944f581ea397a99b7a82 100644 (file)
@@ -115,8 +115,7 @@ gtk_magnifier_snapshot (GtkWidget   *widget,
 
   g_signal_handler_block (priv->inspected, priv->draw_handler);
 
-  inspected_snapshot = gtk_snapshot_new (gtk_snapshot_get_renderer (snapshot),
-                                         gtk_snapshot_get_record_names (snapshot),
+  inspected_snapshot = gtk_snapshot_new (gtk_snapshot_get_record_names (snapshot),
                                          NULL,
                                          "MagnifierSnapshot");
 
index d12381bd8400e5ca3c2933f3317136098e159a02..2e8f4dc2f9fc98b3be398f24be41104cfbd65241 100644 (file)
@@ -675,8 +675,7 @@ gtk_overlay_snapshot (GtkWidget   *widget,
             {
               GtkSnapshot *child_snapshot;
 
-              child_snapshot = gtk_snapshot_new (gtk_snapshot_get_renderer (snapshot),
-                                                 gtk_snapshot_get_record_names (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);
index 201c7c2fb5d27e9f631afb6a6710a24773ab1e91..cc8bd80b506ba89d0d5959ac64f35368c9468898 100644 (file)
@@ -157,7 +157,6 @@ gtk_snapshot_state_clear (GtkSnapshotState *state)
 
 /**
  * gtk_snapshot_new:
- * @renderer: the #GskRenderer to create nodes for
  * @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
@@ -168,8 +167,7 @@ gtk_snapshot_state_clear (GtkSnapshotState *state)
  * Returns: a newly-allocated #GtkSnapshot
  */
 GtkSnapshot *
-gtk_snapshot_new (GskRenderer          *renderer,
-                  gboolean              record_names,
+gtk_snapshot_new (gboolean              record_names,
                   const cairo_region_t *clip,
                   const char           *name,
                   ...)
@@ -191,7 +189,6 @@ gtk_snapshot_new (GskRenderer          *renderer,
   snapshot = g_object_new (GTK_TYPE_SNAPSHOT, NULL);
 
   snapshot->record_names = record_names;
-  snapshot->renderer = renderer;
   snapshot->state_stack = g_array_new (FALSE, TRUE, sizeof (GtkSnapshotState));
   g_array_set_clear_func (snapshot->state_stack, (GDestroyNotify)gtk_snapshot_state_clear);
   snapshot->nodes = g_ptr_array_new_with_free_func ((GDestroyNotify)gsk_render_node_unref);
@@ -1199,21 +1196,6 @@ gtk_snapshot_pop (GtkSnapshot *snapshot)
     }
 }
 
-/**
- * gtk_snapshot_get_renderer:
- * @snapshot: a #GtkSnapshot
- *
- * Obtains the #GskRenderer that this snapshot will be
- * rendered with.
- *
- * Returns: (transfer none): the #GskRenderer
- */
-GskRenderer *
-gtk_snapshot_get_renderer (GtkSnapshot *snapshot)
-{
-  return snapshot->renderer;
-}
-
 /**
  * gtk_snapshot_get_record_names:
  * @snapshot: a #GtkSnapshot
index e9852f8b96a314e65598874bbbbe2c3e4232cdae..c8003956fecb42bdcbdbe91510330f81d12c4798 100644 (file)
@@ -52,19 +52,16 @@ GDK_AVAILABLE_IN_ALL
 GType           gtk_snapshot_get_type                   (void) G_GNUC_CONST;
 
 GDK_AVAILABLE_IN_ALL
-GtkSnapshot *   gtk_snapshot_new                        (GskRenderer            *renderer,
-                                                         gboolean                record_names,
+GtkSnapshot *   gtk_snapshot_new                        (gboolean                record_names,
                                                          const cairo_region_t   *clip,
                                                          const char             *name,
-                                                         ...) G_GNUC_PRINTF (4, 5);
+                                                         ...) G_GNUC_PRINTF (3, 4);
 GDK_AVAILABLE_IN_ALL
 GskRenderNode * gtk_snapshot_free_to_node               (GtkSnapshot            *snapshot);
 
 GDK_AVAILABLE_IN_ALL
 GskRenderNode * gtk_snapshot_to_node                    (GtkSnapshot            *snapshot);
 
-GDK_AVAILABLE_IN_ALL
-GskRenderer *   gtk_snapshot_get_renderer               (GtkSnapshot            *snapshot);
 GDK_AVAILABLE_IN_ALL
 gboolean        gtk_snapshot_get_record_names           (GtkSnapshot            *snapshot);
 
index d6e534deef93dc6670a30f8c237f2c285713a931..920da7917d49262654dc212eea4229df9e4fbf86 100644 (file)
@@ -89,7 +89,6 @@ struct _GdkSnapshot {
   GObject                parent_instance; /* it's really GdkSnapshot, but don't tell anyone! */
 
   gboolean               record_names;
-  GskRenderer           *renderer;
   GArray                *state_stack;
   GPtrArray             *nodes;
 };
index 22efd3250e7e3d8178f6ee33c75e1b4c7c66c4c2..a5c46ba2cfa2d17b215ef612cb50775bd39e94e0 100644 (file)
@@ -1956,8 +1956,7 @@ 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_renderer (snapshot),
-                                                        gtk_snapshot_get_record_names (snapshot),
+              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);
index 95470527214c9d2e2de937cde6f8ad10df015993..644f21ae22769e14c9c031a60e5b475a87c39b62 100644 (file)
@@ -13860,7 +13860,7 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView  *tree_view,
                                                bin_window_width + 2,
                                                background_area.height + 2);
 
-  snapshot = gtk_snapshot_new (NULL, FALSE, NULL, "TreeView DragIcon");
+  snapshot = gtk_snapshot_new (FALSE, NULL, "TreeView DragIcon");
 
   gtk_snapshot_render_background (snapshot, context,
                                   0, 0,
index b551edb018115f74a62a031afb0b88cc040c8b27..3d66f3e19195bbd907cfb1f5abfcd76ca2165f8a 100644 (file)
@@ -5444,7 +5444,6 @@ gtk_widget_draw_internal (GtkWidget *widget,
 
       if (mode == RENDER_SNAPSHOT)
         {
-          GskRenderer *renderer = gtk_widget_get_renderer (widget);
           GtkSnapshot *snapshot;
           cairo_region_t *clip;
           GskRenderNode *node;
@@ -5454,7 +5453,7 @@ gtk_widget_draw_internal (GtkWidget *widget,
                                                 widget->priv->clip.y - widget->priv->allocation.y,
                                                 widget->priv->clip.width,
                                                 widget->priv->clip.height});
-          snapshot = gtk_snapshot_new (renderer, FALSE, clip, "Fallback<%s>", G_OBJECT_TYPE_NAME (widget));
+          snapshot = gtk_snapshot_new (FALSE, clip, "Fallback<%s>", G_OBJECT_TYPE_NAME (widget));
           gtk_widget_snapshot (widget, snapshot);
           node = gtk_snapshot_free_to_node (snapshot);
           if (node != NULL)
@@ -13982,8 +13981,7 @@ gtk_widget_render (GtkWidget            *widget,
   context = gsk_renderer_begin_draw_frame (renderer, region);
   clip = gdk_drawing_context_get_clip (context);
 
-  snapshot = gtk_snapshot_new (renderer,
-                               should_record_names (widget, renderer),
+  snapshot = gtk_snapshot_new (should_record_names (widget, renderer),
                                clip,
                                "Render<%s>", G_OBJECT_TYPE_NAME (widget));
   cairo_region_destroy (clip);