diff options
author | Tor Andersson <tor@ghostscript.com> | 2004-11-26 03:48:48 +0100 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2004-11-26 03:48:48 +0100 |
commit | 9cc51e97453bffc0d984248e81544dcf5d776522 (patch) | |
tree | 100a9afa6fbae5dfb99a9acf0e72dc507c088230 | |
parent | 6c9bcc6f41bb738c216fc810246f60576d9ec6e4 (diff) | |
download | mupdf-9cc51e97453bffc0d984248e81544dcf5d776522.tar.xz |
various bugfixes
-rw-r--r-- | Jamfile | 7 | ||||
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | mupdf/build.c | 3 | ||||
-rw-r--r-- | mupdf/page.c | 4 | ||||
-rw-r--r-- | mupdf/type3.c | 4 | ||||
-rw-r--r-- | render/render.c | 2 | ||||
-rw-r--r-- | test/ximage.c | 31 |
7 files changed, 42 insertions, 10 deletions
@@ -136,7 +136,12 @@ Library libmupdf : mupdf/interpret.c ; -rule HexDump { DEPENDS $(<) : $(>) ; } +rule HexDump +{ + DEPENDS $(<) : $(>) ; + Clean clean : $(<) ; +} + actions HexDump { xxd -i $(>) | sed -e 's/data_//g;s/, /,/g' > $(<) ; @@ -20,7 +20,6 @@ rendering - cpu-specific optims parser - - join content streams arrays (for split dicts) - try to clean up colorspace/material handling in interpreter - annotations and destinations (for links and outline) diff --git a/mupdf/build.c b/mupdf/build.c index 72c1cfda..fe5ab95b 100644 --- a/mupdf/build.c +++ b/mupdf/build.c @@ -718,8 +718,9 @@ pdf_showtext(pdf_csi *csi, fz_obj *text) while (buf < end) { buf = fz_decodecpt(font->encoding, buf, &cpt); - cid = fz_lookupcid(font->encoding, cpt); + if (cid == -1) + cid = 0; error = showglyph(csi, cid); if (error) diff --git a/mupdf/page.c b/mupdf/page.c index b65378fd..57d78110 100644 --- a/mupdf/page.c +++ b/mupdf/page.c @@ -139,7 +139,9 @@ pdf_loadpage(pdf_page **pagep, pdf_xref *xref, fz_obj *dict) fz_rect bbox; int rotate; - obj = fz_dictgets(dict, "MediaBox"); + obj = fz_dictgets(dict, "CropBox"); + if (!obj) + obj = fz_dictgets(dict, "MediaBox"); if (!fz_isarray(obj)) return fz_throw("syntaxerror: Page missing MediaBox"); bbox.min.x = fz_toreal(fz_arrayget(obj, 0)); diff --git a/mupdf/type3.c b/mupdf/type3.c index 8406e763..5e89941b 100644 --- a/mupdf/type3.c +++ b/mupdf/type3.c @@ -129,9 +129,9 @@ pdf_loadtype3font(pdf_font **fontp, pdf_xref *xref, fz_obj *dict) bbox.max.y = fz_toreal(fz_arrayget(obj, 3)); bbox = fz_transformaabb(font->matrix, bbox); bbox.min.x = fz_floor(bbox.min.x * 1000); - bbox.min.y = fz_floor(bbox.min.x * 1000); + bbox.min.y = fz_floor(bbox.min.y * 1000); bbox.max.x = fz_ceil(bbox.max.x * 1000); - bbox.max.y = fz_ceil(bbox.max.x * 1000); + bbox.max.y = fz_ceil(bbox.max.y * 1000); fz_setfontbbox((fz_font*)font, bbox.min.x, bbox.min.y, bbox.max.x, bbox.max.y); /* diff --git a/render/render.c b/render/render.c index 7fac8322..92ab519f 100644 --- a/render/render.c +++ b/render/render.c @@ -1,7 +1,9 @@ #include <fitz.h> #define noDEBUG(args...) printf(args) +#ifndef DEBUG #define DEBUG(args...) +#endif #define FNONE 0 #define FOVER 1 diff --git a/test/ximage.c b/test/ximage.c index 79c6670c..1c16bfda 100644 --- a/test/ximage.c +++ b/test/ximage.c @@ -246,7 +246,7 @@ select_mode(void) info.mode = byteorder == MSBFirst ? RGBA8888 : ABGR8888; } - printf("rgba:8888 -> %s\n", modename[info.mode]); + printf("argb:8888 -> %s\n", modename[info.mode]); /* select conversion function */ info.convert_func = ximage_convert_funcs[info.mode]; @@ -414,6 +414,7 @@ ximage_blit(Drawable d, GC gc, /* * */ + #ifndef _C99 #ifdef __GNUC__ #define restrict __restrict__ @@ -455,16 +456,20 @@ ximage_convert_bgra8888(PARAMS) int x, y; unsigned *s = (unsigned *)src; unsigned *d = (unsigned *)dst; - unsigned val; for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { - val = s[x]; + unsigned val = s[x]; + unsigned a0g0 = val & 0xff00ff00; + unsigned gb00 = val << 16; + unsigned zzar = val >> 16; + unsigned gbar = gb00 | zzar; + d[x] = (gbar & 0x00ff00ff) | a0g0; +/* d[x] = (val >> 24) | ((val >> 8) & 0xff) | ((val << 8) & 0xff0000) | (val << 24); -/* d[x] = (((val >> 24) & 0xff) << 0) | (((val >> 16) & 0xff) << 8) | @@ -482,6 +487,23 @@ ximage_convert_bgra8888(PARAMS) static void ximage_convert_abgr8888(PARAMS) { +#if 1 + int x, y; + unsigned *s = (unsigned *)src; + unsigned *d = (unsigned *)dst; + unsigned val; + + for (y = 0; y < h; y++) { + for (x = 0; x < w; x++) { + val = s[x]; + /* bigendian... */ + d[x] = (val & 0xff00ff00) | + (((val << 16) | (val >> 16)) & 0x00ff00ff); + } + d += dststride>>2; + s += srcstride>>2; + } +#else int x, y; for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { @@ -493,6 +515,7 @@ ximage_convert_abgr8888(PARAMS) dst += dststride; src += srcstride; } +#endif } static void |