summaryrefslogtreecommitdiff
path: root/fitzdraw
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2009-11-29 04:40:31 +0100
committerTor Andersson <tor@ghostscript.com>2009-11-29 04:40:31 +0100
commit2c080e248a47cb94d2069f6523c314d039f70919 (patch)
tree46180621f350edfb63ac578a04125dcd9db31f9d /fitzdraw
parentaf27ce7576c323665bb9986fbbab63acb6c81c17 (diff)
downloadmupdf-2c080e248a47cb94d2069f6523c314d039f70919.tar.xz
Fix up indentation.
Diffstat (limited to 'fitzdraw')
-rw-r--r--fitzdraw/archx86.c20
-rw-r--r--fitzdraw/blendmodes.c4
-rw-r--r--fitzdraw/glyphcache.c182
-rw-r--r--fitzdraw/imagescale.c32
-rw-r--r--fitzdraw/imageunpack.c14
-rw-r--r--fitzdraw/meshdraw.c34
-rw-r--r--fitzdraw/pathscan.c4
-rw-r--r--fitzdraw/pathstroke.c20
-rw-r--r--fitzdraw/pixmap.c6
-rw-r--r--fitzdraw/render.c104
10 files changed, 210 insertions, 210 deletions
diff --git a/fitzdraw/archx86.c b/fitzdraw/archx86.c
index abbdf1e0..f3d9ef24 100644
--- a/fitzdraw/archx86.c
+++ b/fitzdraw/archx86.c
@@ -12,18 +12,18 @@ typedef unsigned char byte;
#ifdef HAVE_MMX
/* -mmmx for gcc >= 3.4 enables the mmx intrinsic functions, icc and VC
- shouldn't require anything */
+shouldn't require anything */
#include <mmintrin.h>
static void duff_4i1o4mmx(byte *sp0, int sw, byte *mp0, int mw, byte *dp0, int dw, int w0, int h)
{
/*
- rendering all pages of
- x11pdf ~/doc/OpenGL/Presentations/CEDEC2003_Venus_and_Vulcan.pdf
- % cumulative self self total
- time seconds seconds calls ms/call ms/call name
- 30.50 20.04 20.04 261 76.76 76.76 duff_4i1o4
- 21.67 22.02 10.95 221 49.55 49.55 duff_4i1o4mmx
+ rendering all pages of
+ x11pdf ~/doc/OpenGL/Presentations/CEDEC2003_Venus_and_Vulcan.pdf
+ % cumulative self self total
+ time seconds seconds calls ms/call ms/call name
+ 30.50 20.04 20.04 261 76.76 76.76 duff_4i1o4
+ 21.67 22.02 10.95 221 49.55 49.55 duff_4i1o4mmx
*/
__m64 mzero = _mm_setzero_si64();
while (h--)
@@ -89,7 +89,7 @@ getargb(unsigned *s, int w, int h, int u, int v)
static void img_4o4mmx(FZ_PSRC, FZ_PDST, FZ_PCTM)
{
/* since mmx does not have an unsigned multiply instruction we use
- 17.15 fixed point */
+ 17.15 fixed point */
u0 >>= 1; v0 >>= 1;
fa >>= 1; fb >>= 1;
fc >>= 1; fd >>= 1;
@@ -115,8 +115,8 @@ static void img_4o4mmx(FZ_PSRC, FZ_PDST, FZ_PCTM)
int fv = v & 0x7fff;
int atedge =
- (iu < 0) | (iu >= (srcw - 1)) |
- (iv < 0) | (iv >= (srch - 1));
+ (iu < 0) | (iu >= (srcw - 1)) |
+ (iv < 0) | (iv >= (srch - 1));
__m64 ms0s1;
__m64 ms2s3;
diff --git a/fitzdraw/blendmodes.c b/fitzdraw/blendmodes.c
index e14b8a32..0b6fedcc 100644
--- a/fitzdraw/blendmodes.c
+++ b/fitzdraw/blendmodes.c
@@ -190,7 +190,7 @@ fz_saturation_rgb(int *bdr, int *bdg, int *bdb, int sr, int sg, int sb)
{
int tr, tg, tb;
setsat(*bdr, *bdg, *bdb, sat(sr, sg, sb), &tr, &tg, &tb);
- setlum(tr, tg, tb, lum(*bdr, *bdg, *bdb), bdr, bdg, bdb);
+ setlum(tr, tg, tb, lum(*bdr, *bdg, *bdb), bdr, bdg, bdb);
}
@@ -210,4 +210,4 @@ fz_luminosity_rgb(int *bdr, int *bdg, int *bdb, int sr, int sg, int sb)
//fz_separable_blend(, fz_blendkind mode)
//{
-//}
+ //}
diff --git a/fitzdraw/glyphcache.c b/fitzdraw/glyphcache.c
index f3f6d38d..0b602857 100644
--- a/fitzdraw/glyphcache.c
+++ b/fitzdraw/glyphcache.c
@@ -144,7 +144,7 @@ hashinsert(fz_glyphcache *arena, fz_key *key, fz_val *val)
{
fz_hash *tab = arena->hash;
int pos = hashkey(key) % arena->slots;
-int didcoll = 0;
+ int didcoll = 0;
while (1)
{
@@ -153,14 +153,14 @@ int didcoll = 0;
tab[pos].key = *key;
tab[pos].val = val;
tab[pos].val->ent = &tab[pos];
-if (didcoll) hcoll ++; else hokay ++; hdist += didcoll;
+ if (didcoll) hcoll ++; else hokay ++; hdist += didcoll;
return;
}
pos = pos + 1;
if (pos == arena->slots)
pos = 0;
-didcoll ++;
+ didcoll ++;
}
}
@@ -168,51 +168,51 @@ didcoll ++;
static void
hashremove(fz_glyphcache *arena, fz_key *key)
{
- fz_hash *tab = arena->hash;
- unsigned int pos = hashkey(key) % arena->slots;
- unsigned int hole;
- unsigned int look;
- unsigned int code;
+fz_hash *tab = arena->hash;
+unsigned int pos = hashkey(key) % arena->slots;
+unsigned int hole;
+unsigned int look;
+unsigned int code;
- while (1)
- {
- if (!tab[pos].val)
- return; // boo hoo! tried to remove non-existant key
+while (1)
+{
+if (!tab[pos].val)
+return; // boo hoo! tried to remove non-existant key
- if (memcmp(key, &tab[pos].key, sizeof (fz_key)) == 0)
- {
- tab[pos].val = nil;
-
- hole = pos;
- look = hole + 1;
- if (look == arena->slots)
- look = 0;
-
- while (tab[look].val)
- {
- code = (hashkey(&tab[look].key) % arena->slots);
- if ((code <= hole && hole < look) ||
- (look < code && code <= hole) ||
- (hole < look && look < code))
- {
- tab[hole] = tab[look];
- tab[hole].val->ent = &tab[hole];
- tab[look].val = nil;
- hole = look;
- }
-
- look = look + 1;
- if (look == arena->slots)
- look = 0;
- }
+if (memcmp(key, &tab[pos].key, sizeof (fz_key)) == 0)
+{
+tab[pos].val = nil;
- return;
- }
+hole = pos;
+look = hole + 1;
+if (look == arena->slots)
+look = 0;
- pos = pos + 1;
- if (pos == arena->slots)
- pos = 0;
- }
+while (tab[look].val)
+{
+code = (hashkey(&tab[look].key) % arena->slots);
+if ((code <= hole && hole < look) ||
+(look < code && code <= hole) ||
+(hole < look && look < code))
+{
+tab[hole] = tab[look];
+tab[hole].val->ent = &tab[hole];
+tab[look].val = nil;
+hole = look;
+}
+
+look = look + 1;
+if (look == arena->slots)
+look = 0;
+}
+
+return;
+}
+
+pos = pos + 1;
+if (pos == arena->slots)
+pos = 0;
+}
}
*/
@@ -226,31 +226,31 @@ fz_debugglyphcache(fz_glyphcache *arena)
printf("out-of-space evicts: %d\n", coos);
printf("out-of-hash evicts: %d\n", covf);
printf("hits = %d misses = %d ratio = %g\n", ghits, gmisses, (float)ghits / (ghits + gmisses));
-/*
+ /*
int i;
for (i = 0; i < arena->slots; i++)
{
- if (!arena->hash[i].val)
- printf("glyph % 4d: empty\n", i);
- else {
- fz_key *k = &arena->hash[i].key;
- fz_val *b = arena->hash[i].val;
- printf("glyph % 4d: %p %d [%g %g %g %g + %d %d] "
- "-> [%dx%d %d,%d]\n", i,
- k->fid, k->cid,
- k->a / 65536.0,
- k->b / 65536.0,
- k->c / 65536.0,
- k->d / 65536.0,
- k->e, k->f,
- b->w, b->h, b->x, b->y);
- }
+ if (!arena->hash[i].val)
+ printf("glyph % 4d: empty\n", i);
+ else {
+ fz_key *k = &arena->hash[i].key;
+ fz_val *b = arena->hash[i].val;
+ printf("glyph % 4d: %p %d [%g %g %g %g + %d %d] "
+ "-> [%dx%d %d,%d]\n", i,
+ k->fid, k->cid,
+ k->a / 65536.0,
+ k->b / 65536.0,
+ k->c / 65536.0,
+ k->d / 65536.0,
+ k->e, k->f,
+ b->w, b->h, b->x, b->y);
+ }
}
for (i = 0; i < arena->load; i++)
- printf("lru %04d: glyph %d (%d)\n", i,
- arena->lru[i].ent - arena->hash, arena->lru[i].uses);
-*/
+ printf("lru %04d: glyph %d (%d)\n", i,
+ arena->lru[i].ent - arena->hash, arena->lru[i].uses);
+ */
}
static void
@@ -273,33 +273,33 @@ bubble(fz_glyphcache *arena, int i)
static void
evictlast(fz_glyphcache *arena)
{
- fz_val *lru = arena->lru;
- unsigned char *s, *e;
- int i, k;
- fz_key key;
+fz_val *lru = arena->lru;
+unsigned char *s, *e;
+int i, k;
+fz_key key;
- if (arena->load == 0)
- return;
+if (arena->load == 0)
+return;
- k = arena->load - 1;
- s = lru[k].samples;
- e = s + lru[k].w * lru[k].h;
+k = arena->load - 1;
+s = lru[k].samples;
+e = s + lru[k].w * lru[k].h;
- // pack buffer to fill hole
- memmove(s, e, arena->buffer + arena->used - e);
- memset(arena->buffer + arena->used - (e - s), 0, e - s);
- arena->used -= e - s;
+// pack buffer to fill hole
+memmove(s, e, arena->buffer + arena->used - e);
+memset(arena->buffer + arena->used - (e - s), 0, e - s);
+arena->used -= e - s;
- // update lru pointers
- for (i = 0; i < k; i++) // XXX this is DOG slow! XXX
- if (lru[i].samples >= e)
- lru[i].samples -= e - s;
+// update lru pointers
+for (i = 0; i < k; i++) // XXX this is DOG slow! XXX
+if (lru[i].samples >= e)
+lru[i].samples -= e - s;
- // remove hash entry
- key = lru[k].ent->key;
- hashremove(arena, &key);
+// remove hash entry
+key = lru[k].ent->key;
+hashremove(arena, &key);
- arena->load --;
+arena->load --;
}
*/
@@ -354,19 +354,19 @@ fz_renderglyph(fz_glyphcache *arena, fz_glyph *glyph, fz_font *font, int cid, fz
if (font->ftface)
{
- error = fz_renderftglyph(glyph, font, cid, ctm);
- if (error)
- return error;
+ error = fz_renderftglyph(glyph, font, cid, ctm);
+ if (error)
+ return error;
}
else if (font->t3procs)
{
- error = fz_rendert3glyph(glyph, font, cid, ctm);
- if (error)
- return error;
+ error = fz_rendert3glyph(glyph, font, cid, ctm);
+ if (error)
+ return error;
}
else
{
- return fz_throw("uninitialized font structure");
+ return fz_throw("uninitialized font structure");
}
size = glyph->w * glyph->h;
diff --git a/fitzdraw/imagescale.c b/fitzdraw/imagescale.c
index 79d31c06..147e31af 100644
--- a/fitzdraw/imagescale.c
+++ b/fitzdraw/imagescale.c
@@ -229,8 +229,8 @@ fz_scalepixmaptile(fz_pixmap *dst, int xoffs, int yoffs, fz_pixmap *src, int xde
{
for (iy = 0; iy < ydenom; iy++)
srowx(src->samples + (y + iy) * src->w * n,
- buf + iy * ow * n,
- src->w, xdenom);
+ buf + iy * ow * n,
+ src->w, xdenom);
scolx(buf, dstsamples + oy * dst->w * n, ow, ydenom);
}
@@ -239,8 +239,8 @@ fz_scalepixmaptile(fz_pixmap *dst, int xoffs, int yoffs, fz_pixmap *src, int xde
{
for (iy = 0; iy < remaining; iy++)
srowx(src->samples + (y + iy) * src->w * n,
- buf + iy * ow * n,
- src->w, xdenom);
+ buf + iy * ow * n,
+ src->w, xdenom);
scolx(buf, dstsamples + oy * dst->w * n, ow, remaining);
}
}
@@ -251,8 +251,8 @@ fz_scalepixmaptile(fz_pixmap *dst, int xoffs, int yoffs, fz_pixmap *src, int xde
{
for (iy = 0; iy < ydenom; iy++)
fz_srown(src->samples + (y + iy) * src->w * n,
- buf + iy * ow * n,
- src->w, xdenom, n);
+ buf + iy * ow * n,
+ src->w, xdenom, n);
fz_scoln(buf, dstsamples + oy * dst->w * n, ow, ydenom, n);
}
@@ -261,8 +261,8 @@ fz_scalepixmaptile(fz_pixmap *dst, int xoffs, int yoffs, fz_pixmap *src, int xde
{
for (iy = 0; iy < remaining; iy++)
fz_srown(src->samples + (y + iy) * src->w * n,
- buf + iy * ow * n,
- src->w, xdenom, n);
+ buf + iy * ow * n,
+ src->w, xdenom, n);
fz_scoln(buf, dstsamples + oy * dst->w * n, ow, remaining, n);
}
@@ -314,8 +314,8 @@ fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom)
{
for (iy = 0; iy < ydenom; iy++)
srowx(src->samples + (y + iy) * src->w * n,
- buf + iy * ow * n,
- src->w, xdenom);
+ buf + iy * ow * n,
+ src->w, xdenom);
scolx(buf, dst->samples + oy * dst->w * n, dst->w, ydenom);
}
@@ -324,8 +324,8 @@ fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom)
{
for (iy = 0; iy < remaining; iy++)
srowx(src->samples + (y + iy) * src->w * n,
- buf + iy * ow * n,
- src->w, xdenom);
+ buf + iy * ow * n,
+ src->w, xdenom);
scolx(buf, dst->samples + oy * dst->w * n, dst->w, remaining);
}
}
@@ -336,8 +336,8 @@ fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom)
{
for (iy = 0; iy < ydenom; iy++)
fz_srown(src->samples + (y + iy) * src->w * n,
- buf + iy * ow * n,
- src->w, xdenom, n);
+ buf + iy * ow * n,
+ src->w, xdenom, n);
fz_scoln(buf, dst->samples + oy * dst->w * n, dst->w, ydenom, n);
}
@@ -346,8 +346,8 @@ fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom)
{
for (iy = 0; iy < remaining; iy++)
fz_srown(src->samples + (y + iy) * src->w * n,
- buf + iy * ow * n,
- src->w, xdenom, n);
+ buf + iy * ow * n,
+ src->w, xdenom, n);
fz_scoln(buf, dst->samples + oy * dst->w * n, dst->w, remaining, n);
}
}
diff --git a/fitzdraw/imageunpack.c b/fitzdraw/imageunpack.c
index 50a65253..15d060f8 100644
--- a/fitzdraw/imageunpack.c
+++ b/fitzdraw/imageunpack.c
@@ -37,14 +37,14 @@ static void decodetile(fz_pixmap *pix, int skip, float *decode)
return;
switch (n) {
- case 1:
+ case 1:
while (wh--)
{
p[0] = min[0] + fz_mul255(sub[0], p[0]);
p ++;
}
break;
- case 2:
+ case 2:
if (justinvert) {
unsigned *wp = (unsigned *)p;
@@ -69,14 +69,14 @@ static void decodetile(fz_pixmap *pix, int skip, float *decode)
}
}
else
- while (wh--)
+ while (wh--)
{
p[0] = min[0] + fz_mul255(sub[0], p[0]);
p[1] = min[1] + fz_mul255(sub[1], p[1]);
p += 2;
}
break;
- default:
+ default:
while (wh--)
{
for (i = 0; i < n; i++)
@@ -219,11 +219,11 @@ static void loadtile1(byte * restrict src, int sw, byte * restrict dst, int dw,
}
static void loadtile2(byte * restrict src, int sw, byte * restrict dst, int dw, int w, int h, int pad)
- TILE(ttwo)
+TILE(ttwo)
static void loadtile4(byte * restrict src, int sw, byte * restrict dst, int dw, int w, int h, int pad)
- TILE(tnib)
+TILE(tnib)
static void loadtile8(byte * restrict src, int sw, byte * restrict dst, int dw, int w, int h, int pad)
- TILE(toct)
+TILE(toct)
void (*fz_decodetile)(fz_pixmap *pix, int skip, float *decode) = decodetile;
void (*fz_loadtile1)(byte*, int sw, byte*, int dw, int w, int h, int pad) = loadtile1;
diff --git a/fitzdraw/meshdraw.c b/fitzdraw/meshdraw.c
index 108c8768..ba1e036c 100644
--- a/fitzdraw/meshdraw.c
+++ b/fitzdraw/meshdraw.c
@@ -77,8 +77,8 @@ static inline void copyvert(float *dst, float *src, int n)
}
static int clippoly(float src[MAXV][MAXN],
- float dst[MAXV][MAXN], int len, int n,
- float val, int isy, int ismax)
+ float dst[MAXV][MAXN], int len, int n,
+ float val, int isy, int ismax)
{
float cv1[MAXN];
float cv2[MAXN];
@@ -100,18 +100,18 @@ static int clippoly(float src[MAXV][MAXN],
switch (r)
{
- case IN:
- copyvert(dst[cp++], cv2, n);
- break;
- case OUT:
- break;
- case LEAVE:
- copyvert(dst[cp++], cv2, n);
- break;
- case ENTER:
- copyvert(dst[cp++], cv1, n);
- copyvert(dst[cp++], cv2, n);
- break;
+ case IN:
+ copyvert(dst[cp++], cv2, n);
+ break;
+ case OUT:
+ break;
+ case LEAVE:
+ copyvert(dst[cp++], cv2, n);
+ break;
+ case ENTER:
+ copyvert(dst[cp++], cv1, n);
+ copyvert(dst[cp++], cv2, n);
+ break;
}
v1 = v2;
}
@@ -339,7 +339,7 @@ fz_rendershade(fz_shade *shade, fz_matrix ctm, fz_colorspace *destcs, fz_pixmap
{
n = 2 + shade->cs->n;
error = fz_newpixmap(&temp, dest->x, dest->y, dest->w, dest->h,
- shade->cs->n + 1);
+ shade->cs->n + 1);
if (error)
return error;
}
@@ -359,14 +359,14 @@ fz_rendershade(fz_shade *shade, fz_matrix ctm, fz_colorspace *destcs, fz_pixmap
p.y = shade->mesh[(i * 3 + k) * n + 1];
p = fz_transformpoint(ctm, p);
if (isnan(p.y) || isnan(p.x)) // How is this happening?
- goto baddata;
+ goto baddata;
tri[k][0] = p.x;
tri[k][1] = p.y;
for (j = 2; j < n; j++)
tri[k][j] = shade->mesh[( i * 3 + k) * n + j] * 255;
}
fz_drawtriangle(temp, tri[0], tri[1], tri[2], n);
- baddata:
+baddata:
;
}
diff --git a/fitzdraw/pathscan.c b/fitzdraw/pathscan.c
index 64397563..dc0ca7c7 100644
--- a/fitzdraw/pathscan.c
+++ b/fitzdraw/pathscan.c
@@ -434,8 +434,8 @@ static inline void toalpha(unsigned char *list, int n)
}
static inline void blit(fz_pixmap *pix, int x, int y,
- unsigned char *list, int skipx, int len,
- unsigned char *argb, int over)
+ unsigned char *list, int skipx, int len,
+ unsigned char *argb, int over)
{
unsigned char *dst;
unsigned char cov;
diff --git a/fitzdraw/pathstroke.c b/fitzdraw/pathstroke.c
index 94409789..13e70dd4 100644
--- a/fitzdraw/pathstroke.c
+++ b/fitzdraw/pathstroke.c
@@ -38,9 +38,9 @@ line(struct sctx *s, float x0, float y0, float x1, float y1)
static fz_error
arc(struct sctx *s,
- float xc, float yc,
- float x0, float y0,
- float x1, float y1)
+ float xc, float yc,
+ float x0, float y0,
+ float x1, float y1)
{
fz_error error;
float th0, th1, r;
@@ -255,17 +255,17 @@ linecap(struct sctx *s, fz_point a, fz_point b)
if (linecap == SQUARE)
{
error = line(s, b.x - dlx, b.y - dly,
- b.x - dlx - dly,
- b.y - dly + dlx);
+ b.x - dlx - dly,
+ b.y - dly + dlx);
if (error) return error;
error = line(s, b.x - dlx - dly,
- b.y - dly + dlx,
- b.x + dlx - dly,
- b.y + dly + dlx);
+ b.y - dly + dlx,
+ b.x + dlx - dly,
+ b.y + dly + dlx);
if (error) return error;
error = line(s, b.x + dlx - dly,
- b.y + dly + dlx,
- b.x + dlx, b.y + dly);
+ b.y + dly + dlx,
+ b.x + dlx, b.y + dly);
if (error) return error;
}
diff --git a/fitzdraw/pixmap.c b/fitzdraw/pixmap.c
index e3d9a285..78c8dc2f 100644
--- a/fitzdraw/pixmap.c
+++ b/fitzdraw/pixmap.c
@@ -30,9 +30,9 @@ fz_error
fz_newpixmapwithrect(fz_pixmap **pixp, fz_irect r, int n)
{
return fz_newpixmap(pixp,
- r.x0, r.y0,
- r.x1 - r.x0,
- r.y1 - r.y0, n);
+ r.x0, r.y0,
+ r.x1 - r.x0,
+ r.y1 - r.y0, n);
}
fz_error
diff --git a/fitzdraw/render.c b/fitzdraw/render.c
index 97941d95..b4cfa4fa 100644
--- a/fitzdraw/render.c
+++ b/fitzdraw/render.c
@@ -95,14 +95,14 @@ static fz_error
rendertransform(fz_renderer *gc, fz_transformnode *transform, fz_matrix ctm)
{
fz_error error;
-DEBUG("transform [%g %g %g %g %g %g]\n",
-transform->m.a, transform->m.b,
-transform->m.c, transform->m.d,
-transform->m.e, transform->m.f);
-DEBUG("{\n");
+ DEBUG("transform [%g %g %g %g %g %g]\n",
+ transform->m.a, transform->m.b,
+ transform->m.c, transform->m.d,
+ transform->m.e, transform->m.f);
+ DEBUG("{\n");
ctm = fz_concat(transform->m, ctm);
error = rendernode(gc, transform->super.first, ctm);
-DEBUG("}\n");
+ DEBUG("}\n");
return error;
}
@@ -133,7 +133,7 @@ rendersolid(fz_renderer *gc, fz_solidnode *solid, fz_matrix ctm)
gc->argb[5] = rgb[1] * 255;
gc->argb[6] = rgb[2] * 255;
-DEBUG("solid %s [%d %d %d %d];\n", solid->cs->name, gc->argb[0], gc->argb[1], gc->argb[2], gc->argb[3]);
+ DEBUG("solid %s [%d %d %d %d];\n", solid->cs->name, gc->argb[0], gc->argb[1], gc->argb[2], gc->argb[3]);
if (gc->flag == FOVER)
{
@@ -148,20 +148,20 @@ DEBUG("solid %s [%d %d %d %d];\n", solid->cs->name, gc->argb[0], gc->argb[1], gc
p = gc->dest->samples;
n = gc->dest->w * gc->dest->h;
}
-
+
a = gc->argb[0];
r = gc->argb[1];
g = gc->argb[2];
b = gc->argb[3];
if ((p - (unsigned char *)0) & 3) {
- while (n--)
- {
- p[0] = a;
- p[1] = r;
- p[2] = g;
- p[3] = b;
- p += 4;
- }
+ while (n--)
+ {
+ p[0] = a;
+ p[1] = r;
+ p[2] = g;
+ p[3] = b;
+ p += 4;
+ }
}
else
{
@@ -223,18 +223,18 @@ renderpath(fz_renderer *gc, fz_pathnode *path, fz_matrix ctm)
if (fz_isemptyrect(clip))
return fz_okay;
-DEBUG("path %s;\n", path->paint == FZ_STROKE ? "stroke" : "fill");
+ DEBUG("path %s;\n", path->paint == FZ_STROKE ? "stroke" : "fill");
if (gc->flag & FRGB)
{
-DEBUG(" path rgb %d %d %d %d, %d %d %d\n", gc->argb[0], gc->argb[1], gc->argb[2], gc->argb[3], gc->argb[4], gc->argb[5], gc->argb[6]);
+ DEBUG(" path rgb %d %d %d %d, %d %d %d\n", gc->argb[0], gc->argb[1], gc->argb[2], gc->argb[3], gc->argb[4], gc->argb[5], gc->argb[6]);
return fz_scanconvert(gc->gel, gc->ael, path->paint == FZ_EOFILL,
- clip, gc->over, gc->argb, 1);
+ clip, gc->over, gc->argb, 1);
}
else if (gc->flag & FOVER)
{
return fz_scanconvert(gc->gel, gc->ael, path->paint == FZ_EOFILL,
- clip, gc->over, nil, 1);
+ clip, gc->over, nil, 1);
}
else
{
@@ -243,7 +243,7 @@ DEBUG(" path rgb %d %d %d %d, %d %d %d\n", gc->argb[0], gc->argb[1], gc->argb[2]
return error;
fz_clearpixmap(gc->dest);
return fz_scanconvert(gc->gel, gc->ael, path->paint == FZ_EOFILL,
- clip, gc->dest, nil, 0);
+ clip, gc->dest, nil, 0);
}
}
@@ -319,9 +319,9 @@ rendertext(fz_renderer *gc, fz_textnode *text, fz_matrix ctm)
tbox = fz_roundrect(fz_boundnode((fz_node*)text, ctm));
clip = fz_intersectirects(gc->clip, tbox);
-DEBUG("text %s n=%d [%g %g %g %g];\n",
-text->font->name, text->len,
-text->trm.a, text->trm.b, text->trm.c, text->trm.d);
+ DEBUG("text %s n=%d [%g %g %g %g];\n",
+ text->font->name, text->len,
+ text->trm.a, text->trm.b, text->trm.c, text->trm.d);
if (fz_isemptyrect(clip))
return fz_okay;
@@ -402,15 +402,15 @@ renderimage(fz_renderer *gc, fz_imagenode *node, fz_matrix ctm)
int w, h;
int tileheight;
-DEBUG("image %dx%d %d+%d %s\n{\n", image->w, image->h, image->n, image->a, image->cs?image->cs->name:"(nil)");
+ DEBUG("image %dx%d %d+%d %s\n{\n", image->w, image->h, image->n, image->a, image->cs?image->cs->name:"(nil)");
bbox = fz_roundrect(fz_boundnode((fz_node*)node, ctm));
clip = fz_intersectirects(gc->clip, bbox);
if (fz_isemptyrect(clip))
return fz_okay;
- if (image->w == 0 || image->h == 0)
- return fz_okay;
+ if (image->w == 0 || image->h == 0)
+ return fz_okay;
calcimagescale(ctm, image->w, image->h, &dx, &dy);
@@ -424,7 +424,7 @@ DEBUG("image %dx%d %d+%d %s\n{\n", image->w, image->h, image->n, image->a, image
DEBUG(" load image tile size = %dx%d\n", image->w, tileheight);
error = fz_newpixmap(&tile, 0, 0, image->w,
- tileheight, image->n + 1);
+ tileheight, image->n + 1);
if (error)
return error;
@@ -438,7 +438,7 @@ DEBUG("image %dx%d %d+%d %s\n{\n", image->w, image->h, image->n, image->a, image
tile->y = y;
tile->h = tileheight;
DEBUG(" tile xywh=%d %d %d %d sxsy=1/%d 1/%d\n",
- 0, y, image->w, tileheight, dx, dy);
+ 0, y, image->w, tileheight, dx, dy);
error = image->loadtile(image, tile);
if (error)
goto cleanup1;
@@ -456,7 +456,7 @@ DEBUG("image %dx%d %d+%d %s\n{\n", image->w, image->h, image->n, image->a, image
else {
-DEBUG(" load image\n");
+ DEBUG(" load image\n");
error = fz_newpixmap(&tile, 0, 0, image->w, image->h, image->n + 1);
if (error)
return error;
@@ -467,7 +467,7 @@ DEBUG(" load image\n");
if (dx != 1 || dy != 1)
{
-DEBUG(" scale image 1/%d 1/%d\n", dx, dy);
+ DEBUG(" scale image 1/%d 1/%d\n", dx, dy);
error = fz_scalepixmap(&temp, tile, dx, dy);
if (error)
goto cleanup;
@@ -478,7 +478,7 @@ DEBUG(" scale image 1/%d 1/%d\n", dx, dy);
if (image->cs && image->cs != gc->model)
{
-DEBUG(" convert from %s to %s\n", image->cs->name, gc->model->name);
+ DEBUG(" convert from %s to %s\n", image->cs->name, gc->model->name);
error = fz_newpixmap(&temp, tile->x, tile->y, tile->w, tile->h, gc->model->n + 1);
if (error)
goto cleanup;
@@ -517,7 +517,7 @@ DEBUG(" convert from %s to %s\n", image->cs->name, gc->model->name);
{
case FNONE:
{
-DEBUG(" fnone %d x %d\n", w, h);
+ DEBUG(" fnone %d x %d\n", w, h);
if (image->cs)
error = fz_newpixmapwithrect(&gc->dest, clip, gc->model->n + 1);
else
@@ -534,7 +534,7 @@ DEBUG(" fnone %d x %d\n", w, h);
case FOVER:
{
-DEBUG(" fover %d x %d\n", w, h);
+ DEBUG(" fover %d x %d\n", w, h);
if (image->cs)
fz_img_4o4(PSRC, PDST(gc->over), PCTM);
else
@@ -543,7 +543,7 @@ DEBUG(" fover %d x %d\n", w, h);
break;
case FOVER | FRGB:
-DEBUG(" fover+rgb %d x %d\n", w, h);
+ DEBUG(" fover+rgb %d x %d\n", w, h);
fz_img_w4i1o4(gc->argb, PSRC, PDST(gc->over), PCTM);
break;
@@ -551,7 +551,7 @@ DEBUG(" fover+rgb %d x %d\n", w, h);
assert(!"impossible flag in image span function");
}
-DEBUG("}\n");
+ DEBUG("}\n");
fz_droppixmap(tile);
return fz_okay;
@@ -693,7 +693,7 @@ renderover(fz_renderer *gc, fz_overnode *over, fz_matrix ctm)
if (!gc->over)
{
-DEBUG("over cluster %d\n{\n", gc->maskonly ? 1 : 4);
+ DEBUG("over cluster %d\n{\n", gc->maskonly ? 1 : 4);
cluster = 1;
if (gc->maskonly)
error = fz_newpixmapwithrect(&gc->over, gc->clip, 1);
@@ -703,7 +703,7 @@ DEBUG("over cluster %d\n{\n", gc->maskonly ? 1 : 4);
return error;
fz_clearpixmap(gc->over);
}
-else DEBUG("over\n{\n");
+ else DEBUG("over\n{\n");
for (child = over->super.first; child; child = child->next)
{
@@ -724,7 +724,7 @@ else DEBUG("over\n{\n");
gc->over = nil;
}
-DEBUG("}\n");
+ DEBUG("}\n");
return fz_okay;
}
@@ -785,15 +785,15 @@ rendermask(fz_renderer *gc, fz_masknode *mask, fz_matrix ctm)
if (fz_isemptyrect(clip))
return fz_okay;
-DEBUG("mask [%d %d %d %d]\n{\n", clip.x0, clip.y0, clip.x1, clip.y1);
+ DEBUG("mask [%d %d %d %d]\n{\n", clip.x0, clip.y0, clip.x1, clip.y1);
-{
-fz_irect sbox = fz_roundrect(fz_boundnode(shape, ctm));
-fz_irect cbox = fz_roundrect(fz_boundnode(color, ctm));
-if (cbox.x0 >= sbox.x0 && cbox.x1 <= sbox.x1)
-if (cbox.y0 >= sbox.y0 && cbox.y1 <= sbox.y1)
-DEBUG("potentially useless mask\n");
-}
+ {
+ fz_irect sbox = fz_roundrect(fz_boundnode(shape, ctm));
+ fz_irect cbox = fz_roundrect(fz_boundnode(color, ctm));
+ if (cbox.x0 >= sbox.x0 && cbox.x1 <= sbox.x1)
+ if (cbox.y0 >= sbox.y0 && cbox.y1 <= sbox.y1)
+ DEBUG("potentially useless mask\n");
+ }
gc->clip = clip;
gc->over = nil;
@@ -837,7 +837,7 @@ DEBUG("potentially useless mask\n");
}
}
-DEBUG("}\n");
+ DEBUG("}\n");
if (shapepix) fz_droppixmap(shapepix);
if (colorpix) fz_droppixmap(colorpix);
@@ -912,15 +912,15 @@ fz_rendertree(fz_pixmap **outp,
else
memset(gc->over->samples, 0x00, gc->over->w * gc->over->h * gc->over->n);
-DEBUG("tree %d [%d %d %d %d]\n{\n",
-gc->maskonly ? 1 : 4,
-bbox.x0, bbox.y0, bbox.x1, bbox.y1);
+ DEBUG("tree %d [%d %d %d %d]\n{\n",
+ gc->maskonly ? 1 : 4,
+ bbox.x0, bbox.y0, bbox.x1, bbox.y1);
error = rendernode(gc, tree->root, ctm);
if (error)
return error;
-DEBUG("}\n");
+ DEBUG("}\n");
if (gc->dest)
{