From d8125a13c05eef69a3fd3b6a9512dc573b23cc05 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 9 Mar 2016 22:37:00 +0100 Subject: Remove begin_page and end_page device calls. To be moved into a new document writer interface later. --- source/fitz/device.c | 14 ----------- source/fitz/document.c | 6 ----- source/fitz/list-device.c | 58 ---------------------------------------------- source/fitz/stext-device.c | 26 +-------------------- source/fitz/trace-device.c | 19 --------------- 5 files changed, 1 insertion(+), 122 deletions(-) (limited to 'source/fitz') diff --git a/source/fitz/device.c b/source/fitz/device.c index fdee2042..5a293bce 100644 --- a/source/fitz/device.c +++ b/source/fitz/device.c @@ -29,20 +29,6 @@ fz_disable_device_hints(fz_context *ctx, fz_device *dev, int hints) dev->hints &= ~hints; } -void -fz_begin_page(fz_context *ctx, fz_device *dev, const fz_rect *rect, const fz_matrix *ctm) -{ - if (dev->begin_page) - dev->begin_page(ctx, dev, rect, ctm); -} - -void -fz_end_page(fz_context *ctx, fz_device *dev) -{ - if (dev->end_page) - dev->end_page(ctx, dev); -} - static void push_clip_stack(fz_context *ctx, fz_device *dev, const fz_rect *rect, int flags) { diff --git a/source/fitz/document.c b/source/fitz/document.c index 4cc5dbba..1719aaf6 100644 --- a/source/fitz/document.c +++ b/source/fitz/document.c @@ -330,10 +330,6 @@ void fz_run_page(fz_context *ctx, fz_page *page, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie) { fz_annot *annot; - fz_rect mediabox; - - fz_bound_page(ctx, page, &mediabox); - fz_begin_page(ctx, dev, &mediabox, transform); fz_run_page_contents(ctx, page, dev, transform, cookie); @@ -357,8 +353,6 @@ fz_run_page(fz_context *ctx, fz_page *page, fz_device *dev, const fz_matrix *tra fz_run_annot(ctx, annot, dev, transform, cookie); } - - fz_end_page(ctx, dev); } void * diff --git a/source/fitz/list-device.c b/source/fitz/list-device.c index 1d416073..156e50f6 100644 --- a/source/fitz/list-device.c +++ b/source/fitz/list-device.c @@ -7,8 +7,6 @@ typedef struct fz_list_device_s fz_list_device; typedef enum fz_display_command_e { - FZ_CMD_BEGIN_PAGE, - FZ_CMD_END_PAGE, FZ_CMD_FILL_PATH, FZ_CMD_STROKE_PATH, FZ_CMD_CLIP_PATH, @@ -631,52 +629,6 @@ fz_append_display_node( list->len += size; } -static void -fz_list_begin_page(fz_context *ctx, fz_device *dev, const fz_rect *mediabox, const fz_matrix *ctm) -{ - fz_list_device *writer = (fz_list_device *)dev; - fz_display_list *list = writer->list; - fz_rect rect = *mediabox; - - fz_transform_rect(&rect, ctm); - - fz_union_rect(&list->mediabox, &rect); - - fz_append_display_node( - ctx, - dev, - FZ_CMD_BEGIN_PAGE, - 0, /* flags */ - &rect, - NULL, /* path */ - NULL, /* color */ - NULL, /* colorspace */ - NULL, /* alpha */ - ctm, - NULL, /* stroke_state */ - NULL, /* private_data */ - 0); /* private_data_len */ -} - -static void -fz_list_end_page(fz_context *ctx, fz_device *dev) -{ - fz_append_display_node( - ctx, - dev, - FZ_CMD_END_PAGE, - 0, /* flags */ - NULL, /* rect */ - NULL, /* path */ - NULL, /* color */ - NULL, /* colorspace */ - NULL, /* alpha */ - NULL, /* ctm */ - NULL, /* stroke_state */ - NULL, /* private_data */ - 0); /* private_data_len */ -} - static void fz_list_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const fz_matrix *ctm, fz_colorspace *colorspace, const float *color, float alpha) @@ -1263,9 +1215,6 @@ fz_new_list_device(fz_context *ctx, fz_display_list *list) dev = fz_new_device(ctx, sizeof(fz_list_device)); - dev->super.begin_page = fz_list_begin_page; - dev->super.end_page = fz_list_end_page; - dev->super.fill_path = fz_list_fill_path; dev->super.stroke_path = fz_list_stroke_path; dev->super.clip_path = fz_list_clip_path; @@ -1615,7 +1564,6 @@ fz_run_display_list(fz_context *ctx, fz_display_list *list, fz_device *dev, cons if (tiled || n.cmd == FZ_CMD_BEGIN_TILE || n.cmd == FZ_CMD_END_TILE || - n.cmd == FZ_CMD_BEGIN_PAGE || n.cmd == FZ_CMD_END_PAGE || n.cmd == FZ_CMD_RENDER_FLAGS) { empty = 0; @@ -1662,12 +1610,6 @@ visible: { switch (n.cmd) { - case FZ_CMD_BEGIN_PAGE: - fz_begin_page(ctx, dev, &trans_rect, &trans_ctm); - break; - case FZ_CMD_END_PAGE: - fz_end_page(ctx, dev); - break; case FZ_CMD_FILL_PATH: fz_fill_path(ctx, dev, path, n.flags, &trans_ctm, colorspace, color, alpha); break; diff --git a/source/fitz/stext-device.c b/source/fitz/stext-device.c index 83bde371..c5b4c897 100644 --- a/source/fitz/stext-device.c +++ b/source/fitz/stext-device.c @@ -1021,22 +1021,7 @@ fz_bidi_reorder_stext_page(fz_context *ctx, fz_stext_page *page) } static void -fz_stext_begin_page(fz_context *ctx, fz_device *dev, const fz_rect *mediabox, const fz_matrix *ctm) -{ - fz_stext_device *tdev = (fz_stext_device*)dev; - - if (tdev->page->len) - { - tdev->page->next = fz_new_stext_page(ctx); - tdev->page = tdev->page->next; - } - - tdev->page->mediabox = *mediabox; - fz_transform_rect(&tdev->page->mediabox, ctm); -} - -static void -fz_stext_end_page(fz_context *ctx, fz_device *dev) +fz_stext_drop_imp(fz_context *ctx, fz_device *dev) { fz_stext_device *tdev = (fz_stext_device*)dev; @@ -1053,13 +1038,6 @@ fz_stext_end_page(fz_context *ctx, fz_device *dev) fz_bidi_reorder_stext_page(ctx, tdev->page); } -static void -fz_stext_drop_imp(fz_context *ctx, fz_device *dev) -{ - fz_stext_device *tdev = (fz_stext_device*)dev; - free_span_soup(ctx, tdev->spans); -} - fz_device * fz_new_stext_device(fz_context *ctx, fz_stext_sheet *sheet, fz_stext_page *page) { @@ -1068,8 +1046,6 @@ fz_new_stext_device(fz_context *ctx, fz_stext_sheet *sheet, fz_stext_page *page) dev->super.hints = FZ_IGNORE_IMAGE | FZ_IGNORE_SHADE; dev->super.drop_imp = fz_stext_drop_imp; - dev->super.begin_page = fz_stext_begin_page; - dev->super.end_page = fz_stext_end_page; dev->super.fill_text = fz_stext_fill_text; dev->super.stroke_text = fz_stext_stroke_text; dev->super.clip_text = fz_stext_clip_text; diff --git a/source/fitz/trace-device.c b/source/fitz/trace-device.c index fd9adcb5..86a1e60e 100644 --- a/source/fitz/trace-device.c +++ b/source/fitz/trace-device.c @@ -99,22 +99,6 @@ fz_trace_path(fz_context *ctx, fz_output *out, const fz_path *path) fz_walk_path(ctx, path, &trace_path_walker, out); } -static void -fz_trace_begin_page(fz_context *ctx, fz_device *dev, const fz_rect *rect, const fz_matrix *ctm) -{ - fz_output *out = ((fz_trace_device*)dev)->out; - fz_printf(ctx, out, "x0, rect->y0, rect->x1, rect->y1); - fz_trace_matrix(ctx, out, ctm); - fz_printf(ctx, out, ">\n"); -} - -static void -fz_trace_end_page(fz_context *ctx, fz_device *dev) -{ - fz_output *out = ((fz_trace_device*)dev)->out; - fz_printf(ctx, out, "\n"); -} - static void fz_trace_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const fz_matrix *ctm, fz_colorspace *colorspace, const float *color, float alpha) @@ -352,9 +336,6 @@ fz_device *fz_new_trace_device(fz_context *ctx, fz_output *out) { fz_trace_device *dev = fz_new_device(ctx, sizeof *dev); - dev->super.begin_page = fz_trace_begin_page; - dev->super.end_page = fz_trace_end_page; - dev->super.fill_path = fz_trace_fill_path; dev->super.stroke_path = fz_trace_stroke_path; dev->super.clip_path = fz_trace_clip_path; -- cgit v1.2.3