[gtk+/wip/otte/rendernode: 36/110] gsk: Remove gsk_render_node_get_size()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/rendernode: 36/110] gsk: Remove gsk_render_node_get_size()
- Date: Mon, 19 Dec 2016 04:47:14 +0000 (UTC)
commit fe3442abe73786bbd508d04f0db6304f68c7bebb
Author: Benjamin Otte <otte redhat com>
Date: Sun Dec 11 11:55:10 2016 +0100
gsk: Remove gsk_render_node_get_size()
In the brave new world of refactored render nodes, this function doesn't
really make any sense anymore. We could turn it into a vfunc, but I
don't think it's useful.
Especially because even in the brave old world, this function was
causing a vastl overallocation of nodes when the GL renderer needed render
targets.
gsk/gskglrenderer.c | 11 +++--------
gsk/gskrendernode.c | 27 ---------------------------
gsk/gskrendernodeprivate.h | 2 --
3 files changed, 3 insertions(+), 37 deletions(-)
---
diff --git a/gsk/gskglrenderer.c b/gsk/gskglrenderer.c
index f7bf7bc..f7d9eb9 100644
--- a/gsk/gskglrenderer.c
+++ b/gsk/gskglrenderer.c
@@ -800,28 +800,23 @@ gsk_gl_renderer_validate_tree (GskGLRenderer *self,
GskRenderNode *root,
const graphene_matrix_t *projection)
{
- int n_nodes;
-
if (self->gl_context == NULL)
{
GSK_NOTE (OPENGL, g_print ("No valid GL context associated to the renderer"));
return FALSE;
}
- n_nodes = gsk_render_node_get_size (root);
-
gdk_gl_context_make_current (self->gl_context);
- self->render_items = g_array_sized_new (FALSE, FALSE, sizeof (RenderItem), n_nodes);
+ self->render_items = g_array_new (FALSE, FALSE, sizeof (RenderItem));
gsk_gl_driver_begin_frame (self->gl_driver);
GSK_NOTE (OPENGL, g_print ("RenderNode -> RenderItem\n"));
gsk_gl_renderer_add_render_item (self, projection, self->render_items, root, NULL);
- GSK_NOTE (OPENGL, g_print ("Total render items: %d of max:%d\n",
- self->render_items->len,
- n_nodes));
+ GSK_NOTE (OPENGL, g_print ("Total render items: %d\n",
+ self->render_items->len));
gsk_gl_driver_end_frame (self->gl_driver);
diff --git a/gsk/gskrendernode.c b/gsk/gskrendernode.c
index 62b0caf..0a93c33 100644
--- a/gsk/gskrendernode.c
+++ b/gsk/gskrendernode.c
@@ -849,30 +849,3 @@ gsk_render_node_make_immutable (GskRenderNode *node)
node->is_mutable = FALSE;
}
-/*< private >
- * gsk_render_node_get_size:
- * @root: a #GskRenderNode
- *
- * Computes the total number of children of @root.
- *
- * Returns: the size of the tree
- */
-int
-gsk_render_node_get_size (GskRenderNode *root)
-{
- GskRenderNode *child;
- int res;
-
- g_return_val_if_fail (GSK_IS_RENDER_NODE (root), 0);
-
- res = 1;
- 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/gskrendernodeprivate.h b/gsk/gskrendernodeprivate.h
index 5ffb48e..31653d4 100644
--- a/gsk/gskrendernodeprivate.h
+++ b/gsk/gskrendernodeprivate.h
@@ -89,8 +89,6 @@ void gsk_render_node_update_world_matrix (GskRenderNode *node,
void gsk_render_node_get_world_matrix (GskRenderNode *node,
graphene_matrix_t *mv);
-int gsk_render_node_get_size (GskRenderNode *root);
-
G_END_DECLS
#endif /* __GSK_RENDER_NODE_PRIVATE_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]