diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2011-07-06 16:32:33 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2011-07-08 19:26:34 +0100 |
commit | 2c4bbbfdc7413a68cad395c3c61ff8e62dceb18b (patch) | |
tree | c2299029fa26028103e533c2dce15aa18d9a8d76 /xps | |
parent | 2f8acb0010c469c46682a298d66b108cc4c6cdd0 (diff) | |
download | mupdf-2c4bbbfdc7413a68cad395c3c61ff8e62dceb18b.tar.xz |
Clip area optimisations for displaylist case:
First, we add clipping rects to clipping functions. Various functions
(the ones that handle clipping) are now additionally passed a rectangle
that represents an additional bound for this clip in device space
(i.e. it has already been mapped through the current ctm).
Next, when constructing the displaylist, keep track of the bounding box
for the contents of each clip.
While writing the list, on every node we add, we add the bbox for that
node to the enclosing clips content bbox (if there is an enclosing clip).
When we pop a clip, write back to the corresponding push to update
the bbox.
This means if we get large clip regions, with only small areas used within
them, we will only do the slow blending for those small areas.
Finally, we fix a calculation in fz_bound_path which was incorrectly
accounting for mitrelimits. This was showing up in testing on page 630
of the PDF reference v1.7.
Diffstat (limited to 'xps')
-rw-r--r-- | xps/xps_path.c | 6 | ||||
-rw-r--r-- | xps/xps_tile.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/xps/xps_path.c b/xps/xps_path.c index 3cc98379..33526262 100644 --- a/xps/xps_path.c +++ b/xps/xps_path.c @@ -758,7 +758,7 @@ xps_clip(xps_context *ctx, fz_matrix ctm, xps_resource *dict, char *clip_att, xm path = xps_parse_path_geometry(ctx, dict, clip_tag, 0, &fill_rule); else path = fz_new_path(); - fz_clip_path(ctx->dev, path, fill_rule == 0, ctm); + fz_clip_path(ctx->dev, path, NULL, fill_rule == 0, ctm); fz_free_path(path); } @@ -957,7 +957,7 @@ xps_parse_path(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource *di { area = fz_bound_path(path, NULL, ctm); - fz_clip_path(ctx->dev, path, fill_rule == 0, ctm); + fz_clip_path(ctx->dev, path, NULL, fill_rule == 0, ctm); xps_parse_brush(ctx, ctm, area, fill_uri, dict, fill_tag); fz_pop_clip(ctx->dev); } @@ -975,7 +975,7 @@ xps_parse_path(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource *di if (stroke_tag) { - fz_clip_stroke_path(ctx->dev, path, &stroke, ctm); + fz_clip_stroke_path(ctx->dev, path, NULL, &stroke, ctm); xps_parse_brush(ctx, ctm, area, stroke_uri, dict, stroke_tag); fz_pop_clip(ctx->dev); } diff --git a/xps/xps_tile.c b/xps/xps_tile.c index d94fb4c8..0ea271c8 100644 --- a/xps/xps_tile.c +++ b/xps/xps_tile.c @@ -28,7 +28,7 @@ xps_paint_tiling_brush_clipped(xps_context *ctx, fz_matrix ctm, fz_rect viewbox, fz_lineto(path, viewbox.x1, viewbox.y1); fz_lineto(path, viewbox.x1, viewbox.y0); fz_closepath(path); - fz_clip_path(ctx->dev, path, 0, ctm); + fz_clip_path(ctx->dev, path, NULL, 0, ctm); fz_free_path(path); c->func(ctx, ctm, viewbox, c->base_uri, c->dict, c->root, c->user); fz_pop_clip(ctx->dev); |