From fce08043c7b939ecefb44e22852513b4d60f3ac4 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sat, 8 Mar 2008 13:19:23 +0100 Subject: Added reference counting when debug printing fitz tree. --- world/node_tolisp.c | 10 +++++----- world/node_toxml.c | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'world') diff --git a/world/node_tolisp.c b/world/node_tolisp.c index a02c0261..364d2862 100644 --- a/world/node_tolisp.c +++ b/world/node_tolisp.c @@ -49,7 +49,7 @@ static void lispblend(fz_blendnode *node, int level) { fz_node *child; indent(level); - printf("(blend-%d\n", node->mode); + printf("(blend-%d %d\n", node->mode, node->cs->refs); for (child = node->super.first; child; child = child->next) lispnode(child, level + 1); indent(level); @@ -75,13 +75,13 @@ static void lispcolor(fz_colornode *node, int level) printf("(color %s ", node->cs->name); for (i = 0; i < node->n; i++) printf("%g ", node->samples[i]); - printf(")\n"); + printf(" %d)\n", node->cs->refs); } static void lisplink(fz_linknode *node, int level) { indent(level); - printf("(link %p)\n", node->tree); + printf("(link %p %d)\n", node->tree, node->tree->refs); } static void lisppath(fz_pathnode *node, int level) @@ -144,13 +144,13 @@ static void lispimage(fz_imagenode *node, int level) { fz_image *image = node->image; indent(level); - printf("(image %dx%d %d+%d)\n", image->w, image->h, image->n, image->a); + printf("(image %dx%d %d+%d %d)\n", image->w, image->h, image->n, image->a, image->refs); } static void lispshade(fz_shadenode *node, int level) { indent(level); - printf("(shade)\n"); + printf("(shade %d)\n", node->shade->refs); } static void lispnode(fz_node *node, int level) diff --git a/world/node_toxml.c b/world/node_toxml.c index 42ef6f9c..6ce01732 100644 --- a/world/node_toxml.c +++ b/world/node_toxml.c @@ -49,7 +49,7 @@ static void xmlblend(fz_blendnode *node, int level) { fz_node *child; indent(level); - printf("\n", node->mode); + printf("\n", node->mode, node->cs->refs); for (child = node->super.first; child; child = child->next) xmlnode(child, level + 1); indent(level); @@ -79,13 +79,13 @@ static void xmlsolid(fz_solidnode *node, int level) if (i < node->n - 1) putchar(' '); } - printf("\" />\n"); + printf("\" refs=\"%d\" />\n", node->cs->refs); } static void xmllink(fz_linknode *node, int level) { indent(level); - printf("\n", node->tree); + printf("\n", node->tree, node->tree->refs); } static void xmlpath(fz_pathnode *node, int level) @@ -149,14 +149,14 @@ static void xmlimage(fz_imagenode *node, int level) { fz_image *image = node->image; indent(level); - printf("\n", - image->w, image->h, image->n, image->a); + printf("\n", + image->w, image->h, image->n, image->a, image->refs); } static void xmlshade(fz_shadenode *node, int level) { indent(level); - printf("\n"); + printf("\n", node->shade->refs); } static void xmlnode(fz_node *node, int level) -- cgit v1.2.3