diff options
author | Robin Watts <robin.watts@artifex.com> | 2015-04-06 14:19:05 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2015-04-06 19:32:02 +0100 |
commit | 281ac672ab3b340008d7509007022336c9ce4277 (patch) | |
tree | 496bb67afcd2f3ee01552cd28e9411f0ebf26f54 /source/fitz | |
parent | 60a57ea87f74a6457cbdbc85348d4e4af68df569 (diff) | |
download | mupdf-281ac672ab3b340008d7509007022336c9ce4277.tar.xz |
Add some simple debug code to dump fz_gels.
Just for internal use, no external interface.
Diffstat (limited to 'source/fitz')
-rw-r--r-- | source/fitz/draw-edge.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/fitz/draw-edge.c b/source/fitz/draw-edge.c index 4309b858..c53548ab 100644 --- a/source/fitz/draw-edge.c +++ b/source/fitz/draw-edge.c @@ -167,6 +167,24 @@ struct fz_gel_s fz_edge **active; }; +#ifdef DUMP_GELS +static void +fz_dump_gel(fz_gel *gel) +{ + int i; + + printf("%d edges\n", gel->len); + for (i = 0; i < gel->len; i++) + { + fz_edge *e = &gel->edges[i]; + if (e->ydir > 0) + printf("%d %d -> %d %d\n", e->x, e->y, e->x + e->h * e->xmove + e->xdir * e->h * e->adj_up / e->adj_down, e->y + e->h); + else + printf("%d %d -> %d %d\n", e->x + e->h * e->xmove + e->xdir * e->h * e->adj_up / e->adj_down, e->y + e->h, e->x, e->y); + } +} +#endif + fz_gel * fz_new_gel(fz_context *ctx) { @@ -491,6 +509,9 @@ fz_sort_gel(fz_context *ctx, fz_gel *gel) if (n > 10000) { qsort(a, n, sizeof *a, cmpedge); +#ifdef DUMP_GELS + fz_dump_gel(gel); +#endif return; } @@ -520,6 +541,10 @@ fz_sort_gel(fz_context *ctx, fz_gel *gel) } h /= 3; } + +#ifdef DUMP_GELS + fz_dump_gel(gel); +#endif } int |