summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2012-01-11 23:26:49 +0100
committerTor Andersson <tor.andersson@artifex.com>2012-01-11 23:26:49 +0100
commit209f30bee3121bbae32799b0bbb10f5e6db4158c (patch)
treeba20a47f0bfb0370525a4ee84e98fa136202fc82 /apps
parentbe1ed0692b49bc86ce512edc837fefc601d42443 (diff)
downloadmupdf-209f30bee3121bbae32799b0bbb10f5e6db4158c.tar.xz
Hide glyph cache in context.
Diffstat (limited to 'apps')
-rw-r--r--apps/pdfapp.c8
-rw-r--r--apps/pdfapp.h1
-rw-r--r--apps/pdfclean.c1
-rw-r--r--apps/pdfdraw.c7
-rw-r--r--apps/xpsdraw.c6
5 files changed, 3 insertions, 20 deletions
diff --git a/apps/pdfapp.c b/apps/pdfapp.c
index 053d120d..5f7e79dc 100644
--- a/apps/pdfapp.c
+++ b/apps/pdfapp.c
@@ -196,8 +196,6 @@ void pdfapp_open(pdfapp_t *app, char *filename, int fd, int reload)
else
pdfapp_open_pdf(app, filename, fd);
- app->cache = fz_new_glyph_cache(app->ctx);
-
if (app->pageno < 1)
app->pageno = 1;
if (app->pageno > app->pagecount)
@@ -236,10 +234,6 @@ void pdfapp_close(pdfapp_t *app)
fz_free(app->ctx, app->doctitle);
app->doctitle = NULL;
- if (app->cache)
- fz_free_glyph_cache(app->ctx, app->cache);
- app->cache = NULL;
-
if (app->image)
fz_drop_pixmap(app->ctx, app->image);
app->image = NULL;
@@ -425,7 +419,7 @@ static void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage, int repai
#endif
app->image = fz_new_pixmap_with_rect(app->ctx, colorspace, bbox);
fz_clear_pixmap_with_color(app->image, 255);
- idev = fz_new_draw_device(app->ctx, app->cache, app->image);
+ idev = fz_new_draw_device(app->ctx, app->image);
fz_execute_display_list(app->page_list, idev, ctm, bbox, NULL);
fz_free_device(idev);
}
diff --git a/apps/pdfapp.h b/apps/pdfapp.h
index 22b6ad0d..84d00979 100644
--- a/apps/pdfapp.h
+++ b/apps/pdfapp.h
@@ -35,7 +35,6 @@ struct pdfapp_s
xps_document *xps;
int pagecount;
- fz_glyph_cache *cache;
/* current view params */
int resolution;
diff --git a/apps/pdfclean.c b/apps/pdfclean.c
index ed149268..583da83f 100644
--- a/apps/pdfclean.c
+++ b/apps/pdfclean.c
@@ -834,7 +834,6 @@ int main(int argc, char **argv)
fz_free(xref->ctx, renumbermap);
pdf_free_xref(xref);
- fz_flush_warnings(ctx);
fz_free_context(ctx);
return 0;
}
diff --git a/apps/pdfdraw.c b/apps/pdfdraw.c
index ed10baa1..b0ed7707 100644
--- a/apps/pdfdraw.c
+++ b/apps/pdfdraw.c
@@ -27,7 +27,6 @@ static float gamma_value = 1;
static int invert = 0;
static fz_colorspace *colorspace;
-static fz_glyph_cache *glyphcache;
static char *filename;
static struct {
@@ -217,7 +216,7 @@ static void drawpage(pdf_xref *xref, int pagenum)
else
fz_clear_pixmap_with_color(pix, 255);
- dev = fz_new_draw_device(ctx, glyphcache, pix);
+ dev = fz_new_draw_device(ctx, pix);
if (list)
fz_execute_display_list(list, dev, ctm, bbox, NULL);
else
@@ -440,8 +439,6 @@ int main(int argc, char **argv)
fz_try(ctx)
{
- glyphcache = fz_new_glyph_cache(ctx);
-
while (fz_optind < argc)
{
filename = argv[fz_optind++];
@@ -489,8 +486,6 @@ int main(int argc, char **argv)
printf("slowest page %d: %dms\n", timing.maxpage, timing.max);
}
- fz_free_glyph_cache(ctx, glyphcache);
- fz_flush_warnings(ctx);
fz_free_context(ctx);
return 0;
}
diff --git a/apps/xpsdraw.c b/apps/xpsdraw.c
index 04c43053..8509605c 100644
--- a/apps/xpsdraw.c
+++ b/apps/xpsdraw.c
@@ -19,7 +19,6 @@ int savealpha = 0;
int uselist = 1;
fz_colorspace *colorspace;
-fz_glyph_cache *glyphcache;
char *filename;
fz_context *ctx;
@@ -164,7 +163,7 @@ static void drawpage(xps_document *doc, int pagenum)
else
fz_clear_pixmap_with_color(pix, 255);
- dev = fz_new_draw_device(doc->ctx, glyphcache, pix);
+ dev = fz_new_draw_device(doc->ctx, pix);
if (list)
fz_execute_display_list(list, dev, ctm, bbox, NULL);
else
@@ -327,8 +326,6 @@ int main(int argc, char **argv)
exit(1);
}
- glyphcache = fz_new_glyph_cache(ctx);
-
colorspace = fz_device_rgb;
if (grayscale)
colorspace = fz_device_gray;
@@ -388,7 +385,6 @@ int main(int argc, char **argv)
printf("slowest page %d: %dms\n", timing.maxpage, timing.max);
}
- fz_free_glyph_cache(ctx, glyphcache);
fz_free_context(ctx);
return 0;