[gtk+/wip/matthiasc/gsk-renderer: 2/5] gsk: Improve debug output a bit
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/matthiasc/gsk-renderer: 2/5] gsk: Improve debug output a bit
- Date: Wed, 3 Aug 2016 02:02:23 +0000 (UTC)
commit 0544922cd15be4bf8651547033f8bee8757347f5
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Aug 2 21:52:30 2016 -0400
gsk: Improve debug output a bit
Indent render node debug spew to make the tree structure obvious.
gsk/gskglrenderer.c | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/gsk/gskglrenderer.c b/gsk/gskglrenderer.c
index 22e1558..891b023 100644
--- a/gsk/gskglrenderer.c
+++ b/gsk/gskglrenderer.c
@@ -359,6 +359,18 @@ gsk_gl_renderer_update_frustum (GskGLRenderer *self,
#define N_VERTICES 6
+static inline int
+node_depth (GskRenderNode *node)
+{
+ int ret = 0;
+ while (node->parent)
+ {
+ ret++;
+ node = node->parent;
+ }
+ return ret;
+}
+
static void
render_item (GskGLRenderer *self,
RenderItem *item)
@@ -411,7 +423,8 @@ render_item (GskGLRenderer *self,
glUniformMatrix4fv (item->render_data.mvp_location, 1, GL_FALSE, mvp);
/* Draw the quad */
- GSK_NOTE (OPENGL, g_print ("Drawing item <%s>[%p] (w:%g, h:%g) with opacity: %g\n",
+ GSK_NOTE (OPENGL, g_print ("%*sDrawing item <%s>[%p] (w:%g, h:%g) with opacity: %g\n",
+ 2 * node_depth (item->node), "",
item->name,
item,
item->size.width, item->size.height,
@@ -460,7 +473,8 @@ render_item (GskGLRenderer *self,
glUniformMatrix4fv (item->render_data.mvp_location, 1, GL_FALSE, mvp);
/* Draw the quad */
- GSK_NOTE (OPENGL, g_print ("Drawing offscreen item <%s>[%p] (w:%g, h:%g) with opacity: %g\n",
+ GSK_NOTE (OPENGL, g_print ("%*sDrawing offscreen item <%s>[%p] (w:%g, h:%g) with opacity: %g\n",
+ 2 * node_depth (item->node), "",
item->name,
item,
item->size.width, item->size.height,
@@ -704,7 +718,8 @@ gsk_gl_renderer_add_render_item (GskGLRenderer *self,
self->gl_mag_filter);
}
- GSK_NOTE (OPENGL, g_print ("Adding node <%s>[%p] to render items\n",
+ GSK_NOTE (OPENGL, g_print ("%*sAdding node <%s>[%p] to render items\n",
+ 2 * node_depth (node), "",
node->name != NULL ? node->name : "unnamed",
node));
g_array_append_val (render_items, item);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]