summaryrefslogtreecommitdiff
path: root/pdf
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2011-07-13 20:31:56 +0100
committerRobin Watts <robin.watts@artifex.com>2011-07-13 21:03:28 +0100
commit6913145eefde0e5c4cde9573d8d2cb2a35fd605d (patch)
treef79dc7269f4f562bdb168b572a37367e806e0190 /pdf
parent2c4bbbfdc7413a68cad395c3c61ff8e62dceb18b (diff)
downloadmupdf-6913145eefde0e5c4cde9573d8d2cb2a35fd605d.tar.xz
Non-isolated group support, and fix Bug 692336.
Firstly, this takes on some of Zenikos patch to correct the clip stack handling that was broken by the fix to bug 692287 (in commit 2c3bbbf). This bug should now be solved. We add a new 'shape' field to the draw device structure (and clip stack). When we are inside non-isolated groups, this is set to be a pixmap where we accumulate the 'shape' of the objects drawn. When we come to blend back, if we are blending a non-isolated group back, we have to use a different blending function that takes account of the shape. Various internal groups (the page group, and groups used to force blending) are set to be isolated to avoid carrying shape planes around when this is not required. All our rendering code now has to know how to maintain the shape plane as well as doing the basic rendering.
Diffstat (limited to 'pdf')
-rw-r--r--pdf/pdf_interpret.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/pdf/pdf_interpret.c b/pdf/pdf_interpret.c
index 4bcd59c9..8dcd4f80 100644
--- a/pdf/pdf_interpret.c
+++ b/pdf/pdf_interpret.c
@@ -149,7 +149,7 @@ pdf_begin_group(pdf_csi *csi, fz_rect bbox)
}
if (gstate->blendmode)
- fz_begin_group(csi->dev, bbox, 0, 0, gstate->blendmode, 1);
+ fz_begin_group(csi->dev, bbox, 1, 0, gstate->blendmode, 1);
}
static void
@@ -267,7 +267,8 @@ pdf_show_path(pdf_csi *csi, int doclose, int dofill, int dostroke, int even_odd)
else
bbox = fz_bound_path(path, NULL, gstate->ctm);
- pdf_begin_group(csi, bbox);
+ if (dofill || dostroke)
+ pdf_begin_group(csi, bbox);
if (dofill)
{
@@ -327,7 +328,8 @@ pdf_show_path(pdf_csi *csi, int doclose, int dofill, int dostroke, int even_odd)
}
}
- pdf_end_group(csi);
+ if (dofill || dostroke)
+ pdf_end_group(csi);
fz_free_path(path);
}
@@ -2239,7 +2241,7 @@ pdf_run_page_with_usage(pdf_xref *xref, pdf_page *page, fz_device *dev, fz_matri
int flags;
if (page->transparency)
- fz_begin_group(dev, fz_transform_rect(ctm, page->mediabox), 0, 0, 0, 1);
+ fz_begin_group(dev, fz_transform_rect(ctm, page->mediabox), 1, 0, 0, 1);
csi = pdf_new_csi(xref, dev, ctm, target);
error = pdf_run_buffer(csi, page->resources, page->contents);