diff options
Diffstat (limited to 'raster')
-rw-r--r-- | raster/imagescale.c | 18 | ||||
-rw-r--r-- | raster/imageunpack.c | 2 | ||||
-rw-r--r-- | raster/render.c | 4 |
3 files changed, 20 insertions, 4 deletions
diff --git a/raster/imagescale.c b/raster/imagescale.c index bbe20565..7edb0cd2 100644 --- a/raster/imagescale.c +++ b/raster/imagescale.c @@ -212,7 +212,23 @@ fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom) case 1: srowx = fz_srow1; scolx = fz_scol1; break; case 2: srowx = fz_srow2; scolx = fz_scol2; break; case 4: srowx = fz_srow4; scolx = fz_scol4; break; - case 5: srowx = fz_srow5; scolx = fz_scol5; break; + case 5: srowx = fz_srow5; scolx = fz_scol5; + if (!(xdenom & (xdenom - 1))) + { + unsigned v = xdenom; + xdenom = 0; + while ((v >>= 1)) xdenom++; + srowx = srow5p2; + } + if (!(ydenom & (ydenom - 1))) + { + unsigned v = ydenom2; + ydenom2 = 0; + while ((v >>= 1)) ydenom2++; + scolx = scol5p2; + } + + break; } if (srowx && scolx) diff --git a/raster/imageunpack.c b/raster/imageunpack.c index 451967c8..591c4b60 100644 --- a/raster/imageunpack.c +++ b/raster/imageunpack.c @@ -28,7 +28,7 @@ static void decodetile(fz_pixmap *pix, int skip, float *decode) min[i] = decode[(i - skip) * 2] * 255; max[i] = decode[(i - skip) * 2 + 1] * 255; sub[i] = max[i] - min[i]; - needed |= (min[i] != 0) | (max[i] != 255); + needed |= (min[i] != 0) | (max[i] != 255); } if (!needed) diff --git a/raster/render.c b/raster/render.c index 803ba603..50e16d8a 100644 --- a/raster/render.c +++ b/raster/render.c @@ -792,8 +792,8 @@ rendernode(fz_renderer *gc, fz_node *node, fz_matrix ctm) return rendernode(gc, ((fz_linknode*)node)->tree->root, ctm); case FZ_NMETA: return rendernode(gc, node->first, ctm); - case FZ_NBLEND: - return nil; + case FZ_NBLEND: + return nil; } return nil; |