summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2004-11-25 07:06:56 +0100
committerTor Andersson <tor@ghostscript.com>2004-11-25 07:06:56 +0100
commit6796693d6b7db5933aaf5c6a33793abbfd3dd93c (patch)
tree43d01faf8fba5e36315714d629a2b910d1d7dce6 /render
parent3e799920074ffaa718dfa671f3ed424f80c71b71 (diff)
downloadmupdf-6796693d6b7db5933aaf5c6a33793abbfd3dd93c.tar.xz
cleanups and c89 fixes
Diffstat (limited to 'render')
-rw-r--r--render/glyphcache.c20
-rw-r--r--render/rastport.c3
-rw-r--r--render/rastshade.c (renamed from render/shade.c)0
-rw-r--r--render/render.c5
4 files changed, 18 insertions, 10 deletions
diff --git a/render/glyphcache.c b/render/glyphcache.c
index c47ed0ed..517a67ef 100644
--- a/render/glyphcache.c
+++ b/render/glyphcache.c
@@ -340,14 +340,22 @@ fz_renderglyph(fz_glyphcache *arena, fz_glyph *glyph, fz_font *font, int cid, fz
if (size > arena->size / 6)
return nil;
- while (arena->load > arena->slots * 75 / 100) {
- covf ++;
- evictlast(arena);
+ while (arena->load > arena->slots * 75 / 100)
+ {
+ while (arena->load > arena->slots * 60 / 100)
+ {
+ covf ++;
+ evictlast(arena);
+ }
}
- while (arena->used + size >= arena->size) {
- coos ++;
- evictlast(arena);
+ if (arena->used + size >= arena->size)
+ {
+ while (arena->used + size >= arena->size * 80 / 100)
+ {
+ coos ++;
+ evictlast(arena);
+ }
}
val = &arena->lru[arena->load++];
diff --git a/render/rastport.c b/render/rastport.c
index 0daf3458..112ab5ea 100644
--- a/render/rastport.c
+++ b/render/rastport.c
@@ -357,6 +357,7 @@ static void img_1o1(FZ_PSRC, FZ_PDST, FZ_PCTM)
static void img_4o4(FZ_PSRC, FZ_PDST, FZ_PCTM)
{
byte argb[4];
+ byte ssa;
while (h--)
{
byte *dstp = dst0;
@@ -366,7 +367,7 @@ static void img_4o4(FZ_PSRC, FZ_PDST, FZ_PCTM)
while (w--)
{
sampleargb(src, srcw, srch, u, v, argb);
- byte ssa = 255 - argb[0];
+ ssa = 255 - argb[0];
dstp[0] = argb[0] + fz_mul255(dstp[0], ssa);
dstp[1] = argb[1] + fz_mul255((short)dstp[1] - argb[1], ssa);
dstp[2] = argb[2] + fz_mul255((short)dstp[2] - argb[2], ssa);
diff --git a/render/shade.c b/render/rastshade.c
index 7e7f82ce..7e7f82ce 100644
--- a/render/shade.c
+++ b/render/rastshade.c
diff --git a/render/render.c b/render/render.c
index 58e4b6f0..b72f069e 100644
--- a/render/render.c
+++ b/render/render.c
@@ -25,7 +25,7 @@ fz_newrenderer(fz_renderer **gcp, fz_colorspace *pcm, int maskonly, int gcmem)
gc->gel = nil;
gc->ael = nil;
- error = fz_newglyphcache(&gc->cache, gcmem / 32, gcmem);
+ error = fz_newglyphcache(&gc->cache, gcmem / 24, gcmem);
if (error)
goto cleanup;
@@ -413,6 +413,7 @@ renderimage(fz_renderer *gc, fz_imagenode *node, fz_matrix ctm)
fz_irect clip;
int dx, dy;
fz_pixmap *tile;
+ fz_pixmap *temp;
fz_matrix imgmat;
fz_matrix invmat;
int fa, fb, fc, fd;
@@ -442,7 +443,6 @@ DEBUG(" load image\n");
if (dx != 1 || dy != 1)
{
DEBUG(" scale image 1/%d 1/%d\n", dx, dy);
- fz_pixmap *temp;
error = fz_scalepixmap(&temp, tile, dx, dy);
if (error)
goto cleanup;
@@ -452,7 +452,6 @@ DEBUG(" scale image 1/%d 1/%d\n", dx, dy);
if (image->cs && image->cs != gc->model)
{
- fz_pixmap *temp;
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)