diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-06-29 17:26:27 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-07-05 15:32:34 +0200 |
commit | f40106ac6b7367292432ee7af61608548d490e8c (patch) | |
tree | 3b20165e215e76e3cca40e370e73482d9efdc8fc /platform/x11/pdfapp.c | |
parent | ea7403b4c172338dfe7f371302f82859921e60af (diff) | |
download | mupdf-f40106ac6b7367292432ee7af61608548d490e8c.tar.xz |
Pass rects by value: device and document interface.
Diffstat (limited to 'platform/x11/pdfapp.c')
-rw-r--r-- | platform/x11/pdfapp.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c index 81e73051..a12cb4c1 100644 --- a/platform/x11/pdfapp.c +++ b/platform/x11/pdfapp.c @@ -146,9 +146,9 @@ void pdfapp_setresolution(pdfapp_t *app, int res) app->resolution = res; } -void pdfapp_invert(pdfapp_t *app, const fz_rect *rect) +void pdfapp_invert(pdfapp_t *app, fz_rect rect) { - fz_invert_pixmap_rect(app->ctx, app->image, fz_round_rect(*rect)); + fz_invert_pixmap_rect(app->ctx, app->image, fz_round_rect(rect)); } void pdfapp_reloadfile(pdfapp_t *app) @@ -784,12 +784,12 @@ static void pdfapp_recreate_annotationslist(pdfapp_t *app) app->errored = errored; } -static void pdfapp_runpage(pdfapp_t *app, fz_device *dev, const fz_matrix ctm, const fz_rect *rect, fz_cookie *cookie) +static void pdfapp_runpage(pdfapp_t *app, fz_device *dev, const fz_matrix ctm, fz_rect scissor, fz_cookie *cookie) { if (app->page_list) - fz_run_display_list(app->ctx, app->page_list, dev, ctm, rect, cookie); + fz_run_display_list(app->ctx, app->page_list, dev, ctm, scissor, cookie); if (app->annotations_list) - fz_run_display_list(app->ctx, app->annotations_list, dev, ctm, rect, cookie); + fz_run_display_list(app->ctx, app->annotations_list, dev, ctm, scissor, cookie); } #define MAX_TITLE 256 @@ -818,7 +818,7 @@ static void pdfapp_updatepage(pdfapp_t *app) idev = fz_new_draw_device_with_bbox(app->ctx, fz_identity, app->image, &ibounds); fz_try(app->ctx) { - pdfapp_runpage(app, idev, ctm, &bounds, NULL); + pdfapp_runpage(app, idev, ctm, bounds, NULL); fz_close_device(app->ctx, idev); } fz_always(app->ctx) @@ -885,7 +885,7 @@ static void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage, int repai tdev = fz_new_stext_device(app->ctx, app->page_text, NULL); fz_try(app->ctx) { - pdfapp_runpage(app, tdev, fz_identity, &fz_infinite_rect, &cookie); + pdfapp_runpage(app, tdev, fz_identity, fz_infinite_rect, &cookie); fz_close_device(app->ctx, tdev); } fz_always(app->ctx) @@ -936,7 +936,7 @@ static void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage, int repai if (app->page_list || app->annotations_list) { idev = fz_new_draw_device(app->ctx, fz_identity, app->image); - pdfapp_runpage(app, idev, ctm, &bounds, &cookie); + pdfapp_runpage(app, idev, ctm, bounds, &cookie); fz_close_device(app->ctx, idev); } if (app->invert) @@ -1052,7 +1052,7 @@ void pdfapp_inverthit(pdfapp_t *app) { bbox = fz_rect_from_quad(app->hit_bbox[i]); bbox = fz_transform_rect(bbox, ctm); - pdfapp_invert(app, &bbox); + pdfapp_invert(app, bbox); } } |