summaryrefslogtreecommitdiff
path: root/source/fitz/trace-device.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2018-01-22 18:43:01 +0000
committerTor Andersson <tor.andersson@artifex.com>2018-02-13 14:45:02 +0100
commit60aa2d2f7109bc8e975f949d88729f1f3e4e7ac3 (patch)
tree67ab8847fcf4d2a7ba8928227b3a561c46a5a7d8 /source/fitz/trace-device.c
parent4e928c68b1852b860122bac28cc0f3af96c3156e (diff)
downloadmupdf-60aa2d2f7109bc8e975f949d88729f1f3e4e7ac3.tar.xz
Add fz_begin_layer/fz_end_layer.
Call these from the PDF interpreter. Make the DisplayList and Trace devices cope. Use these in the SVG output device.
Diffstat (limited to 'source/fitz/trace-device.c')
-rw-r--r--source/fitz/trace-device.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/fitz/trace-device.c b/source/fitz/trace-device.c
index 65c91924..59d625c7 100644
--- a/source/fitz/trace-device.c
+++ b/source/fitz/trace-device.c
@@ -348,6 +348,20 @@ fz_trace_end_tile(fz_context *ctx, fz_device *dev)
fz_write_printf(ctx, out, "</tile>\n");
}
+static void
+fz_trace_begin_layer(fz_context *ctx, fz_device *dev, const char *name)
+{
+ fz_output *out = ((fz_trace_device*)dev)->out;
+ fz_write_printf(ctx, out, "<layer name=\"%s\">\n", name);
+}
+
+static void
+fz_trace_end_layer(fz_context *ctx, fz_device *dev)
+{
+ fz_output *out = ((fz_trace_device*)dev)->out;
+ fz_write_printf(ctx, out, "</layer>\n");
+}
+
fz_device *fz_new_trace_device(fz_context *ctx, fz_output *out)
{
fz_trace_device *dev = fz_new_derived_device(ctx, fz_trace_device);
@@ -378,6 +392,9 @@ fz_device *fz_new_trace_device(fz_context *ctx, fz_output *out)
dev->super.begin_tile = fz_trace_begin_tile;
dev->super.end_tile = fz_trace_end_tile;
+ dev->super.begin_layer = fz_trace_begin_layer;
+ dev->super.end_layer = fz_trace_end_layer;
+
dev->out = out;
return (fz_device*)dev;