From 7e8759495855ce97f0422051af3e650f89d33ad4 Mon Sep 17 00:00:00 2001 From: Glenn Kennard Date: Sun, 30 Oct 2005 11:45:23 +0100 Subject: Optimize loadtile. Drops rendering time for first page of wildcatvpds.pdf from 3 to 2 seconds. --- raster/imageunpack.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/raster/imageunpack.c b/raster/imageunpack.c index a3642d3d..451967c8 100644 --- a/raster/imageunpack.c +++ b/raster/imageunpack.c @@ -154,19 +154,24 @@ static void loadtile1(byte *src, int sw, byte *dst, int dw, int w, int h, int pa src += sw; \ dst += dw; \ } \ - else \ + else { \ + int tpad; \ while (h--) \ { \ byte *dp = dst; \ + tpad = 0; \ for (x = 0; x < w; x++) \ { \ - if ((x % pad) == 0) \ - *dp++ = 255; \ + if (!tpad--) { \ + tpad = pad-1; \ + *dp++ = 255; \ + } \ *dp++ = getf(src, x); \ } \ src += sw; \ dst += dw; \ } \ + } \ } static void loadtile2(byte * restrict src, int sw, byte * restrict dst, int dw, int w, int h, int pad) -- cgit v1.2.3