[gtk+/wip/otte/rendernode: 5/15] gsk: Remove GskRenderNodeIter
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/rendernode: 5/15] gsk: Remove GskRenderNodeIter
- Date: Sun, 11 Dec 2016 03:15:51 +0000 (UTC)
commit 5b7a88a91fbcd27985cad285d7f87c157a4f6caa
Author: Benjamin Otte <otte redhat com>
Date: Sat Dec 10 16:59:34 2016 +0100
gsk: Remove GskRenderNodeIter
docs/reference/gsk/gsk4-sections.txt | 15 --
gsk/Makefile.am | 2 -
gsk/gsk.h | 1 -
gsk/gskcairorenderer.c | 11 +-
gsk/gskglrenderer.c | 11 +-
gsk/gskrendernode.c | 45 +++---
gsk/gskrendernodeiter.c | 254 ----------------------------------
gsk/gskrendernodeiter.h | 45 ------
gsk/gskvulkanrenderer.c | 1 -
9 files changed, 34 insertions(+), 351 deletions(-)
---
diff --git a/docs/reference/gsk/gsk4-sections.txt b/docs/reference/gsk/gsk4-sections.txt
index ecf95b7..bbfa45e 100644
--- a/docs/reference/gsk/gsk4-sections.txt
+++ b/docs/reference/gsk/gsk4-sections.txt
@@ -65,18 +65,3 @@ GskRenderNodeClass
gsk_render_node_get_type
GSK_TYPE_BLEND_MODE
</SECTION>
-
-<SECTION>
-<FILE>GskRenderNodeIter</FILE>
-gsk_render_node_iter_new
-gsk_render_node_iter_free
-gsk_render_node_iter_init
-gsk_render_node_iter_is_valid
-gsk_render_node_iter_prev
-gsk_render_node_iter_next
-gsk_render_node_iter_remove
-<SUBSECTION Standard>
-GSK_TYPE_RENDER_NODE_ITER
-GskRenderNodeIter
-gsk_render_node_iter_get_type
-</SECTION>
diff --git a/gsk/Makefile.am b/gsk/Makefile.am
index 32f37d3..9091c24 100644
--- a/gsk/Makefile.am
+++ b/gsk/Makefile.am
@@ -47,7 +47,6 @@ gsk_public_source_h = \
gskenums.h \
gskrenderer.h \
gskrendernode.h \
- gskrendernodeiter.h \
gsktexture.h \
gsktypes.h
gsk_private_source_h = \
@@ -66,7 +65,6 @@ gsk_private_source_h = \
gsk_public_source_c = \
gskrenderer.c \
gskrendernode.c \
- gskrendernodeiter.c \
gsktexture.c
gsk_private_source_c = \
$(gsk_private_vulkan_source_c) \
diff --git a/gsk/gsk.h b/gsk/gsk.h
index 394895c..92ce028 100644
--- a/gsk/gsk.h
+++ b/gsk/gsk.h
@@ -23,7 +23,6 @@
#include <gsk/gskenums.h>
#include <gsk/gskrenderer.h>
#include <gsk/gskrendernode.h>
-#include <gsk/gskrendernodeiter.h>
#include <gsk/gsktexture.h>
#include <gsk/gsktypes.h>
diff --git a/gsk/gskcairorenderer.c b/gsk/gskcairorenderer.c
index 9b333c5..7e96052 100644
--- a/gsk/gskcairorenderer.c
+++ b/gsk/gskcairorenderer.c
@@ -4,7 +4,6 @@
#include "gskdebugprivate.h"
#include "gskrendererprivate.h"
-#include "gskrendernodeiter.h"
#include "gskrendernodeprivate.h"
#include "gsktextureprivate.h"
@@ -52,7 +51,6 @@ gsk_cairo_renderer_render_node (GskCairoRenderer *self,
GskRenderNode *node,
cairo_t *cr)
{
- GskRenderNodeIter iter;
GskRenderNode *child;
gboolean pop_group = FALSE;
graphene_matrix_t mvp;
@@ -136,9 +134,12 @@ out:
GSK_NOTE (CAIRO, g_print ("Drawing %d children of node [%p]\n",
gsk_render_node_get_n_children (node),
node));
- gsk_render_node_iter_init (&iter, node);
- while (gsk_render_node_iter_next (&iter, &child))
- gsk_cairo_renderer_render_node (self, child, cr);
+ for (child = gsk_render_node_get_first_child (node);
+ child != NULL;
+ child = gsk_render_node_get_next_sibling (child))
+ {
+ gsk_cairo_renderer_render_node (self, child, cr);
+ }
}
if (pop_group)
diff --git a/gsk/gskglrenderer.c b/gsk/gskglrenderer.c
index ad03664..f8524ee 100644
--- a/gsk/gskglrenderer.c
+++ b/gsk/gskglrenderer.c
@@ -9,7 +9,6 @@
#include "gskprofilerprivate.h"
#include "gskrendererprivate.h"
#include "gskrendernodeprivate.h"
-#include "gskrendernodeiter.h"
#include "gskshaderbuilderprivate.h"
#include "gsktextureprivate.h"
@@ -627,7 +626,6 @@ gsk_gl_renderer_add_render_item (GskGLRenderer *self,
RenderItem *parent)
{
graphene_rect_t viewport;
- GskRenderNodeIter iter;
graphene_matrix_t mv;
graphene_rect_t bounds;
GskRenderNode *child;
@@ -789,9 +787,12 @@ gsk_gl_renderer_add_render_item (GskGLRenderer *self,
render_items = item.children;
out:
- gsk_render_node_iter_init (&iter, node);
- while (gsk_render_node_iter_next (&iter, &child))
- gsk_gl_renderer_add_render_item (self, projection, render_items, child, ritem);
+ for (child = gsk_render_node_get_first_child (node);
+ child != NULL;
+ child = gsk_render_node_get_next_sibling (child))
+ {
+ gsk_gl_renderer_add_render_item (self, projection, render_items, child, ritem);
+ }
}
static gboolean
diff --git a/gsk/gskrendernode.c b/gsk/gskrendernode.c
index 54ea5a5..13869e1 100644
--- a/gsk/gskrendernode.c
+++ b/gsk/gskrendernode.c
@@ -44,7 +44,6 @@
#include "gskrendernodeprivate.h"
#include "gskdebugprivate.h"
-#include "gskrendernodeiter.h"
#include "gskrendererprivate.h"
#include "gsktexture.h"
@@ -69,17 +68,14 @@ G_DEFINE_BOXED_TYPE (GskRenderNode, gsk_render_node,
static void
gsk_render_node_finalize (GskRenderNode *self)
{
- GskRenderNodeIter iter;
-
self->is_mutable = TRUE;
g_clear_pointer (&self->surface, cairo_surface_destroy);
g_clear_pointer (&self->texture, gsk_texture_unref);
g_clear_pointer (&self->name, g_free);
- gsk_render_node_iter_init (&iter, self);
- while (gsk_render_node_iter_next (&iter, NULL))
- gsk_render_node_iter_remove (&iter);
+ while (self->first_child)
+ gsk_render_node_remove_child (self, self->first_child);
g_slice_free (GskRenderNode, self);
}
@@ -697,17 +693,14 @@ gsk_render_node_remove_child (GskRenderNode *node,
GskRenderNode *
gsk_render_node_remove_all_children (GskRenderNode *node)
{
- GskRenderNodeIter iter;
-
g_return_val_if_fail (GSK_IS_RENDER_NODE (node), NULL);
g_return_val_if_fail (node->is_mutable, node);
if (node->n_children == 0)
return node;
- gsk_render_node_iter_init (&iter, node);
- while (gsk_render_node_iter_next (&iter, NULL))
- gsk_render_node_iter_remove (&iter);
+ while (node->first_child != NULL)
+ gsk_render_node_remove_child (node, node->first_child);
g_assert (node->n_children == 0);
g_assert (node->first_child == NULL);
@@ -967,7 +960,6 @@ void
gsk_render_node_update_world_matrix (GskRenderNode *node,
gboolean force)
{
- GskRenderNodeIter iter;
GskRenderNode *child;
if (force || node->needs_world_matrix_update)
@@ -1000,9 +992,12 @@ gsk_render_node_update_world_matrix (GskRenderNode *node,
node->needs_world_matrix_update = FALSE;
}
- gsk_render_node_iter_init (&iter, node);
- while (gsk_render_node_iter_next (&iter, &child))
- gsk_render_node_update_world_matrix (child, TRUE);
+ for (child = gsk_render_node_get_first_child (node);
+ child != NULL;
+ child = gsk_render_node_get_next_sibling (child))
+ {
+ gsk_render_node_update_world_matrix (child, TRUE);
+ }
}
gboolean
@@ -1289,7 +1284,6 @@ gsk_render_node_get_draw_context (GskRenderNode *node,
void
gsk_render_node_make_immutable (GskRenderNode *node)
{
- GskRenderNodeIter iter;
GskRenderNode *child;
if (!node->is_mutable)
@@ -1297,9 +1291,12 @@ gsk_render_node_make_immutable (GskRenderNode *node)
node->is_mutable = FALSE;
- gsk_render_node_iter_init (&iter, node);
- while (gsk_render_node_iter_next (&iter, &child))
- gsk_render_node_make_immutable (child);
+ for (child = gsk_render_node_get_first_child (node);
+ child != NULL;
+ child = gsk_render_node_get_next_sibling (child))
+ {
+ gsk_render_node_make_immutable (child);
+ }
}
/*< private >
@@ -1313,16 +1310,18 @@ gsk_render_node_make_immutable (GskRenderNode *node)
int
gsk_render_node_get_size (GskRenderNode *root)
{
- GskRenderNodeIter iter;
GskRenderNode *child;
int res;
g_return_val_if_fail (GSK_IS_RENDER_NODE (root), 0);
res = 1;
- gsk_render_node_iter_init (&iter, root);
- while (gsk_render_node_iter_next (&iter, &child))
- res += gsk_render_node_get_size (child);
+ for (child = gsk_render_node_get_first_child (root);
+ child != NULL;
+ child = gsk_render_node_get_next_sibling (child))
+ {
+ res += gsk_render_node_get_size (child);
+ }
return res;
}
diff --git a/gsk/gskvulkanrenderer.c b/gsk/gskvulkanrenderer.c
index 0e6a04b..08e94fc 100644
--- a/gsk/gskvulkanrenderer.c
+++ b/gsk/gskvulkanrenderer.c
@@ -5,7 +5,6 @@
#include "gskdebugprivate.h"
#include "gskprivate.h"
#include "gskrendererprivate.h"
-#include "gskrendernodeiter.h"
#include "gskrendernodeprivate.h"
#include "gsktextureprivate.h"
#include "gskvulkanbufferprivate.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]