diff options
author | Tor Andersson <tor@ghostscript.com> | 2004-11-17 15:55:50 +0100 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2004-11-17 15:55:50 +0100 |
commit | f258f464a3b707b7d66880bec9cdd8f7b026e1f8 (patch) | |
tree | 51020e0390092ef044ede01b77478dfe08ae053d /render | |
parent | 4f4c61a4e89bc89e15a096e8c07fc35d2f9eb32c (diff) | |
download | mupdf-f258f464a3b707b7d66880bec9cdd8f7b026e1f8.tar.xz |
force use of builtin fonts if names match. speed up clearing of white background.
Diffstat (limited to 'render')
-rw-r--r-- | render/render.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/render/render.c b/render/render.c index 7418d89c..62bce18d 100644 --- a/render/render.c +++ b/render/render.c @@ -261,18 +261,37 @@ fz_rendernode(fz_renderer *gc, fz_node *node, fz_matrix ctm) } fz_error * -fz_rendertree(fz_pixmap **outp, fz_renderer *gc, fz_tree *tree, fz_matrix ctm, fz_irect bbox) +fz_rendertree(fz_pixmap **outp, fz_renderer *gc, fz_tree *tree, fz_matrix ctm, fz_irect bbox, int white) { fz_error *error; gc->clip = bbox; + if (white) + { + error = fz_newpixmap(&gc->acc, + bbox.min.x, bbox.min.y, + bbox.max.x - bbox.min.x, bbox.max.y - bbox.min.y, 4); + if (error) + return error; + memset(gc->acc->samples, 0xff, gc->acc->w * gc->acc->h * gc->acc->n); + } + error = fz_rendernode(gc, tree->root, ctm); if (error) return error; - *outp = gc->tmp; - gc->tmp = nil; + if (white) + { + *outp = gc->acc; + gc->acc = nil; + } + else + { + *outp = gc->tmp; + gc->tmp = nil; + } + return nil; } |