[gtk+] glrenderer: Reuse the GArray for render items
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] glrenderer: Reuse the GArray for render items
- Date: Fri, 31 Mar 2017 07:54:42 +0000 (UTC)
commit d8f78d3a326c50ccb0cf1edc145890a44e8d58bd
Author: Timm Bäder <mail baedert org>
Date: Wed Mar 29 18:45:51 2017 +0200
glrenderer: Reuse the GArray for render items
gsk/gskglrenderer.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gsk/gskglrenderer.c b/gsk/gskglrenderer.c
index 67bd4f9..34a0215 100644
--- a/gsk/gskglrenderer.c
+++ b/gsk/gskglrenderer.c
@@ -181,6 +181,7 @@ gsk_gl_renderer_dispose (GObject *gobject)
GskGLRenderer *self = GSK_GL_RENDERER (gobject);
g_clear_object (&self->gl_context);
+ g_clear_pointer (&self->render_items, g_array_unref);
G_OBJECT_CLASS (gsk_gl_renderer_parent_class)->dispose (gobject);
}
@@ -997,8 +998,6 @@ gsk_gl_renderer_validate_tree (GskGLRenderer *self,
gdk_gl_context_make_current (self->gl_context);
- 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"));
@@ -1022,7 +1021,7 @@ gsk_gl_renderer_clear_tree (GskGLRenderer *self)
gdk_gl_context_make_current (self->gl_context);
- g_clear_pointer (&self->render_items, g_array_unref);
+ g_array_remove_range (self->render_items, 0, self->render_items->len);
removed_textures = gsk_gl_driver_collect_textures (self->gl_driver);
removed_vaos = gsk_gl_driver_collect_vaos (self->gl_driver);
@@ -1239,6 +1238,8 @@ gsk_gl_renderer_init (GskGLRenderer *self)
graphene_matrix_init_identity (&self->mvp);
+ self->render_items = g_array_new (FALSE, FALSE, sizeof (RenderItem));
+
#ifdef G_ENABLE_DEBUG
{
GskProfiler *profiler = gsk_renderer_get_profiler (GSK_RENDERER (self));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]