[gtk+] gsk: Add gsk_container_node_new()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gsk: Add gsk_container_node_new()
- Date: Tue, 20 Dec 2016 17:09:05 +0000 (UTC)
commit a97b819b81a4f6b3e622014dab81b36cf5521092
Author: Benjamin Otte <otte redhat com>
Date: Sun Dec 11 04:14:04 2016 +0100
gsk: Add gsk_container_node_new()
It replaces gsk_renderer_create_render_node() which was doing the eact
same thing, only taking an unused extra argument.
docs/reference/gsk/gsk4-sections.txt | 2 +-
gsk/gskrenderer.c | 23 -----------------------
gsk/gskrenderer.h | 3 ---
gsk/gskrendernode.h | 3 +++
gsk/gskrendernodeimpl.c | 24 ++++++++++++++++++++++++
gtk/gtksnapshot.c | 4 ++--
6 files changed, 30 insertions(+), 29 deletions(-)
---
diff --git a/docs/reference/gsk/gsk4-sections.txt b/docs/reference/gsk/gsk4-sections.txt
index c9e6894..bbae443 100644
--- a/docs/reference/gsk/gsk4-sections.txt
+++ b/docs/reference/gsk/gsk4-sections.txt
@@ -11,7 +11,6 @@ gsk_renderer_realize
gsk_renderer_unrealize
gsk_renderer_begin_draw_frame
gsk_renderer_end_draw_frame
-gsk_renderer_create_render_node
gsk_renderer_render
<SUBSECTION Standard>
GSK_IS_RENDERER
@@ -50,6 +49,7 @@ gsk_render_node_set_name
gsk_texture_node_new
gsk_cairo_node_new
gsk_cairo_node_get_draw_context
+gsk_container_node_new
<SUBSECTION Standard>
GSK_IS_RENDER_NODE
GSK_RENDER_NODE
diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c
index b766a73..7d5a949 100644
--- a/gsk/gskrenderer.c
+++ b/gsk/gskrenderer.c
@@ -676,29 +676,6 @@ gsk_renderer_render (GskRenderer *renderer,
g_clear_pointer (&priv->root_node, gsk_render_node_unref);
}
-static const GskRenderNodeClass GSK_CONTAINER_NODE_CLASS = {
- GSK_CONTAINER_NODE,
- "GskContainerNode"
-};
-
-/**
- * gsk_renderer_create_render_node:
- * @renderer: a #GskRenderer
- *
- * Creates a new #GskRenderNode instance tied to the given @renderer.
- *
- * Returns: (transfer full): the new #GskRenderNode
- *
- * Since: 3.90
- */
-GskRenderNode *
-gsk_renderer_create_render_node (GskRenderer *renderer)
-{
- g_return_val_if_fail (GSK_IS_RENDERER (renderer), NULL);
-
- return gsk_render_node_new (&GSK_CONTAINER_NODE_CLASS);
-}
-
/*< private >
* gsk_renderer_get_profiler:
* @renderer: a #GskRenderer
diff --git a/gsk/gskrenderer.h b/gsk/gskrenderer.h
index 1728fc9..53fccf0 100644
--- a/gsk/gskrenderer.h
+++ b/gsk/gskrenderer.h
@@ -69,9 +69,6 @@ GDK_AVAILABLE_IN_3_90
void gsk_renderer_unrealize (GskRenderer *renderer);
GDK_AVAILABLE_IN_3_90
-GskRenderNode * gsk_renderer_create_render_node (GskRenderer *renderer);
-
-GDK_AVAILABLE_IN_3_90
GskRenderer * gsk_renderer_create_fallback (GskRenderer *renderer,
const graphene_rect_t *viewport,
cairo_t *cr);
diff --git a/gsk/gskrendernode.h b/gsk/gskrendernode.h
index 6dd8e66..6c40d41 100644
--- a/gsk/gskrendernode.h
+++ b/gsk/gskrendernode.h
@@ -55,6 +55,9 @@ cairo_t * gsk_cairo_node_get_draw_context (GskRenderNode
GskRenderer *renderer);
GDK_AVAILABLE_IN_3_90
+GskRenderNode * gsk_container_node_new (void);
+
+GDK_AVAILABLE_IN_3_90
GskRenderNode * gsk_render_node_get_parent (GskRenderNode *node);
GDK_AVAILABLE_IN_3_90
GskRenderNode * gsk_render_node_get_first_child (GskRenderNode *node);
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index 5b1cbf5..920afaf 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -201,3 +201,27 @@ gsk_cairo_node_get_draw_context (GskRenderNode *node,
return res;
}
+/**** GSK_CONTAINER_NODE ***/
+
+static const GskRenderNodeClass GSK_CONTAINER_NODE_CLASS = {
+ GSK_CONTAINER_NODE,
+ "GskContainerNode"
+};
+
+/**
+ * gsk_container_node_new:
+ *
+ * Creates a new #GskRenderNode instance for holding multiple different
+ * render nodes. You can use gsk_container_node_append_child() to add
+ * nodes to the container.
+ *
+ * Returns: (transfer full): the new #GskRenderNode
+ *
+ * Since: 3.90
+ */
+GskRenderNode *
+gsk_container_node_new (void)
+{
+ return gsk_render_node_new (&GSK_CONTAINER_NODE_CLASS);
+}
+
diff --git a/gtk/gtksnapshot.c b/gtk/gtksnapshot.c
index 803526b..cad6cbd 100644
--- a/gtk/gtksnapshot.c
+++ b/gtk/gtksnapshot.c
@@ -110,7 +110,7 @@ gtk_snapshot_init (GtkSnapshot *snapshot,
snapshot->state = NULL;
snapshot->renderer = renderer;
snapshot->clip_region = clip;
- snapshot->root = gsk_renderer_create_render_node (renderer);
+ snapshot->root = gsk_container_node_new ();
gsk_render_node_set_bounds (snapshot->root, &GRAPHENE_RECT_INIT (extents.x, extents.y, extents.width,
extents.height));
if (name)
@@ -182,7 +182,7 @@ gtk_snapshot_push (GtkSnapshot *snapshot,
{
GskRenderNode *node;
- node = gsk_renderer_create_render_node (snapshot->renderer);
+ node = gsk_container_node_new ();
gsk_render_node_set_bounds (node, bounds);
if (name)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]