diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2015-07-29 19:17:04 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2015-08-20 11:22:56 +0200 |
commit | a58eed4ff202ef40c0fec931b2078d711bdd5890 (patch) | |
tree | ad244badc9371eb56cd7957237edf51ce886ea09 /source | |
parent | 041de6423d634965473906c5cf9c7b5480e5ec33 (diff) | |
download | mupdf-a58eed4ff202ef40c0fec931b2078d711bdd5890.tar.xz |
Remove a few debug functions left behind.
Diffstat (limited to 'source')
-rw-r--r-- | source/fitz/draw-scale-simple.c | 42 | ||||
-rw-r--r-- | source/fitz/stream-prog.c | 26 |
2 files changed, 0 insertions, 68 deletions
diff --git a/source/fitz/draw-scale-simple.c b/source/fitz/draw-scale-simple.c index 5651e1f4..397ba732 100644 --- a/source/fitz/draw-scale-simple.c +++ b/source/fitz/draw-scale-simple.c @@ -21,35 +21,6 @@ intermediate results rather than ints. */ #define SINGLE_PIXEL_SPECIALS -#ifdef DEBUG_SCALING -#ifdef WIN32 -#include <windows.h> -static void debug_print(const char *fmt, ...) -{ - va_list args; - char text[256]; - va_start(args, fmt); - vsprintf(text, fmt, args); - va_end(args); - OutputDebugStringA(text); - printf(text); -} -#else -static void debug_print(const char *fmt, ...) -{ - va_list args; - va_start(args, fmt); - vfprintf(stderr, fmt, args); - va_end(args); -} -#endif -#endif -#ifdef DEBUG_SCALING -#define DBUG(A) debug_print A -#else -#define DBUG(A) do {} while(0==1) -#endif - /* Consider a row of source samples, src, of width src_w, positioned at x, scaled to width dst_w. @@ -319,8 +290,6 @@ add_weight(fz_weights *weights, int j, int i, fz_scale_filter *filter, return; } - DBUG(("add_weight[%d][%d] = %d(%g) dist=%g\n",j,i,weight,f,dist)); - /* Move j from patch_l...patch_l+patch_w range to 0..patch_w range */ j -= weights->patch_l; if (weights->new_line) @@ -446,7 +415,6 @@ check_weights(fz_weights *weights, int j, int w, float x, float wf) * adjust it. */ else if ((j == w-1) && ((float)w-wf < 0.0001F) && (sum != 256)) weights->index[maxidx-1] += 256-sum; - DBUG(("total weight %d = %d\n", j, sum)); } static fz_weights * @@ -494,7 +462,6 @@ make_weights(fz_context *ctx, int src_w, float x, float dst_w, fz_scale_filter * G = src_w / dst_w; } window = filter->width / F; - DBUG(("make_weights src_w=%d x=%g dst_w=%g patch_l=%d patch_r=%d F=%g window=%g\n", src_w, x, dst_w, patch_l, patch_r, F, window)); weights = new_weights(ctx, filter, src_w, dst_w, patch_r-patch_l, n, flip, patch_l); if (!weights) return NULL; @@ -505,7 +472,6 @@ make_weights(fz_context *ctx, int src_w, float x, float dst_w, fz_scale_filter * int l, r; l = ceilf(centre - window); r = floorf(centre + window); - DBUG(("%d: centre=%g l=%d r=%d\n", j, centre, l, r)); init_weights(weights, j); for (; l <= r; l++) { @@ -1228,8 +1194,6 @@ fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float fz_var(contrib_cols); fz_var(contrib_rows); - DBUG(("Scale: (%d,%d) to (%g,%g) at (%g,%g)\n",src->w,src->h,w,h,x,y)); - /* Avoid extreme scales where overflows become problematic. */ if (w > (1<<24) || h > (1<<24) || w < -(1<<24) || h < -(1<<24)) return NULL; @@ -1320,8 +1284,6 @@ fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float dst_h_int = (int)ceilf(y + h); } - DBUG(("Result image: (%d,%d) at (%d,%d) (subpix=%g,%g)\n", dst_w_int, dst_h_int, dst_x_int, dst_y_int, x, y)); - /* Step 0: Calculate the patch */ patch.x0 = 0; patch.y0 = 0; @@ -1329,7 +1291,6 @@ fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float patch.y1 = dst_h_int; if (clip) { - DBUG(("Clip: (%d,%d) -> (%d,%d)\n", clip->x0, clip->y0, clip->x1, clip->y1)); if (flip_x) { if (dst_x_int + dst_w_int > clip->x1) @@ -1372,7 +1333,6 @@ fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float } } } - DBUG(("Patch: (%g,%g) -> (%g,%g)\n", patch.x0, patch.y0, patch.x1, patch.y1)); if (patch.x0 >= patch.x1 || patch.y0 >= patch.y1) return NULL; @@ -1478,12 +1438,10 @@ fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float { /* Scale another row */ assert(max_row < src->h); - DBUG(("scaling row %d to temp\n", max_row)); (*row_scale)(&temp[temp_span*(max_row % temp_rows)], &src->samples[(flip_y ? (src->h-1-max_row): max_row)*src->w*src->n], contrib_cols); max_row++; } - DBUG(("scaling row %d from temp\n", row)); scale_row_from_temp(&output->samples[row*output->w*output->n], temp, contrib_rows, temp_span, row); } fz_free(ctx, temp); diff --git a/source/fitz/stream-prog.c b/source/fitz/stream-prog.c index de739c5c..35905e46 100644 --- a/source/fitz/stream-prog.c +++ b/source/fitz/stream-prog.c @@ -1,20 +1,6 @@ #include "mupdf/fitz/stream.h" #include "mupdf/fitz/string.h" -#if (defined(_WIN32) || defined(_WIN64)) && !defined(NDEBUG) -#include "windows.h" - -static void -show_progress(int av, int pos) -{ - char text[80]; - sprintf(text, "Have %d, Want %d\n", av, pos); - OutputDebugStringA(text); -} -#else -#define show_progress(A,B) do {} while (0) -#endif - /* File stream - progressive reading to simulate http download */ typedef struct prog_state @@ -48,10 +34,7 @@ static int next_prog(fz_context *ctx, fz_stream *stm, int len) { len = av - stm->pos; if (len <= 0) - { - show_progress(av, stm->pos); fz_throw(ctx, FZ_ERROR_TRYLATER, "Not enough data yet"); - } } } @@ -81,28 +64,19 @@ static void seek_prog(fz_context *ctx, fz_stream *stm, fz_off_t offset, int when if (ps->available < ps->length) { if (whence == SEEK_END) - { - show_progress(ps->available, ps->length); fz_throw(ctx, FZ_ERROR_TRYLATER, "Not enough data to seek to end yet"); - } } if (whence == SEEK_CUR) { whence = SEEK_SET; offset += stm->pos; if (offset > ps->available) - { - show_progress(ps->available, offset); fz_throw(ctx, FZ_ERROR_TRYLATER, "Not enough data to seek (relatively) to offset yet"); - } } if (whence == SEEK_SET) { if (offset > ps->available) - { - show_progress(ps->available, offset); fz_throw(ctx, FZ_ERROR_TRYLATER, "Not enough data to seek to offset yet"); - } } if (fz_fseek(ps->file, offset, whence) != 0) |