summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-06-29 17:26:27 +0200
committerTor Andersson <tor.andersson@artifex.com>2018-07-05 15:32:34 +0200
commitf40106ac6b7367292432ee7af61608548d490e8c (patch)
tree3b20165e215e76e3cca40e370e73482d9efdc8fc
parentea7403b4c172338dfe7f371302f82859921e60af (diff)
downloadmupdf-f40106ac6b7367292432ee7af61608548d490e8c.tar.xz
Pass rects by value: device and document interface.
-rw-r--r--include/mupdf/fitz/device.h38
-rw-r--r--include/mupdf/fitz/display-list.h4
-rw-r--r--include/mupdf/fitz/font.h2
-rw-r--r--include/mupdf/fitz/shade.h2
-rw-r--r--include/mupdf/fitz/writer.h4
-rw-r--r--include/mupdf/pdf/document.h2
-rw-r--r--include/mupdf/pdf/output-pdf.h2
-rw-r--r--platform/gl/gl-annotate.c20
-rw-r--r--platform/java/mupdf_native.c48
-rw-r--r--platform/x11/pdfapp.c18
-rw-r--r--platform/x11/pdfapp.h2
-rw-r--r--platform/x11/x11_main.c4
-rw-r--r--source/fitz/bbox-device.c22
-rw-r--r--source/fitz/device.c80
-rw-r--r--source/fitz/draw-device.c54
-rw-r--r--source/fitz/draw-mesh.c29
-rw-r--r--source/fitz/font.c8
-rw-r--r--source/fitz/image.c2
-rw-r--r--source/fitz/list-device.c62
-rw-r--r--source/fitz/output-cbz.c4
-rw-r--r--source/fitz/output-pcl.c2
-rw-r--r--source/fitz/output-pclm.c2
-rw-r--r--source/fitz/output-ps.c2
-rw-r--r--source/fitz/output-pwg.c2
-rw-r--r--source/fitz/output-svg.c6
-rw-r--r--source/fitz/stext-device.c18
-rw-r--r--source/fitz/stext-output.c4
-rw-r--r--source/fitz/svg-device.c22
-rw-r--r--source/fitz/test-device.c16
-rw-r--r--source/fitz/trace-device.c24
-rw-r--r--source/fitz/util.c4
-rw-r--r--source/fitz/writer.c2
-rw-r--r--source/pdf/pdf-device.c27
-rw-r--r--source/pdf/pdf-op-run.c66
-rw-r--r--source/pdf/pdf-run.c2
-rw-r--r--source/pdf/pdf-write.c6
-rw-r--r--source/tools/muconvert.c2
-rw-r--r--source/tools/mudraw.c18
-rw-r--r--source/tools/muraster.c2
-rw-r--r--source/tools/murun.c46
-rw-r--r--source/tools/mutrace.c2
-rw-r--r--source/tools/pdfposter.c26
-rw-r--r--source/xps/xps-common.c2
-rw-r--r--source/xps/xps-glyphs.c2
-rw-r--r--source/xps/xps-path.c6
-rw-r--r--source/xps/xps-tile.c4
46 files changed, 345 insertions, 377 deletions
diff --git a/include/mupdf/fitz/device.h b/include/mupdf/fitz/device.h
index 334c8553..1c01b46f 100644
--- a/include/mupdf/fitz/device.h
+++ b/include/mupdf/fitz/device.h
@@ -88,28 +88,28 @@ struct fz_device_s
void (*fill_path)(fz_context *, fz_device *, const fz_path *, int even_odd, fz_matrix , fz_colorspace *, const float *color, float alpha, const fz_color_params *);
void (*stroke_path)(fz_context *, fz_device *, const fz_path *, const fz_stroke_state *, fz_matrix , fz_colorspace *, const float *color, float alpha, const fz_color_params *);
- void (*clip_path)(fz_context *, fz_device *, const fz_path *, int even_odd, fz_matrix , const fz_rect *scissor);
- void (*clip_stroke_path)(fz_context *, fz_device *, const fz_path *, const fz_stroke_state *, fz_matrix , const fz_rect *scissor);
+ void (*clip_path)(fz_context *, fz_device *, const fz_path *, int even_odd, fz_matrix , fz_rect scissor);
+ void (*clip_stroke_path)(fz_context *, fz_device *, const fz_path *, const fz_stroke_state *, fz_matrix , fz_rect scissor);
void (*fill_text)(fz_context *, fz_device *, const fz_text *, fz_matrix , fz_colorspace *, const float *color, float alpha, const fz_color_params *);
void (*stroke_text)(fz_context *, fz_device *, const fz_text *, const fz_stroke_state *, fz_matrix , fz_colorspace *, const float *color, float alpha, const fz_color_params *);
- void (*clip_text)(fz_context *, fz_device *, const fz_text *, fz_matrix , const fz_rect *scissor);
- void (*clip_stroke_text)(fz_context *, fz_device *, const fz_text *, const fz_stroke_state *, fz_matrix , const fz_rect *scissor);
+ void (*clip_text)(fz_context *, fz_device *, const fz_text *, fz_matrix , fz_rect scissor);
+ void (*clip_stroke_text)(fz_context *, fz_device *, const fz_text *, const fz_stroke_state *, fz_matrix , fz_rect scissor);
void (*ignore_text)(fz_context *, fz_device *, const fz_text *, fz_matrix );
void (*fill_shade)(fz_context *, fz_device *, fz_shade *shd, fz_matrix ctm, float alpha, const fz_color_params *color_params);
void (*fill_image)(fz_context *, fz_device *, fz_image *img, fz_matrix ctm, float alpha, const fz_color_params *color_params);
void (*fill_image_mask)(fz_context *, fz_device *, fz_image *img, fz_matrix ctm, fz_colorspace *, const float *color, float alpha, const fz_color_params *color_params);
- void (*clip_image_mask)(fz_context *, fz_device *, fz_image *img, fz_matrix ctm, const fz_rect *scissor);
+ void (*clip_image_mask)(fz_context *, fz_device *, fz_image *img, fz_matrix ctm, fz_rect scissor);
void (*pop_clip)(fz_context *, fz_device *);
- void (*begin_mask)(fz_context *, fz_device *, const fz_rect *, int luminosity, fz_colorspace *, const float *bc, const fz_color_params *);
+ void (*begin_mask)(fz_context *, fz_device *, fz_rect area, int luminosity, fz_colorspace *, const float *bc, const fz_color_params *);
void (*end_mask)(fz_context *, fz_device *);
- void (*begin_group)(fz_context *, fz_device *, const fz_rect *, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha);
+ void (*begin_group)(fz_context *, fz_device *, fz_rect area, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha);
void (*end_group)(fz_context *, fz_device *);
- int (*begin_tile)(fz_context *, fz_device *, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix ctm, int id);
+ int (*begin_tile)(fz_context *, fz_device *, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm, int id);
void (*end_tile)(fz_context *, fz_device *);
void (*render_flags)(fz_context *, fz_device *, int set, int clear);
@@ -130,24 +130,24 @@ struct fz_device_s
void fz_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params);
void fz_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params);
-void fz_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, const fz_rect *scissor);
-void fz_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor);
+void fz_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, fz_rect scissor);
+void fz_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor);
void fz_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params);
void fz_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params);
-void fz_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor);
-void fz_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor);
+void fz_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, fz_rect scissor);
+void fz_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor);
void fz_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm);
void fz_pop_clip(fz_context *ctx, fz_device *dev);
void fz_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, fz_matrix ctm, float alpha, const fz_color_params *color_params);
void fz_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, float alpha, const fz_color_params *color_params);
void fz_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params);
-void fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, const fz_rect *scissor);
-void fz_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *area, int luminosity, fz_colorspace *colorspace, const float *bc, const fz_color_params *color_params);
+void fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, fz_rect scissor);
+void fz_begin_mask(fz_context *ctx, fz_device *dev, fz_rect area, int luminosity, fz_colorspace *colorspace, const float *bc, const fz_color_params *color_params);
void fz_end_mask(fz_context *ctx, fz_device *dev);
-void fz_begin_group(fz_context *ctx, fz_device *dev, const fz_rect *area, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha);
+void fz_begin_group(fz_context *ctx, fz_device *dev, fz_rect area, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha);
void fz_end_group(fz_context *ctx, fz_device *dev);
-void fz_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix ctm);
-int fz_begin_tile_id(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix ctm, int id);
+void fz_begin_tile(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm);
+int fz_begin_tile_id(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm, int id);
void fz_end_tile(fz_context *ctx, fz_device *dev);
void fz_render_flags(fz_context *ctx, fz_device *dev, int set, int clear);
void fz_set_default_colorspaces(fz_context *ctx, fz_device *dev, fz_default_colorspaces *default_cs);
@@ -190,7 +190,7 @@ void fz_disable_device_hints(fz_context *ctx, fz_device *dev, int hints);
/*
Find current scissor region as tracked by the device.
*/
-const fz_rect *fz_device_current_scissor(fz_context *ctx, fz_device *dev);
+fz_rect fz_device_current_scissor(fz_context *ctx, fz_device *dev);
enum
{
@@ -412,6 +412,6 @@ fz_draw_options *fz_parse_draw_options(fz_context *ctx, fz_draw_options *options
mediabox: The bounds of the page in points.
pixmap: An out parameter containing the newly created pixmap.
*/
-fz_device *fz_new_draw_device_with_options(fz_context *ctx, const fz_draw_options *options, const fz_rect *mediabox, fz_pixmap **pixmap);
+fz_device *fz_new_draw_device_with_options(fz_context *ctx, const fz_draw_options *options, fz_rect mediabox, fz_pixmap **pixmap);
#endif
diff --git a/include/mupdf/fitz/display-list.h b/include/mupdf/fitz/display-list.h
index bcc229fe..d277d40a 100644
--- a/include/mupdf/fitz/display-list.h
+++ b/include/mupdf/fitz/display-list.h
@@ -61,7 +61,7 @@ fz_device *fz_new_list_device(fz_context *ctx, fz_display_list *list);
for example scaling and rotation, see fz_scale, fz_rotate and
fz_concat. Set to fz_identity if no transformation is desired.
- area: Only the part of the contents of the display list
+ scissor: Only the part of the contents of the display list
visible within this area will be considered when the list is
run through the device. This does not imply for tile objects
contained in the display list.
@@ -73,7 +73,7 @@ fz_device *fz_new_list_device(fz_context *ctx, fz_display_list *list);
progress information back to the caller. The fields inside
cookie are continually updated while the page is being run.
*/
-void fz_run_display_list(fz_context *ctx, fz_display_list *list, fz_device *dev, fz_matrix ctm, const fz_rect *area, fz_cookie *cookie);
+void fz_run_display_list(fz_context *ctx, fz_display_list *list, fz_device *dev, fz_matrix ctm, fz_rect scissor, fz_cookie *cookie);
/*
fz_keep_display_list: Keep a reference to a display list.
diff --git a/include/mupdf/fitz/font.h b/include/mupdf/fitz/font.h
index b05fa478..aaa02552 100644
--- a/include/mupdf/fitz/font.h
+++ b/include/mupdf/fitz/font.h
@@ -151,7 +151,7 @@ int fz_font_is_monospaced(fz_context *ctx, fz_font *font);
Returns a pointer to the font bbox (or NULL if the
font is NULL).
*/
-fz_rect *fz_font_bbox(fz_context *ctx, fz_font *font);
+fz_rect fz_font_bbox(fz_context *ctx, fz_font *font);
/*
fz_load_system_font_fn: Type for user supplied system font loading hook.
diff --git a/include/mupdf/fitz/shade.h b/include/mupdf/fitz/shade.h
index d6cf3c9e..98f7ad22 100644
--- a/include/mupdf/fitz/shade.h
+++ b/include/mupdf/fitz/shade.h
@@ -136,7 +136,7 @@ fz_rect fz_bound_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm);
op: NULL, or pointer to overprint bitmap.
*/
-void fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_colorspace *override_cs, fz_matrix ctm, fz_pixmap *dest, const fz_color_params *color_params, const fz_irect *bbox, const fz_overprint *op);
+void fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_colorspace *override_cs, fz_matrix ctm, fz_pixmap *dest, const fz_color_params *color_params, fz_irect bbox, const fz_overprint *op);
/*
* Handy routine for processing mesh based shades
diff --git a/include/mupdf/fitz/writer.h b/include/mupdf/fitz/writer.h
index 1ce51645..6850d06d 100644
--- a/include/mupdf/fitz/writer.h
+++ b/include/mupdf/fitz/writer.h
@@ -17,7 +17,7 @@ typedef struct fz_document_writer_s fz_document_writer;
Returns a fz_device to write page contents to.
*/
-typedef fz_device *(fz_document_writer_begin_page_fn)(fz_context *ctx, fz_document_writer *wri, const fz_rect *mediabox);
+typedef fz_device *(fz_document_writer_begin_page_fn)(fz_context *ctx, fz_document_writer *wri, fz_rect mediabox);
/*
fz_document_writer_end_page_fn: Function type to end the
@@ -119,7 +119,7 @@ fz_document_writer *fz_new_pkm_pixmap_writer(fz_context *ctx, const char *path,
Returns a fz_device to write page contents to.
*/
-fz_device *fz_begin_page(fz_context *ctx, fz_document_writer *wri, const fz_rect *mediabox);
+fz_device *fz_begin_page(fz_context *ctx, fz_document_writer *wri, fz_rect mediabox);
/*
fz_end_page: Called to end the process of writing a page to a
diff --git a/include/mupdf/pdf/document.h b/include/mupdf/pdf/document.h
index 4ca9a3a8..e2dd580a 100644
--- a/include/mupdf/pdf/document.h
+++ b/include/mupdf/pdf/document.h
@@ -796,7 +796,7 @@ pdf_obj *pdf_graft_mapped_object(fz_context *ctx, pdf_graft_map *map, pdf_obj *o
pcontents: Pointer to a place to put the created
contents buffer.
*/
-fz_device *pdf_page_write(fz_context *ctx, pdf_document *doc, const fz_rect *mediabox, pdf_obj **presources, fz_buffer **pcontents);
+fz_device *pdf_page_write(fz_context *ctx, pdf_document *doc, fz_rect mediabox, pdf_obj **presources, fz_buffer **pcontents);
/*
pdf_add_page: Create a pdf_obj within a document that
diff --git a/include/mupdf/pdf/output-pdf.h b/include/mupdf/pdf/output-pdf.h
index d223b45e..3d3c6568 100644
--- a/include/mupdf/pdf/output-pdf.h
+++ b/include/mupdf/pdf/output-pdf.h
@@ -11,7 +11,7 @@
is not an array, and that is it not shared with other objects/pages.
*/
fz_device *pdf_new_pdf_device(fz_context *ctx, pdf_document *doc, fz_matrix topctm,
- const fz_rect *mediabox, pdf_obj *resources, fz_buffer *contents);
+ fz_rect mediabox, pdf_obj *resources, fz_buffer *contents);
void pdf_localise_page_resources(fz_context *ctx, pdf_document *doc);
diff --git a/platform/gl/gl-annotate.c b/platform/gl/gl-annotate.c
index dca7519a..40e36a31 100644
--- a/platform/gl/gl-annotate.c
+++ b/platform/gl/gl-annotate.c
@@ -68,19 +68,19 @@ static void save_pdf_dialog(void)
}
}
-static int rects_differ(const fz_rect *a, const fz_rect *b, float threshold)
+static int rects_differ(fz_rect a, fz_rect b, float threshold)
{
- if (fz_abs(a->x0 - b->x0) > threshold) return 1;
- if (fz_abs(a->y0 - b->y0) > threshold) return 1;
- if (fz_abs(a->x1 - b->x1) > threshold) return 1;
- if (fz_abs(a->y1 - b->y1) > threshold) return 1;
+ if (fz_abs(a.x0 - b.x0) > threshold) return 1;
+ if (fz_abs(a.y0 - b.y0) > threshold) return 1;
+ if (fz_abs(a.x1 - b.x1) > threshold) return 1;
+ if (fz_abs(a.y1 - b.y1) > threshold) return 1;
return 0;
}
-static int points_differ(const fz_point *a, const fz_point *b, float threshold)
+static int points_differ(fz_point a, fz_point b, float threshold)
{
- if (fz_abs(a->x - b->x) > threshold) return 1;
- if (fz_abs(a->y - b->y) > threshold) return 1;
+ if (fz_abs(a.x - b.x) > threshold) return 1;
+ if (fz_abs(a.y - b.y) > threshold) return 1;
return 0;
}
@@ -836,7 +836,7 @@ static void do_edit_rect(fz_irect canvas_area, fz_irect area, fz_rect *rect)
if (!ui.down)
{
state = ER_NONE;
- if (rects_differ(&start_rect, rect, 1))
+ if (rects_differ(start_rect, *rect, 1))
{
fz_rect trect = fz_transform_rect(*rect, view_page_inv_ctm);
pdf_set_annot_rect(ctx, selected_annot, trect);
@@ -903,7 +903,7 @@ static void do_edit_line(fz_irect canvas_area, fz_irect area, fz_rect *rect)
if (!ui.down)
{
state = EL_NONE;
- if (points_differ(&start_a, &a, 1) || points_differ(&start_b, &b, 1))
+ if (points_differ(start_a, a, 1) || points_differ(start_b, b, 1))
{
a = fz_transform_point(a, view_page_inv_ctm);
b = fz_transform_point(b, view_page_inv_ctm);
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c
index 51c305ed..07331db4 100644
--- a/platform/java/mupdf_native.c
+++ b/platform/java/mupdf_native.c
@@ -1217,13 +1217,13 @@ static inline jobject to_Path(fz_context *ctx, JNIEnv *env, const fz_path *path)
return jpath;
}
-static inline jobject to_Rect(fz_context *ctx, JNIEnv *env, const fz_rect *rect)
+static inline jobject to_Rect(fz_context *ctx, JNIEnv *env, fz_rect rect)
{
jobject jrect;
if (!ctx) return NULL;
- jrect = (*env)->NewObject(env, cls_Rect, mid_Rect_init, rect->x0, rect->y0, rect->x1, rect->y1);
+ jrect = (*env)->NewObject(env, cls_Rect, mid_Rect_init, rect.x0, rect.y0, rect.x1, rect.y1);
if ((*env)->ExceptionCheck(env))
fz_throw_java(ctx, env);
@@ -2270,7 +2270,7 @@ fz_java_device_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path,
}
static void
-fz_java_device_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, const fz_rect *scissor)
+fz_java_device_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, fz_rect scissor)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
@@ -2283,7 +2283,7 @@ fz_java_device_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, i
}
static void
-fz_java_device_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *state, fz_matrix ctm, const fz_rect *scissor)
+fz_java_device_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *state, fz_matrix ctm, fz_rect scissor)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
@@ -2330,7 +2330,7 @@ fz_java_device_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text,
}
static void
-fz_java_device_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor)
+fz_java_device_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, fz_rect scissor)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
@@ -2343,7 +2343,7 @@ fz_java_device_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, f
}
static void
-fz_java_device_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *state, fz_matrix ctm, const fz_rect *scissor)
+fz_java_device_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *state, fz_matrix ctm, fz_rect scissor)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
@@ -2412,7 +2412,7 @@ fz_java_device_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *img, f
}
static void
-fz_java_device_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *img, fz_matrix ctm, const fz_rect *scissor)
+fz_java_device_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *img, fz_matrix ctm, fz_rect scissor)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
@@ -2461,7 +2461,7 @@ fz_java_device_end_layer(fz_context *ctx, fz_device *dev)
}
static void
-fz_java_device_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *rect, int luminosity, fz_colorspace *cs, const float *bc, const fz_color_params *cs_params)
+fz_java_device_begin_mask(fz_context *ctx, fz_device *dev, fz_rect rect, int luminosity, fz_colorspace *cs, const float *bc, const fz_color_params *cs_params)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
@@ -2487,7 +2487,7 @@ fz_java_device_end_mask(fz_context *ctx, fz_device *dev)
}
static void
-fz_java_device_begin_group(fz_context *ctx, fz_device *dev, const fz_rect *rect, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
+fz_java_device_begin_group(fz_context *ctx, fz_device *dev, fz_rect rect, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
@@ -2511,7 +2511,7 @@ fz_java_device_end_group(fz_context *ctx, fz_device *dev)
}
static int
-fz_java_device_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix ctm, int id)
+fz_java_device_begin_tile(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm, int id)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
@@ -2808,7 +2808,7 @@ FUN(NativeDevice_clipPath)(JNIEnv *env, jobject self, jobject jpath, jboolean ev
if (err)
return;
fz_try(ctx)
- fz_clip_path(ctx, dev, path, even_odd, ctm, NULL);
+ fz_clip_path(ctx, dev, path, even_odd, ctm, fz_infinite_rect);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -2834,7 +2834,7 @@ FUN(NativeDevice_clipStrokePath)(JNIEnv *env, jobject self, jobject jpath, jobje
if (err)
return;
fz_try(ctx)
- fz_clip_stroke_path(ctx, dev, path, stroke, ctm, NULL);
+ fz_clip_stroke_path(ctx, dev, path, stroke, ctm, fz_infinite_rect);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -2916,7 +2916,7 @@ FUN(NativeDevice_clipText)(JNIEnv *env, jobject self, jobject jtext, jobject jct
if (err)
return;
fz_try(ctx)
- fz_clip_text(ctx, dev, text, ctm, NULL);
+ fz_clip_text(ctx, dev, text, ctm, fz_infinite_rect);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -2942,7 +2942,7 @@ FUN(NativeDevice_clipStrokeText)(JNIEnv *env, jobject self, jobject jtext, jobje
if (err)
return;
fz_try(ctx)
- fz_clip_stroke_text(ctx, dev, text, stroke, ctm, NULL);
+ fz_clip_stroke_text(ctx, dev, text, stroke, ctm, fz_infinite_rect);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -3068,7 +3068,7 @@ FUN(NativeDevice_clipImageMask)(JNIEnv *env, jobject self, jobject jimg, jobject
if (err)
return;
fz_try(ctx)
- fz_clip_image_mask(ctx, dev, img, ctm, NULL);
+ fz_clip_image_mask(ctx, dev, img, ctm, fz_infinite_rect);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -3168,7 +3168,7 @@ FUN(NativeDevice_beginMask)(JNIEnv *env, jobject self, jobject jrect, jboolean l
if (err)
return;
fz_try(ctx)
- fz_begin_mask(ctx, dev, &rect, luminosity, cs, color, &cp);
+ fz_begin_mask(ctx, dev, rect, luminosity, cs, color, &cp);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -3211,7 +3211,7 @@ FUN(NativeDevice_beginGroup)(JNIEnv *env, jobject self, jobject jrect, jboolean
if (err)
return;
fz_try(ctx)
- fz_begin_group(ctx, dev, &rect, NULL, isolated, knockout, blendmode, alpha);
+ fz_begin_group(ctx, dev, rect, NULL, isolated, knockout, blendmode, alpha);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -3257,7 +3257,7 @@ FUN(NativeDevice_beginTile)(JNIEnv *env, jobject self, jobject jarea, jobject jv
if (err)
return 0;
fz_try(ctx)
- i = fz_begin_tile_id(ctx, dev, &area, &view, xstep, ystep, ctm, id);
+ i = fz_begin_tile_id(ctx, dev, area, view, xstep, ystep, ctm, id);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -5805,8 +5805,7 @@ FUN(DisplayList_run)(JNIEnv *env, jobject self, jobject jdev, jobject jctm, jobj
fz_matrix ctm = from_Matrix(env, jctm);
fz_cookie *cookie = from_Cookie(env, jcookie);
NativeDeviceInfo *info;
- fz_rect local_rect;
- fz_rect *rect = NULL;
+ fz_rect rect;
int err;
if (!ctx || !list) return;
@@ -5814,10 +5813,9 @@ FUN(DisplayList_run)(JNIEnv *env, jobject self, jobject jdev, jobject jctm, jobj
/* Use a scissor rectangle if one is supplied */
if (jrect)
- {
- rect = &local_rect;
- local_rect = from_Rect(env, jrect);
- }
+ rect = from_Rect(env, jrect);
+ else
+ rect = fz_infinite_rect;
info = lockNativeDevice(env, jdev, &err);
if (err)
@@ -6335,7 +6333,7 @@ FUN(DocumentWriter_beginPage)(JNIEnv *env, jobject self, jobject jmediabox)
if (!ctx || !wri) return NULL;
fz_try(ctx)
- device = fz_begin_page(ctx, wri, &mediabox);
+ device = fz_begin_page(ctx, wri, mediabox);
fz_catch(ctx)
{
jni_rethrow(env, ctx);
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);
}
}
diff --git a/platform/x11/pdfapp.h b/platform/x11/pdfapp.h
index 0315bfd0..318ebd89 100644
--- a/platform/x11/pdfapp.h
+++ b/platform/x11/pdfapp.h
@@ -164,7 +164,7 @@ void pdfapp_autozoom_horizontal(pdfapp_t *app);
void pdfapp_autozoom_vertical(pdfapp_t *app);
void pdfapp_autozoom(pdfapp_t *app);
-void pdfapp_invert(pdfapp_t *app, const fz_rect *rect);
+void pdfapp_invert(pdfapp_t *app, fz_rect rect);
void pdfapp_inverthit(pdfapp_t *app);
void pdfapp_postblit(pdfapp_t *app);
diff --git a/platform/x11/x11_main.c b/platform/x11/x11_main.c
index 7e5942bf..bdc13dfc 100644
--- a/platform/x11/x11_main.c
+++ b/platform/x11/x11_main.c
@@ -539,7 +539,7 @@ static void winblit(pdfapp_t *app)
if (gapp.iscopying || justcopied)
{
- pdfapp_invert(&gapp, &gapp.selr);
+ pdfapp_invert(&gapp, gapp.selr);
justcopied = 1;
}
@@ -582,7 +582,7 @@ static void winblit(pdfapp_t *app)
if (gapp.iscopying || justcopied)
{
- pdfapp_invert(&gapp, &gapp.selr);
+ pdfapp_invert(&gapp, gapp.selr);
justcopied = 1;
}
}
diff --git a/source/fitz/bbox-device.c b/source/fitz/bbox-device.c
index 9492a2da..6760ced5 100644
--- a/source/fitz/bbox-device.c
+++ b/source/fitz/bbox-device.c
@@ -82,31 +82,31 @@ fz_bbox_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_mat
}
static void
-fz_bbox_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, const fz_rect *scissor)
+fz_bbox_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, fz_rect scissor)
{
fz_bbox_add_rect(ctx, dev, fz_bound_path(ctx, path, NULL, ctm), 1);
}
static void
-fz_bbox_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor)
+fz_bbox_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
fz_bbox_add_rect(ctx, dev, fz_bound_path(ctx, path, stroke, ctm), 1);
}
static void
-fz_bbox_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor)
+fz_bbox_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, fz_rect scissor)
{
fz_bbox_add_rect(ctx, dev, fz_bound_text(ctx, text, NULL, ctm), 1);
}
static void
-fz_bbox_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor)
+fz_bbox_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
fz_bbox_add_rect(ctx, dev, fz_bound_text(ctx, text, stroke, ctm), 1);
}
static void
-fz_bbox_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, const fz_rect *scissor)
+fz_bbox_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, fz_rect scissor)
{
fz_bbox_add_rect(ctx, dev, fz_transform_rect(fz_unit_rect, ctm), 1);
}
@@ -122,10 +122,10 @@ fz_bbox_pop_clip(fz_context *ctx, fz_device *dev)
}
static void
-fz_bbox_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *rect, int luminosity, fz_colorspace *colorspace, const float *color, const fz_color_params *color_params)
+fz_bbox_begin_mask(fz_context *ctx, fz_device *dev, fz_rect rect, int luminosity, fz_colorspace *colorspace, const float *color, const fz_color_params *color_params)
{
fz_bbox_device *bdev = (fz_bbox_device*)dev;
- fz_bbox_add_rect(ctx, dev, *rect, 1);
+ fz_bbox_add_rect(ctx, dev, rect, 1);
bdev->ignore++;
}
@@ -138,9 +138,9 @@ fz_bbox_end_mask(fz_context *ctx, fz_device *dev)
}
static void
-fz_bbox_begin_group(fz_context *ctx, fz_device *dev, const fz_rect *rect, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
+fz_bbox_begin_group(fz_context *ctx, fz_device *dev, fz_rect rect, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
{
- fz_bbox_add_rect(ctx, dev, *rect, 1);
+ fz_bbox_add_rect(ctx, dev, rect, 1);
}
static void
@@ -150,10 +150,10 @@ fz_bbox_end_group(fz_context *ctx, fz_device *dev)
}
static int
-fz_bbox_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix ctm, int id)
+fz_bbox_begin_tile(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm, int id)
{
fz_bbox_device *bdev = (fz_bbox_device*)dev;
- fz_bbox_add_rect(ctx, dev, fz_transform_rect(*area, ctm), 0);
+ fz_bbox_add_rect(ctx, dev, fz_transform_rect(area, ctm), 0);
bdev->ignore++;
return 0;
}
diff --git a/source/fitz/device.c b/source/fitz/device.c
index cad71a6a..d024b4f5 100644
--- a/source/fitz/device.c
+++ b/source/fitz/device.c
@@ -85,7 +85,7 @@ fz_disable_device_hints(fz_context *ctx, fz_device *dev, int hints)
}
static void
-push_clip_stack(fz_context *ctx, fz_device *dev, const fz_rect *rect, int flags)
+push_clip_stack(fz_context *ctx, fz_device *dev, fz_rect rect, int flags)
{
if (dev->container_len == dev->container_cap)
{
@@ -96,10 +96,10 @@ push_clip_stack(fz_context *ctx, fz_device *dev, const fz_rect *rect, int flags)
dev->container_cap = newmax;
}
if (dev->container_len == 0)
- dev->container[0].scissor = *rect;
+ dev->container[0].scissor = rect;
else
{
- dev->container[dev->container_len].scissor = fz_intersect_rect(dev->container[dev->container_len-1].scissor, *rect);
+ dev->container[dev->container_len].scissor = fz_intersect_rect(dev->container[dev->container_len-1].scissor, rect);
}
dev->container[dev->container_len].flags = flags;
dev->container[dev->container_len].user = 0;
@@ -134,7 +134,7 @@ fz_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_st
}
void
-fz_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, const fz_rect *scissor)
+fz_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, fz_rect scissor)
{
if (dev->error_depth)
{
@@ -146,13 +146,9 @@ fz_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd,
{
if (dev->hints & FZ_MAINTAIN_CONTAINER_STACK)
{
- if (scissor == NULL)
- {
- fz_rect bbox = fz_bound_path(ctx, path, NULL, ctm);
- push_clip_stack(ctx, dev, &bbox, fz_device_container_stack_is_clip_path);
- }
- else
- push_clip_stack(ctx, dev, scissor, fz_device_container_stack_is_clip_path);
+ fz_rect bbox = fz_bound_path(ctx, path, NULL, ctm);
+ bbox = fz_intersect_rect(bbox, scissor);
+ push_clip_stack(ctx, dev, bbox, fz_device_container_stack_is_clip_path);
}
if (dev->clip_path)
dev->clip_path(ctx, dev, path, even_odd, ctm, scissor);
@@ -166,7 +162,7 @@ fz_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd,
}
void
-fz_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor)
+fz_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
if (dev->error_depth)
{
@@ -178,13 +174,9 @@ fz_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const
{
if (dev->hints & FZ_MAINTAIN_CONTAINER_STACK)
{
- if (scissor == NULL)
- {
- fz_rect bbox = fz_bound_path(ctx, path, stroke, ctm);
- push_clip_stack(ctx, dev, &bbox, fz_device_container_stack_is_clip_stroke_path);
- }
- else
- push_clip_stack(ctx, dev, scissor, fz_device_container_stack_is_clip_stroke_path);
+ fz_rect bbox = fz_bound_path(ctx, path, stroke, ctm);
+ bbox = fz_intersect_rect(bbox, scissor);
+ push_clip_stack(ctx, dev, bbox, fz_device_container_stack_is_clip_stroke_path);
}
if (dev->clip_stroke_path)
dev->clip_stroke_path(ctx, dev, path, stroke, ctm, scissor);
@@ -218,7 +210,7 @@ fz_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_st
}
void
-fz_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor)
+fz_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, fz_rect scissor)
{
if (dev->error_depth)
{
@@ -230,13 +222,9 @@ fz_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm
{
if (dev->hints & FZ_MAINTAIN_CONTAINER_STACK)
{
- if (scissor == NULL)
- {
- fz_rect bbox = fz_bound_text(ctx, text, NULL, ctm);
- push_clip_stack(ctx, dev, &bbox, fz_device_container_stack_is_clip_text);
- }
- else
- push_clip_stack(ctx, dev, scissor, fz_device_container_stack_is_clip_text);
+ fz_rect bbox = fz_bound_text(ctx, text, NULL, ctm);
+ bbox = fz_intersect_rect(bbox, scissor);
+ push_clip_stack(ctx, dev, bbox, fz_device_container_stack_is_clip_text);
}
if (dev->clip_text)
dev->clip_text(ctx, dev, text, ctm, scissor);
@@ -250,7 +238,7 @@ fz_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm
}
void
-fz_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor)
+fz_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
if (dev->error_depth)
{
@@ -262,13 +250,9 @@ fz_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const
{
if (dev->hints & FZ_MAINTAIN_CONTAINER_STACK)
{
- if (scissor == NULL)
- {
- fz_rect bbox = fz_bound_text(ctx, text, stroke, ctm);
- push_clip_stack(ctx, dev, &bbox, fz_device_container_stack_is_clip_stroke_text);
- }
- else
- push_clip_stack(ctx, dev, scissor, fz_device_container_stack_is_clip_stroke_text);
+ fz_rect bbox = fz_bound_text(ctx, text, stroke, ctm);
+ bbox = fz_intersect_rect(bbox, scissor);
+ push_clip_stack(ctx, dev, bbox, fz_device_container_stack_is_clip_stroke_text);
}
if (dev->clip_stroke_text)
dev->clip_stroke_text(ctx, dev, text, stroke, ctm, scissor);
@@ -335,7 +319,7 @@ fz_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix c
}
void
-fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, const fz_rect *scissor)
+fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, fz_rect scissor)
{
if (dev->error_depth)
{
@@ -347,13 +331,9 @@ fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix c
{
if (dev->hints & FZ_MAINTAIN_CONTAINER_STACK)
{
- if (scissor == NULL)
- {
- fz_rect bbox = fz_transform_rect(fz_unit_rect, ctm);
- push_clip_stack(ctx, dev, &bbox, fz_device_container_stack_is_clip_image_mask);
- }
- else
- push_clip_stack(ctx, dev, scissor, fz_device_container_stack_is_clip_image_mask);
+ fz_rect bbox = fz_transform_rect(fz_unit_rect, ctm);
+ bbox = fz_intersect_rect(bbox, scissor);
+ push_clip_stack(ctx, dev, bbox, fz_device_container_stack_is_clip_image_mask);
}
if (dev->clip_image_mask)
dev->clip_image_mask(ctx, dev, image, ctm, scissor);
@@ -367,7 +347,7 @@ fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix c
}
void
-fz_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *area, int luminosity, fz_colorspace *colorspace, const float *bc, const fz_color_params *color_params)
+fz_begin_mask(fz_context *ctx, fz_device *dev, fz_rect area, int luminosity, fz_colorspace *colorspace, const float *bc, const fz_color_params *color_params)
{
if (dev->error_depth)
{
@@ -417,7 +397,7 @@ fz_end_mask(fz_context *ctx, fz_device *dev)
}
void
-fz_begin_group(fz_context *ctx, fz_device *dev, const fz_rect *area, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
+fz_begin_group(fz_context *ctx, fz_device *dev, fz_rect area, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
{
if (dev->error_depth)
{
@@ -457,13 +437,13 @@ fz_end_group(fz_context *ctx, fz_device *dev)
}
void
-fz_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix ctm)
+fz_begin_tile(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm)
{
(void)fz_begin_tile_id(ctx, dev, area, view, xstep, ystep, ctm, 0);
}
int
-fz_begin_tile_id(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix ctm, int id)
+fz_begin_tile_id(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm, int id)
{
int ret = 0;
@@ -534,10 +514,10 @@ void fz_end_layer(fz_context *ctx, fz_device *dev)
dev->end_layer(ctx, dev);
}
-const fz_rect *
+fz_rect
fz_device_current_scissor(fz_context *ctx, fz_device *dev)
{
if (dev->container_len > 0)
- return &dev->container[dev->container_len-1].scissor;
- return &fz_infinite_rect;
+ return dev->container[dev->container_len-1].scissor;
+ return fz_infinite_rect;
}
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c
index d31fa9d8..21e898c0 100644
--- a/source/fitz/draw-device.c
+++ b/source/fitz/draw-device.c
@@ -732,7 +732,7 @@ fz_draw_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, const
}
static void
-fz_draw_clip_path(fz_context *ctx, fz_device *devp, const fz_path *path, int even_odd, fz_matrix in_ctm, const fz_rect *scissor)
+fz_draw_clip_path(fz_context *ctx, fz_device *devp, const fz_path *path, int even_odd, fz_matrix in_ctm, fz_rect scissor)
{
fz_draw_device *dev = (fz_draw_device*)devp;
fz_matrix ctm = fz_concat(in_ctm, dev->transform);
@@ -754,9 +754,9 @@ fz_draw_clip_path(fz_context *ctx, fz_device *devp, const fz_path *path, int eve
STACK_PUSHED("clip path");
model = state->dest->colorspace;
- if (scissor)
+ if (!fz_is_infinite_rect(scissor))
{
- bbox = fz_irect_from_rect(fz_transform_rect(*scissor, dev->transform));
+ bbox = fz_irect_from_rect(fz_transform_rect(scissor, dev->transform));
bbox = fz_intersect_irect(bbox, fz_pixmap_bbox(ctx, state->dest));
bbox = fz_intersect_irect(bbox, state->scissor);
}
@@ -806,7 +806,7 @@ fz_draw_clip_path(fz_context *ctx, fz_device *devp, const fz_path *path, int eve
}
static void
-fz_draw_clip_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, const fz_stroke_state *stroke, fz_matrix in_ctm, const fz_rect *scissor)
+fz_draw_clip_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, const fz_stroke_state *stroke, fz_matrix in_ctm, fz_rect scissor)
{
fz_draw_device *dev = (fz_draw_device*)devp;
fz_matrix ctm = fz_concat(in_ctm, dev->transform);
@@ -835,9 +835,9 @@ fz_draw_clip_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path,
STACK_PUSHED("clip stroke");
model = state->dest->colorspace;
- if (scissor)
+ if (!fz_is_infinite_rect(scissor))
{
- bbox = fz_irect_from_rect(fz_transform_rect(*scissor, dev->transform));
+ bbox = fz_irect_from_rect(fz_transform_rect(scissor, dev->transform));
bbox = fz_intersect_irect(bbox, fz_pixmap_bbox(ctx, state->dest));
bbox = fz_intersect_irect(bbox, state->scissor);
}
@@ -1140,7 +1140,7 @@ fz_draw_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, const
}
static void
-fz_draw_clip_text(fz_context *ctx, fz_device *devp, const fz_text *text, fz_matrix in_ctm, const fz_rect *scissor)
+fz_draw_clip_text(fz_context *ctx, fz_device *devp, const fz_text *text, fz_matrix in_ctm, fz_rect scissor)
{
fz_draw_device *dev = (fz_draw_device*)devp;
fz_matrix ctm = fz_concat(in_ctm, dev->transform);
@@ -1164,9 +1164,9 @@ fz_draw_clip_text(fz_context *ctx, fz_device *devp, const fz_text *text, fz_matr
/* make the mask the exact size needed */
bbox = fz_irect_from_rect(fz_bound_text(ctx, text, NULL, ctm));
bbox = fz_intersect_irect(bbox, state->scissor);
- if (scissor)
+ if (!fz_is_infinite_rect(scissor))
{
- fz_rect tscissor = fz_transform_rect(*scissor, dev->transform);
+ fz_rect tscissor = fz_transform_rect(scissor, dev->transform);
bbox = fz_intersect_irect(bbox, fz_irect_from_rect(tscissor));
}
@@ -1278,7 +1278,7 @@ fz_draw_clip_text(fz_context *ctx, fz_device *devp, const fz_text *text, fz_matr
}
static void
-fz_draw_clip_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, const fz_stroke_state *stroke, fz_matrix in_ctm, const fz_rect *scissor)
+fz_draw_clip_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, const fz_stroke_state *stroke, fz_matrix in_ctm, fz_rect scissor)
{
fz_draw_device *dev = (fz_draw_device*)devp;
fz_matrix ctm = fz_concat(in_ctm, dev->transform);
@@ -1300,9 +1300,9 @@ fz_draw_clip_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text,
/* make the mask the exact size needed */
bbox = fz_irect_from_rect(fz_bound_text(ctx, text, stroke, ctm));
bbox = fz_intersect_irect(bbox, state->scissor);
- if (scissor)
+ if (!fz_is_infinite_rect(scissor))
{
- fz_rect tscissor = fz_transform_rect(*scissor, dev->transform);
+ fz_rect tscissor = fz_transform_rect(scissor, dev->transform);
bbox = fz_intersect_irect(bbox, fz_irect_from_rect(tscissor));
}
@@ -1542,7 +1542,7 @@ fz_draw_fill_shade(fz_context *ctx, fz_device *devp, fz_shade *shade, fz_matrix
else
eop = NULL;
- fz_paint_shade(ctx, shade, colorspace, ctm, dest, color_params, &bbox, eop);
+ fz_paint_shade(ctx, shade, colorspace, ctm, dest, color_params, bbox, eop);
if (shape)
fz_clear_pixmap_rect_with_value(ctx, shape, 255, bbox);
if (group_alpha)
@@ -1938,7 +1938,7 @@ fz_draw_fill_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, fz_ma
}
static void
-fz_draw_clip_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, fz_matrix in_ctm, const fz_rect *scissor)
+fz_draw_clip_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, fz_matrix in_ctm, fz_rect scissor)
{
fz_draw_device *dev = (fz_draw_device*)devp;
fz_matrix local_ctm = fz_concat(in_ctm, dev->transform);
@@ -1973,9 +1973,9 @@ fz_draw_clip_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, fz_ma
bbox = fz_irect_from_rect(fz_transform_rect(fz_unit_rect, local_ctm));
bbox = fz_intersect_irect(bbox, state->scissor);
- if (scissor)
+ if (!fz_is_infinite_rect(scissor))
{
- fz_rect tscissor = fz_transform_rect(*scissor, dev->transform);
+ fz_rect tscissor = fz_transform_rect(scissor, dev->transform);
bbox = fz_intersect_irect(bbox, fz_irect_from_rect(tscissor));
}
@@ -2114,7 +2114,7 @@ fz_draw_pop_clip(fz_context *ctx, fz_device *devp)
}
static void
-fz_draw_begin_mask(fz_context *ctx, fz_device *devp, const fz_rect *rect, int luminosity, fz_colorspace *colorspace_in, const float *colorfv, const fz_color_params *color_params)
+fz_draw_begin_mask(fz_context *ctx, fz_device *devp, fz_rect area, int luminosity, fz_colorspace *colorspace_in, const float *colorfv, const fz_color_params *color_params)
{
fz_draw_device *dev = (fz_draw_device*)devp;
fz_pixmap *dest;
@@ -2135,7 +2135,7 @@ fz_draw_begin_mask(fz_context *ctx, fz_device *devp, const fz_rect *rect, int lu
color_params = fz_default_color_params(ctx);
STACK_PUSHED("mask");
- trect = fz_transform_rect(*rect, dev->transform);
+ trect = fz_transform_rect(area, dev->transform);
bbox = fz_intersect_irect(fz_irect_from_rect(trect), state->scissor);
/* Reset the blendmode for the mask rendering. In particular,
@@ -2273,7 +2273,7 @@ fz_draw_end_mask(fz_context *ctx, fz_device *devp)
}
static void
-fz_draw_begin_group(fz_context *ctx, fz_device *devp, const fz_rect *rect, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
+fz_draw_begin_group(fz_context *ctx, fz_device *devp, fz_rect area, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
{
fz_draw_device *dev = (fz_draw_device*)devp;
fz_irect bbox;
@@ -2293,7 +2293,7 @@ fz_draw_begin_group(fz_context *ctx, fz_device *devp, const fz_rect *rect, fz_co
state = push_stack(ctx, dev);
STACK_PUSHED("group");
- trect = fz_transform_rect(*rect, dev->transform);
+ trect = fz_transform_rect(area, dev->transform);
bbox = fz_intersect_irect(fz_irect_from_rect(trect), state->scissor);
fz_try(ctx)
@@ -2581,7 +2581,7 @@ fz_tile_size(fz_context *ctx, tile_record *tile)
}
static int
-fz_draw_begin_tile(fz_context *ctx, fz_device *devp, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix in_ctm, int id)
+fz_draw_begin_tile(fz_context *ctx, fz_device *devp, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix in_ctm, int id)
{
fz_draw_device *dev = (fz_draw_device*)devp;
fz_matrix ctm = fz_concat(in_ctm, dev->transform);
@@ -2603,7 +2603,7 @@ fz_draw_begin_tile(fz_context *ctx, fz_device *devp, const fz_rect *area, const
state = push_stack(ctx, dev);
STACK_PUSHED("tile");
- local_view = fz_transform_rect(*view, ctm);
+ local_view = fz_transform_rect(view, ctm);
bbox = fz_irect_from_rect(local_view);
/* We should never have a bbox that entirely covers our destination.
* If we do, then the check for only 1 tile being visible above has
@@ -2636,7 +2636,7 @@ fz_draw_begin_tile(fz_context *ctx, fz_device *devp, const fz_rect *area, const
state[1].ystep = ystep;
state[1].id = id;
state[1].encache = 0;
- state[1].area = fz_irect_from_rect(*area);
+ state[1].area = fz_irect_from_rect(area);
state[1].ctm = ctm;
#ifdef DUMP_GROUP_BLENDS
dump_spaces(dev->top-1, "Tile begin (cached)\n");
@@ -2670,7 +2670,7 @@ fz_draw_begin_tile(fz_context *ctx, fz_device *devp, const fz_rect *area, const
state[1].ystep = ystep;
state[1].id = id;
state[1].encache = 1;
- state[1].area = fz_irect_from_rect(*area);
+ state[1].area = fz_irect_from_rect(area);
state[1].ctm = ctm;
#ifdef DUMP_GROUP_BLENDS
dump_spaces(dev->top-1, "Tile begin\n");
@@ -3215,7 +3215,7 @@ fz_parse_draw_options(fz_context *ctx, fz_draw_options *opts, const char *args)
}
fz_device *
-fz_new_draw_device_with_options(fz_context *ctx, const fz_draw_options *opts, const fz_rect *mediabox, fz_pixmap **pixmap)
+fz_new_draw_device_with_options(fz_context *ctx, const fz_draw_options *opts, fz_rect mediabox, fz_pixmap **pixmap)
{
float x_zoom = opts->x_resolution / 72.0f;
float y_zoom = opts->y_resolution / 72.0f;
@@ -3231,7 +3231,7 @@ fz_new_draw_device_with_options(fz_context *ctx, const fz_draw_options *opts, co
fz_set_rasterizer_text_aa_level(ctx, &aa, opts->text);
transform = fz_pre_rotate(fz_scale(x_zoom, y_zoom), opts->rotate);
- bounds = *mediabox;
+ bounds = mediabox;
ibounds = fz_round_rect(fz_transform_rect(bounds, transform));
/* If width or height are set, we may need to adjust the transform */
@@ -3257,7 +3257,7 @@ fz_new_draw_device_with_options(fz_context *ctx, const fz_draw_options *opts, co
if (scalex != 1 || scaley != 1)
{
transform = fz_pre_scale(transform, scalex, scaley);
- bounds = *mediabox;
+ bounds = mediabox;
ibounds = fz_round_rect(fz_transform_rect(bounds, transform));
}
}
diff --git a/source/fitz/draw-mesh.c b/source/fitz/draw-mesh.c
index 3b08c1e1..adc9aa1f 100644
--- a/source/fitz/draw-mesh.c
+++ b/source/fitz/draw-mesh.c
@@ -99,7 +99,7 @@ static inline void step_edge(edge_data *edge, int n)
}
static void
-fz_paint_triangle(fz_pixmap *pix, float *v[3], int n, const fz_irect *bbox)
+fz_paint_triangle(fz_pixmap *pix, float *v[3], int n, fz_irect bbox)
{
edge_data e0, e1;
int top, mid, bot;
@@ -113,19 +113,19 @@ fz_paint_triangle(fz_pixmap *pix, float *v[3], int n, const fz_irect *bbox)
if (v[top][1] == v[bot][1]) return;
/* Test if the triangle is completely outside the scissor rect */
- if (v[bot][1] < bbox->y0) return;
- if (v[top][1] > bbox->y1) return;
+ if (v[bot][1] < bbox.y0) return;
+ if (v[top][1] > bbox.y1) return;
/* Magic! Ensure that mid/top/bot are all different */
mid = 3^top^bot;
assert(top != bot && top != mid && mid != bot);
- minx = fz_maxi(bbox->x0, pix->x);
- maxx = fz_mini(bbox->x1, pix->x + pix->w);
+ minx = fz_maxi(bbox.x0, pix->x);
+ maxx = fz_mini(bbox.x1, pix->x + pix->w);
- y = ceilf(fz_max(bbox->y0, v[top][1]));
- y1 = ceilf(fz_min(bbox->y1, v[mid][1]));
+ y = ceilf(fz_max(bbox.y0, v[top][1]));
+ y1 = ceilf(fz_min(bbox.y1, v[mid][1]));
n -= 2;
prepare_edge(v[top], v[bot], &e0, y, n);
@@ -143,7 +143,7 @@ fz_paint_triangle(fz_pixmap *pix, float *v[3], int n, const fz_irect *bbox)
while (y < y1);
}
- y1 = ceilf(fz_min(bbox->y1, v[bot][1]));
+ y1 = ceilf(fz_min(bbox.y1, v[bot][1]));
if (y < y1)
{
prepare_edge(v[mid], v[bot], &e1, y, n);
@@ -165,7 +165,7 @@ struct paint_tri_data
{
const fz_shade *shade;
fz_pixmap *dest;
- const fz_irect *bbox;
+ fz_irect bbox;
fz_color_converter cc;
};
@@ -211,7 +211,7 @@ do_paint_tri(fz_context *ctx, void *arg, fz_vertex *av, fz_vertex *bv, fz_vertex
}
void
-fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_colorspace *colorspace, fz_matrix ctm, fz_pixmap *dest, const fz_color_params *color_params, const fz_irect *bbox, const fz_overprint *op)
+fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_colorspace *colorspace, fz_matrix ctm, fz_pixmap *dest, const fz_color_params *color_params, fz_irect bbox, const fz_overprint *op)
{
unsigned char clut[256][FZ_MAX_COLORS];
fz_pixmap *temp = NULL;
@@ -234,9 +234,8 @@ fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_colorspace *colorspace, fz_m
if (shade->use_function)
{
- /* We need to use alpha = 1 here, because the shade might not fill
- * the bbox. */
- temp = fz_new_pixmap_with_bbox(ctx, fz_device_gray(ctx), *bbox, NULL, 1);
+ /* We need to use alpha = 1 here, because the shade might not fill the bbox. */
+ temp = fz_new_pixmap_with_bbox(ctx, fz_device_gray(ctx), bbox, NULL, 1);
fz_clear_pixmap(ctx, temp);
}
else
@@ -275,7 +274,7 @@ fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_colorspace *colorspace, fz_m
int n = fz_colorspace_n(ctx, colorspace);
/* alpha = 1 here for the same reason as earlier */
- conv = fz_new_pixmap_with_bbox(ctx, colorspace, *bbox, NULL, 1);
+ conv = fz_new_pixmap_with_bbox(ctx, colorspace, bbox, NULL, 1);
d = conv->samples;
while (hh--)
{
@@ -322,7 +321,7 @@ fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_colorspace *colorspace, fz_m
}
fz_drop_color_converter(ctx, &cc);
- conv = fz_new_pixmap_with_bbox(ctx, dest->colorspace, *bbox, dest->seps, 1);
+ conv = fz_new_pixmap_with_bbox(ctx, dest->colorspace, bbox, dest->seps, 1);
d = conv->samples;
da = conv->alpha;
while (hh--)
diff --git a/source/fitz/font.c b/source/fitz/font.c
index f24d639b..97c5347e 100644
--- a/source/fitz/font.c
+++ b/source/fitz/font.c
@@ -1307,7 +1307,7 @@ fz_bound_t3_glyph(fz_context *ctx, fz_font *font, int gid)
dev = fz_new_bbox_device(ctx, &font->bbox_table[gid]);
fz_try(ctx)
{
- fz_run_display_list(ctx, list, dev, font->t3matrix, &fz_infinite_rect, NULL);
+ fz_run_display_list(ctx, list, dev, font->t3matrix, fz_infinite_rect, NULL);
fz_close_device(ctx, dev);
}
fz_always(ctx)
@@ -1401,7 +1401,7 @@ fz_run_t3_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_devic
return;
ctm = fz_concat(font->t3matrix, trm);
- fz_run_display_list(ctx, list, dev, ctm, &fz_infinite_rect, NULL);
+ fz_run_display_list(ctx, list, dev, ctm, fz_infinite_rect, NULL);
}
fz_pixmap *
@@ -1791,9 +1791,9 @@ fz_buffer **fz_font_t3_procs(fz_context *ctx, fz_font *font)
return font ? font->t3procs : NULL;
}
-fz_rect *fz_font_bbox(fz_context *ctx, fz_font *font)
+fz_rect fz_font_bbox(fz_context *ctx, fz_font *font)
{
- return font ? &font->bbox : NULL;
+ return font->bbox;
}
void *fz_font_ft_face(fz_context *ctx, fz_font *font)
diff --git a/source/fitz/image.c b/source/fitz/image.c
index 7936adf8..79f7bfee 100644
--- a/source/fitz/image.c
+++ b/source/fitz/image.c
@@ -1145,7 +1145,7 @@ display_list_image_get_pixmap(fz_context *ctx, fz_image *image_, fz_irect *subar
dev = fz_new_draw_device(ctx, ctm, pix);
fz_try(ctx)
{
- fz_run_display_list(ctx, image->list, dev, fz_identity, NULL, NULL);
+ fz_run_display_list(ctx, image->list, dev, fz_identity, fz_infinite_rect, NULL);
fz_close_device(ctx, dev);
}
fz_always(ctx)
diff --git a/source/fitz/list-device.c b/source/fitz/list-device.c
index 88ad2110..072ce1d5 100644
--- a/source/fitz/list-device.c
+++ b/source/fitz/list-device.c
@@ -703,11 +703,10 @@ fz_list_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const
}
static void
-fz_list_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, const fz_rect *scissor)
+fz_list_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, fz_rect scissor)
{
fz_rect rect = fz_bound_path(ctx, path, NULL, ctm);
- if (scissor)
- rect = fz_intersect_rect(rect, *scissor);
+ rect = fz_intersect_rect(rect, scissor);
fz_append_display_node(
ctx,
dev,
@@ -725,11 +724,10 @@ fz_list_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even
}
static void
-fz_list_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor)
+fz_list_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
fz_rect rect = fz_bound_path(ctx, path, stroke, ctm);
- if (scissor)
- rect = fz_intersect_rect(rect, *scissor);
+ rect = fz_intersect_rect(rect, scissor);
fz_append_display_node(
ctx,
dev,
@@ -807,14 +805,13 @@ fz_list_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const
}
static void
-fz_list_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor)
+fz_list_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, fz_rect scissor)
{
fz_text *cloned_text = fz_keep_text(ctx, text);
fz_try(ctx)
{
fz_rect rect = fz_bound_text(ctx, text, NULL, ctm);
- if (scissor)
- rect = fz_intersect_rect(rect, *scissor);
+ rect = fz_intersect_rect(rect, scissor);
fz_append_display_node(
ctx,
dev,
@@ -838,14 +835,13 @@ fz_list_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matri
}
static void
-fz_list_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor)
+fz_list_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
fz_text *cloned_text = fz_keep_text(ctx, text);
fz_try(ctx)
{
fz_rect rect = fz_bound_text(ctx, text, stroke, ctm);
- if (scissor)
- rect = fz_intersect_rect(rect, *scissor);
+ rect = fz_intersect_rect(rect, scissor);
fz_append_display_node(
ctx,
dev,
@@ -1006,14 +1002,13 @@ fz_list_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_mat
}
static void
-fz_list_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, const fz_rect *scissor)
+fz_list_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, fz_rect scissor)
{
fz_image *image2 = fz_keep_image(ctx, image);
fz_try(ctx)
{
fz_rect rect = fz_transform_rect(fz_unit_rect, ctm);
- if (scissor)
- rect = fz_intersect_rect(rect, *scissor);
+ rect = fz_intersect_rect(rect, scissor);
fz_append_display_node(
ctx,
dev,
@@ -1037,14 +1032,14 @@ fz_list_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_mat
}
static void
-fz_list_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *rect, int luminosity, fz_colorspace *colorspace, const float *color, const fz_color_params *color_params)
+fz_list_begin_mask(fz_context *ctx, fz_device *dev, fz_rect rect, int luminosity, fz_colorspace *colorspace, const float *color, const fz_color_params *color_params)
{
fz_append_display_node(
ctx,
dev,
FZ_CMD_BEGIN_MASK,
(!!luminosity) | fz_pack_color_params(color_params), /* flags */
- rect,
+ &rect,
NULL, /* path */
color,
colorspace,
@@ -1075,7 +1070,7 @@ fz_list_end_mask(fz_context *ctx, fz_device *dev)
}
static void
-fz_list_begin_group(fz_context *ctx, fz_device *dev, const fz_rect *rect, fz_colorspace *colorspace, int isolated, int knockout, int blendmode, float alpha)
+fz_list_begin_group(fz_context *ctx, fz_device *dev, fz_rect rect, fz_colorspace *colorspace, int isolated, int knockout, int blendmode, float alpha)
{
int flags;
@@ -1094,7 +1089,7 @@ fz_list_begin_group(fz_context *ctx, fz_device *dev, const fz_rect *rect, fz_col
dev,
FZ_CMD_BEGIN_GROUP,
flags,
- rect,
+ &rect,
NULL, /* path */
NULL, /* color */
NULL, /* colorspace */
@@ -1141,20 +1136,20 @@ struct fz_list_tile_data_s
};
static int
-fz_list_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix ctm, int id)
+fz_list_begin_tile(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm, int id)
{
fz_list_tile_data tile;
tile.xstep = xstep;
tile.ystep = ystep;
- tile.view = *view;
+ tile.view = view;
tile.id = id;
fz_append_display_node(
ctx,
dev,
FZ_CMD_BEGIN_TILE,
0, /* flags */
- area,
+ &area,
NULL, /* path */
NULL, /* color */
NULL, /* colorspace */
@@ -1476,7 +1471,7 @@ int fz_display_list_is_empty(fz_context *ctx, const fz_display_list *list)
}
void
-fz_run_display_list(fz_context *ctx, fz_display_list *list, fz_device *dev, fz_matrix top_ctm, const fz_rect *scissor, fz_cookie *cookie)
+fz_run_display_list(fz_context *ctx, fz_display_list *list, fz_device *dev, fz_matrix top_ctm, fz_rect scissor, fz_cookie *cookie)
{
fz_display_node *node;
fz_display_node *node_end;
@@ -1502,9 +1497,6 @@ fz_run_display_list(fz_context *ctx, fz_display_list *list, fz_device *dev, fz_m
fz_var(colorspace);
- if (!scissor)
- scissor = &fz_infinite_rect;
-
if (cookie)
{
cookie->progress_max = list->len;
@@ -1669,7 +1661,7 @@ fz_run_display_list(fz_context *ctx, fz_display_list *list, fz_device *dev, fz_m
}
else
{
- empty = fz_is_empty_rect(fz_intersect_rect(trans_rect, *scissor));
+ empty = fz_is_empty_rect(fz_intersect_rect(trans_rect, scissor));
}
if (clipped || empty)
@@ -1716,10 +1708,10 @@ visible:
fz_stroke_path(ctx, dev, path, stroke, trans_ctm, colorspace, color, alpha, &color_params);
break;
case FZ_CMD_CLIP_PATH:
- fz_clip_path(ctx, dev, path, n.flags, trans_ctm, &trans_rect);
+ fz_clip_path(ctx, dev, path, n.flags, trans_ctm, trans_rect);
break;
case FZ_CMD_CLIP_STROKE_PATH:
- fz_clip_stroke_path(ctx, dev, path, stroke, trans_ctm, &trans_rect);
+ fz_clip_stroke_path(ctx, dev, path, stroke, trans_ctm, trans_rect);
break;
case FZ_CMD_FILL_TEXT:
fz_unpack_color_params(&color_params, n.flags);
@@ -1730,10 +1722,10 @@ visible:
fz_stroke_text(ctx, dev, *(fz_text **)node, stroke, trans_ctm, colorspace, color, alpha, &color_params);
break;
case FZ_CMD_CLIP_TEXT:
- fz_clip_text(ctx, dev, *(fz_text **)node, trans_ctm, &trans_rect);
+ fz_clip_text(ctx, dev, *(fz_text **)node, trans_ctm, trans_rect);
break;
case FZ_CMD_CLIP_STROKE_TEXT:
- fz_clip_stroke_text(ctx, dev, *(fz_text **)node, stroke, trans_ctm, &trans_rect);
+ fz_clip_stroke_text(ctx, dev, *(fz_text **)node, stroke, trans_ctm, trans_rect);
break;
case FZ_CMD_IGNORE_TEXT:
fz_ignore_text(ctx, dev, *(fz_text **)node, trans_ctm);
@@ -1751,20 +1743,20 @@ visible:
fz_fill_image_mask(ctx, dev, *(fz_image **)node, trans_ctm, colorspace, color, alpha, &color_params);
break;
case FZ_CMD_CLIP_IMAGE_MASK:
- fz_clip_image_mask(ctx, dev, *(fz_image **)node, trans_ctm, &trans_rect);
+ fz_clip_image_mask(ctx, dev, *(fz_image **)node, trans_ctm, trans_rect);
break;
case FZ_CMD_POP_CLIP:
fz_pop_clip(ctx, dev);
break;
case FZ_CMD_BEGIN_MASK:
fz_unpack_color_params(&color_params, n.flags);
- fz_begin_mask(ctx, dev, &trans_rect, n.flags, colorspace, color, &color_params);
+ fz_begin_mask(ctx, dev, trans_rect, n.flags, colorspace, color, &color_params);
break;
case FZ_CMD_END_MASK:
fz_end_mask(ctx, dev);
break;
case FZ_CMD_BEGIN_GROUP:
- fz_begin_group(ctx, dev, &trans_rect, *(fz_colorspace **)node, (n.flags & ISOLATED) != 0, (n.flags & KNOCKOUT) != 0, (n.flags>>2), alpha);
+ fz_begin_group(ctx, dev, trans_rect, *(fz_colorspace **)node, (n.flags & ISOLATED) != 0, (n.flags & KNOCKOUT) != 0, (n.flags>>2), alpha);
break;
case FZ_CMD_END_GROUP:
fz_end_group(ctx, dev);
@@ -1776,7 +1768,7 @@ visible:
fz_rect tile_rect;
tiled++;
tile_rect = data->view;
- cached = fz_begin_tile_id(ctx, dev, &rect, &tile_rect, data->xstep, data->ystep, trans_ctm, data->id);
+ cached = fz_begin_tile_id(ctx, dev, rect, tile_rect, data->xstep, data->ystep, trans_ctm, data->id);
if (cached)
tile_skip_depth = 1;
break;
diff --git a/source/fitz/output-cbz.c b/source/fitz/output-cbz.c
index 1eb0e473..7acf3157 100644
--- a/source/fitz/output-cbz.c
+++ b/source/fitz/output-cbz.c
@@ -20,7 +20,7 @@ struct fz_cbz_writer_s
};
static fz_device *
-cbz_begin_page(fz_context *ctx, fz_document_writer *wri_, const fz_rect *mediabox)
+cbz_begin_page(fz_context *ctx, fz_document_writer *wri_, fz_rect mediabox)
{
fz_cbz_writer *wri = (fz_cbz_writer*)wri_;
return fz_new_draw_device_with_options(ctx, &wri->options, mediabox, &wri->pixmap);
@@ -105,7 +105,7 @@ struct fz_pixmap_writer_s
};
static fz_device *
-pixmap_begin_page(fz_context *ctx, fz_document_writer *wri_, const fz_rect *mediabox)
+pixmap_begin_page(fz_context *ctx, fz_document_writer *wri_, fz_rect mediabox)
{
fz_pixmap_writer *wri = (fz_pixmap_writer*)wri_;
return fz_new_draw_device_with_options(ctx, &wri->options, mediabox, &wri->pixmap);
diff --git a/source/fitz/output-pcl.c b/source/fitz/output-pcl.c
index 4b885fe3..c25c59ff 100644
--- a/source/fitz/output-pcl.c
+++ b/source/fitz/output-pcl.c
@@ -1419,7 +1419,7 @@ struct fz_pcl_writer_s
};
static fz_device *
-pcl_begin_page(fz_context *ctx, fz_document_writer *wri_, const fz_rect *mediabox)
+pcl_begin_page(fz_context *ctx, fz_document_writer *wri_, fz_rect mediabox)
{
fz_pcl_writer *wri = (fz_pcl_writer*)wri_;
return fz_new_draw_device_with_options(ctx, &wri->draw, mediabox, &wri->pixmap);
diff --git a/source/fitz/output-pclm.c b/source/fitz/output-pclm.c
index f3aa2ec2..8d1e11c6 100644
--- a/source/fitz/output-pclm.c
+++ b/source/fitz/output-pclm.c
@@ -324,7 +324,7 @@ struct fz_pclm_writer_s
};
static fz_device *
-pclm_begin_page(fz_context *ctx, fz_document_writer *wri_, const fz_rect *mediabox)
+pclm_begin_page(fz_context *ctx, fz_document_writer *wri_, fz_rect mediabox)
{
fz_pclm_writer *wri = (fz_pclm_writer*)wri_;
return fz_new_draw_device_with_options(ctx, &wri->draw, mediabox, &wri->pixmap);
diff --git a/source/fitz/output-ps.c b/source/fitz/output-ps.c
index b270fcd4..a06c0006 100644
--- a/source/fitz/output-ps.c
+++ b/source/fitz/output-ps.c
@@ -290,7 +290,7 @@ struct fz_ps_writer_s
};
static fz_device *
-ps_begin_page(fz_context *ctx, fz_document_writer *wri_, const fz_rect *mediabox)
+ps_begin_page(fz_context *ctx, fz_document_writer *wri_, fz_rect mediabox)
{
fz_ps_writer *wri = (fz_ps_writer*)wri_;
wri->count++;
diff --git a/source/fitz/output-pwg.c b/source/fitz/output-pwg.c
index 42ad4a1f..fbbf9e79 100644
--- a/source/fitz/output-pwg.c
+++ b/source/fitz/output-pwg.c
@@ -410,7 +410,7 @@ struct fz_pwg_writer_s
};
static fz_device *
-pwg_begin_page(fz_context *ctx, fz_document_writer *wri_, const fz_rect *mediabox)
+pwg_begin_page(fz_context *ctx, fz_document_writer *wri_, fz_rect mediabox)
{
fz_pwg_writer *wri = (fz_pwg_writer*)wri_;
return fz_new_draw_device_with_options(ctx, &wri->draw, mediabox, &wri->pixmap);
diff --git a/source/fitz/output-svg.c b/source/fitz/output-svg.c
index 2bafda75..92d158e9 100644
--- a/source/fitz/output-svg.c
+++ b/source/fitz/output-svg.c
@@ -27,13 +27,13 @@ const char *fz_svg_write_options_usage =
;
static fz_device *
-svg_begin_page(fz_context *ctx, fz_document_writer *wri_, const fz_rect *mediabox)
+svg_begin_page(fz_context *ctx, fz_document_writer *wri_, fz_rect mediabox)
{
fz_svg_writer *wri = (fz_svg_writer*)wri_;
char path[PATH_MAX];
- float w = mediabox->x1 - mediabox->x0;
- float h = mediabox->y1 - mediabox->y0;
+ float w = mediabox.x1 - mediabox.x0;
+ float h = mediabox.y1 - mediabox.y0;
wri->count += 1;
diff --git a/source/fitz/stext-device.c b/source/fitz/stext-device.c
index 346d9bc2..0ba944d4 100644
--- a/source/fitz/stext-device.c
+++ b/source/fitz/stext-device.c
@@ -148,9 +148,9 @@ add_char_to_line(fz_context *ctx, fz_stext_page *page, fz_stext_line *line, fz_m
}
else
{
- fz_rect *bbox = fz_font_bbox(ctx, font);
- a.x = bbox->x1;
- d.x = bbox->x0;
+ fz_rect bbox = fz_font_bbox(ctx, font);
+ a.x = bbox.x1;
+ d.x = bbox.x0;
a.y = 0;
d.y = 0;
}
@@ -516,7 +516,7 @@ fz_stext_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const
}
static void
-fz_stext_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor)
+fz_stext_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, fz_rect scissor)
{
fz_stext_device *tdev = (fz_stext_device*)dev;
fz_text_span *span;
@@ -526,7 +526,7 @@ fz_stext_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matr
}
static void
-fz_stext_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor)
+fz_stext_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
fz_stext_device *tdev = (fz_stext_device*)dev;
fz_text_span *span;
@@ -567,7 +567,7 @@ fz_stext_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *img, fz_matr
}
static fz_image *
-fz_new_image_from_shade(fz_context *ctx, fz_shade *shade, fz_matrix *in_out_ctm, const fz_color_params *color_params, const fz_rect *scissor)
+fz_new_image_from_shade(fz_context *ctx, fz_shade *shade, fz_matrix *in_out_ctm, const fz_color_params *color_params, fz_rect scissor)
{
fz_matrix ctm = *in_out_ctm;
fz_pixmap *pix;
@@ -576,7 +576,7 @@ fz_new_image_from_shade(fz_context *ctx, fz_shade *shade, fz_matrix *in_out_ctm,
fz_irect bbox;
bounds = fz_bound_shade(ctx, shade, ctm);
- bounds = fz_intersect_rect(bounds, *scissor);
+ bounds = fz_intersect_rect(bounds, scissor);
bbox = fz_irect_from_rect(bounds);
pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb(ctx), bbox, NULL, !shade->use_background);
@@ -586,7 +586,7 @@ fz_new_image_from_shade(fz_context *ctx, fz_shade *shade, fz_matrix *in_out_ctm,
fz_fill_pixmap_with_color(ctx, pix, shade->colorspace, shade->background, color_params);
else
fz_clear_pixmap(ctx, pix);
- fz_paint_shade(ctx, shade, NULL, ctm, pix, color_params, &bbox, NULL);
+ fz_paint_shade(ctx, shade, NULL, ctm, pix, color_params, bbox, NULL);
img = fz_new_image_from_pixmap(ctx, pix, NULL);
}
fz_always(ctx)
@@ -607,7 +607,7 @@ static void
fz_stext_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, fz_matrix ctm, float alpha, const fz_color_params *color_params)
{
fz_matrix local_ctm = ctm;
- const fz_rect *scissor = fz_device_current_scissor(ctx, dev);
+ fz_rect scissor = fz_device_current_scissor(ctx, dev);
fz_image *image = fz_new_image_from_shade(ctx, shade, &local_ctm, color_params, scissor);
fz_try(ctx)
fz_stext_fill_image(ctx, dev, image, local_ctm, alpha, color_params);
diff --git a/source/fitz/stext-output.c b/source/fitz/stext-output.c
index d949f2d8..154dfedb 100644
--- a/source/fitz/stext-output.c
+++ b/source/fitz/stext-output.c
@@ -455,7 +455,7 @@ struct fz_text_writer_s
};
static fz_device *
-text_begin_page(fz_context *ctx, fz_document_writer *wri_, const fz_rect *mediabox)
+text_begin_page(fz_context *ctx, fz_document_writer *wri_, fz_rect mediabox)
{
fz_text_writer *wri = (fz_text_writer*)wri_;
@@ -465,7 +465,7 @@ text_begin_page(fz_context *ctx, fz_document_writer *wri_, const fz_rect *mediab
wri->page = NULL;
}
- wri->page = fz_new_stext_page(ctx, *mediabox);
+ wri->page = fz_new_stext_page(ctx, mediabox);
return fz_new_stext_device(ctx, wri->page, &wri->opts);
}
diff --git a/source/fitz/svg-device.c b/source/fitz/svg-device.c
index ec3441a3..17a35f7c 100644
--- a/source/fitz/svg-device.c
+++ b/source/fitz/svg-device.c
@@ -617,7 +617,7 @@ svg_dev_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const
}
static void
-svg_dev_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, const fz_rect *scissor)
+svg_dev_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, fz_rect scissor)
{
svg_device *sdev = (svg_device*)dev;
fz_output *out;
@@ -637,7 +637,7 @@ svg_dev_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even
}
static void
-svg_dev_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor)
+svg_dev_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
svg_device *sdev = (svg_device*)dev;
@@ -718,7 +718,7 @@ svg_dev_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const
}
static void
-svg_dev_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor)
+svg_dev_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, fz_rect scissor)
{
svg_device *sdev = (svg_device*)dev;
fz_output *out = sdev->out;
@@ -758,7 +758,7 @@ svg_dev_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matri
}
static void
-svg_dev_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor)
+svg_dev_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
svg_device *sdev = (svg_device*)dev;
@@ -919,7 +919,7 @@ svg_dev_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, fz_matrix c
fz_try(ctx)
{
- fz_paint_shade(ctx, shade, NULL, ctm, pix, color_params, &bbox, NULL);
+ fz_paint_shade(ctx, shade, NULL, ctm, pix, color_params, bbox, NULL);
buf = fz_new_buffer_from_pixmap_as_png(ctx, pix, color_params);
if (alpha != 1.0f)
fz_write_printf(ctx, out, "<g opacity=\"%g\">\n", alpha);
@@ -966,7 +966,7 @@ svg_dev_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_mat
}
static void
-svg_dev_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, const fz_rect *scissor)
+svg_dev_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, fz_rect scissor)
{
svg_device *sdev = (svg_device*)dev;
fz_output *out;
@@ -999,7 +999,7 @@ svg_dev_pop_clip(fz_context *ctx, fz_device *dev)
}
static void
-svg_dev_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *bbox, int luminosity, fz_colorspace *colorspace, const float *color, const fz_color_params *color_params)
+svg_dev_begin_mask(fz_context *ctx, fz_device *dev, fz_rect bbox, int luminosity, fz_colorspace *colorspace, const float *color, const fz_color_params *color_params)
{
svg_device *sdev = (svg_device*)dev;
fz_output *out;
@@ -1028,7 +1028,7 @@ svg_dev_end_mask(fz_context *ctx, fz_device *dev)
}
static void
-svg_dev_begin_group(fz_context *ctx, fz_device *dev, const fz_rect *bbox, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
+svg_dev_begin_group(fz_context *ctx, fz_device *dev, fz_rect bbox, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
{
svg_device *sdev = (svg_device*)dev;
fz_output *out = sdev->out;
@@ -1050,7 +1050,7 @@ svg_dev_end_group(fz_context *ctx, fz_device *dev)
}
static int
-svg_dev_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix ctm, int id)
+svg_dev_begin_tile(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm, int id)
{
svg_device *sdev = (svg_device*)dev;
fz_output *out;
@@ -1066,8 +1066,8 @@ svg_dev_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const f
}
num = sdev->num_tiles++;
t = &sdev->tiles[num];
- t->area = *area;
- t->view = *view;
+ t->area = area;
+ t->view = view;
t->ctm = ctm;
t->pattern = sdev->id++;
t->step.x = xstep;
diff --git a/source/fitz/test-device.c b/source/fitz/test-device.c
index ce8923a4..8d069f69 100644
--- a/source/fitz/test-device.c
+++ b/source/fitz/test-device.c
@@ -381,7 +381,7 @@ fz_test_fill_image_mask(fz_context *ctx, fz_device *dev_, fz_image *image, fz_ma
}
static void
-fz_test_clip_path(fz_context *ctx, fz_device *dev_, const fz_path *path, int even_odd, fz_matrix ctm, const fz_rect *scissor)
+fz_test_clip_path(fz_context *ctx, fz_device *dev_, const fz_path *path, int even_odd, fz_matrix ctm, fz_rect scissor)
{
fz_test_device *dev = (fz_test_device*)dev_;
@@ -389,7 +389,7 @@ fz_test_clip_path(fz_context *ctx, fz_device *dev_, const fz_path *path, int eve
}
static void
-fz_test_clip_stroke_path(fz_context *ctx, fz_device *dev_, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor)
+fz_test_clip_stroke_path(fz_context *ctx, fz_device *dev_, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
fz_test_device *dev = (fz_test_device*)dev_;
@@ -397,7 +397,7 @@ fz_test_clip_stroke_path(fz_context *ctx, fz_device *dev_, const fz_path *path,
}
static void
-fz_test_clip_text(fz_context *ctx, fz_device *dev_, const fz_text *text, fz_matrix ctm, const fz_rect *scissor)
+fz_test_clip_text(fz_context *ctx, fz_device *dev_, const fz_text *text, fz_matrix ctm, fz_rect scissor)
{
fz_test_device *dev = (fz_test_device*)dev_;
@@ -405,7 +405,7 @@ fz_test_clip_text(fz_context *ctx, fz_device *dev_, const fz_text *text, fz_matr
}
static void
-fz_test_clip_stroke_text(fz_context *ctx, fz_device *dev_, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor)
+fz_test_clip_stroke_text(fz_context *ctx, fz_device *dev_, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
fz_test_device *dev = (fz_test_device*)dev_;
@@ -421,7 +421,7 @@ fz_test_ignore_text(fz_context *ctx, fz_device *dev_, const fz_text *text, fz_ma
}
static void
-fz_test_clip_image_mask(fz_context *ctx, fz_device *dev_, fz_image *img, fz_matrix ctm, const fz_rect *scissor)
+fz_test_clip_image_mask(fz_context *ctx, fz_device *dev_, fz_image *img, fz_matrix ctm, fz_rect scissor)
{
fz_test_device *dev = (fz_test_device*)dev_;
@@ -437,7 +437,7 @@ fz_test_pop_clip(fz_context *ctx, fz_device *dev_)
}
static void
-fz_test_begin_mask(fz_context *ctx, fz_device *dev_, const fz_rect *rect, int luminosity, fz_colorspace *cs, const float *bc, const fz_color_params *color_params)
+fz_test_begin_mask(fz_context *ctx, fz_device *dev_, fz_rect rect, int luminosity, fz_colorspace *cs, const float *bc, const fz_color_params *color_params)
{
fz_test_device *dev = (fz_test_device*)dev_;
@@ -453,7 +453,7 @@ fz_test_end_mask(fz_context *ctx, fz_device *dev_)
}
static void
-fz_test_begin_group(fz_context *ctx, fz_device *dev_, const fz_rect *rect, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
+fz_test_begin_group(fz_context *ctx, fz_device *dev_, fz_rect rect, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
{
fz_test_device *dev = (fz_test_device*)dev_;
@@ -469,7 +469,7 @@ fz_test_end_group(fz_context *ctx, fz_device *dev_)
}
static int
-fz_test_begin_tile(fz_context *ctx, fz_device *dev_, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix ctm, int id)
+fz_test_begin_tile(fz_context *ctx, fz_device *dev_, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm, int id)
{
fz_test_device *dev = (fz_test_device*)dev_;
diff --git a/source/fitz/trace-device.c b/source/fitz/trace-device.c
index b89661ad..1d94412b 100644
--- a/source/fitz/trace-device.c
+++ b/source/fitz/trace-device.c
@@ -162,7 +162,7 @@ fz_trace_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const
}
static void
-fz_trace_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, const fz_rect *scissor)
+fz_trace_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, fz_rect scissor)
{
fz_output *out = ((fz_trace_device*)dev)->out;
fz_write_printf(ctx, out, "<clip_path");
@@ -177,7 +177,7 @@ fz_trace_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int eve
}
static void
-fz_trace_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor)
+fz_trace_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
fz_output *out = ((fz_trace_device*)dev)->out;
fz_write_printf(ctx, out, "<clip_stroke_path");
@@ -214,7 +214,7 @@ fz_trace_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const
}
static void
-fz_trace_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor)
+fz_trace_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, fz_rect scissor)
{
fz_output *out = ((fz_trace_device*)dev)->out;
fz_write_printf(ctx, out, "<clip_text");
@@ -225,7 +225,7 @@ fz_trace_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matr
}
static void
-fz_trace_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor)
+fz_trace_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
fz_output *out = ((fz_trace_device*)dev)->out;
fz_write_printf(ctx, out, "<clip_stroke_text");
@@ -278,7 +278,7 @@ fz_trace_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_ma
}
static void
-fz_trace_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, const fz_rect *scissor)
+fz_trace_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, fz_rect scissor)
{
fz_output *out = ((fz_trace_device*)dev)->out;
fz_write_printf(ctx, out, "<clip_image_mask");
@@ -295,11 +295,11 @@ fz_trace_pop_clip(fz_context *ctx, fz_device *dev)
}
static void
-fz_trace_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *bbox, int luminosity, fz_colorspace *colorspace, const float *color, const fz_color_params *color_params)
+fz_trace_begin_mask(fz_context *ctx, fz_device *dev, fz_rect bbox, int luminosity, fz_colorspace *colorspace, const float *color, const fz_color_params *color_params)
{
fz_output *out = ((fz_trace_device*)dev)->out;
fz_write_printf(ctx, out, "<mask bbox=\"%g %g %g %g\" s=\"%s\"",
- bbox->x0, bbox->y0, bbox->x1, bbox->y1,
+ bbox.x0, bbox.y0, bbox.x1, bbox.y1,
luminosity ? "luminosity" : "alpha");
fz_write_printf(ctx, out, ">\n");
}
@@ -312,11 +312,11 @@ fz_trace_end_mask(fz_context *ctx, fz_device *dev)
}
static void
-fz_trace_begin_group(fz_context *ctx, fz_device *dev, const fz_rect *bbox, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
+fz_trace_begin_group(fz_context *ctx, fz_device *dev, fz_rect bbox, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
{
fz_output *out = ((fz_trace_device*)dev)->out;
fz_write_printf(ctx, out, "<group bbox=\"%g %g %g %g\" isolated=\"%d\" knockout=\"%d\" blendmode=\"%s\" alpha=\"%g\">\n",
- bbox->x0, bbox->y0, bbox->x1, bbox->y1,
+ bbox.x0, bbox.y0, bbox.x1, bbox.y1,
isolated, knockout, fz_blendmode_name(blendmode), alpha);
}
@@ -328,12 +328,12 @@ fz_trace_end_group(fz_context *ctx, fz_device *dev)
}
static int
-fz_trace_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix ctm, int id)
+fz_trace_begin_tile(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm, int id)
{
fz_output *out = ((fz_trace_device*)dev)->out;
fz_write_printf(ctx, out, "<tile id=\"%d\"", id);
- fz_write_printf(ctx, out, " area=\"%g %g %g %g\"", area->x0, area->y0, area->x1, area->y1);
- fz_write_printf(ctx, out, " view=\"%g %g %g %g\"", view->x0, view->y0, view->x1, view->y1);
+ fz_write_printf(ctx, out, " area=\"%g %g %g %g\"", area.x0, area.y0, area.x1, area.y1);
+ fz_write_printf(ctx, out, " view=\"%g %g %g %g\"", view.x0, view.y0, view.x1, view.y1);
fz_write_printf(ctx, out, " xstep=\"%g\" ystep=\"%g\"", xstep, ystep);
fz_trace_matrix(ctx, out, ctm);
fz_write_printf(ctx, out, ">\n");
diff --git a/source/fitz/util.c b/source/fitz/util.c
index 4e1f4e1e..aea89144 100644
--- a/source/fitz/util.c
+++ b/source/fitz/util.c
@@ -119,7 +119,7 @@ fz_new_pixmap_from_display_list(fz_context *ctx, fz_display_list *list, fz_matri
fz_try(ctx)
{
dev = fz_new_draw_device(ctx, ctm, pix);
- fz_run_display_list(ctx, list, dev, fz_identity, NULL, NULL);
+ fz_run_display_list(ctx, list, dev, fz_identity, fz_infinite_rect, NULL);
fz_close_device(ctx, dev);
}
fz_always(ctx)
@@ -275,7 +275,7 @@ fz_new_stext_page_from_display_list(fz_context *ctx, fz_display_list *list, cons
fz_try(ctx)
{
dev = fz_new_stext_device(ctx, text, options);
- fz_run_display_list(ctx, list, dev, fz_identity, NULL, NULL);
+ fz_run_display_list(ctx, list, dev, fz_identity, fz_infinite_rect, NULL);
fz_close_device(ctx, dev);
}
fz_always(ctx)
diff --git a/source/fitz/writer.c b/source/fitz/writer.c
index 1e9652da..ada07089 100644
--- a/source/fitz/writer.c
+++ b/source/fitz/writer.c
@@ -185,7 +185,7 @@ fz_drop_document_writer(fz_context *ctx, fz_document_writer *wri)
}
fz_device *
-fz_begin_page(fz_context *ctx, fz_document_writer *wri, const fz_rect *mediabox)
+fz_begin_page(fz_context *ctx, fz_document_writer *wri, fz_rect mediabox)
{
if (!wri)
return NULL;
diff --git a/source/pdf/pdf-device.c b/source/pdf/pdf-device.c
index 97621b49..8d079689 100644
--- a/source/pdf/pdf-device.c
+++ b/source/pdf/pdf-device.c
@@ -526,7 +526,7 @@ pdf_dev_end_text(fz_context *ctx, pdf_device *pdev)
}
static int
-pdf_dev_new_form(fz_context *ctx, pdf_obj **form_ref, pdf_device *pdev, const fz_rect *bbox, int isolated, int knockout, float alpha, fz_colorspace *colorspace)
+pdf_dev_new_form(fz_context *ctx, pdf_obj **form_ref, pdf_device *pdev, fz_rect bbox, int isolated, int knockout, float alpha, fz_colorspace *colorspace)
{
pdf_document *doc = pdev->doc;
int num;
@@ -605,7 +605,7 @@ pdf_dev_new_form(fz_context *ctx, pdf_obj **form_ref, pdf_device *pdev, const fz
pdf_dict_put(ctx, form, PDF_NAME(Subtype), PDF_NAME(Form));
pdf_dict_put(ctx, form, PDF_NAME(Group), group_ref);
pdf_dict_put_int(ctx, form, PDF_NAME(FormType), 1);
- pdf_dict_put_rect(ctx, form, PDF_NAME(BBox), *bbox);
+ pdf_dict_put_rect(ctx, form, PDF_NAME(BBox), bbox);
*form_ref = pdf_add_object(ctx, doc, form);
}
fz_always(ctx)
@@ -662,7 +662,7 @@ pdf_dev_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const
}
static void
-pdf_dev_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, const fz_rect *scissor)
+pdf_dev_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, fz_rect scissor)
{
pdf_device *pdev = (pdf_device*)dev;
gstate *gs;
@@ -676,7 +676,7 @@ pdf_dev_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even
}
static void
-pdf_dev_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor)
+pdf_dev_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
pdf_device *pdev = (pdf_device*)dev;
gstate *gs;
@@ -731,7 +731,7 @@ pdf_dev_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const
}
static void
-pdf_dev_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor)
+pdf_dev_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, fz_rect scissor)
{
pdf_device *pdev = (pdf_device*)dev;
fz_text_span *span;
@@ -745,7 +745,7 @@ pdf_dev_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matri
}
static void
-pdf_dev_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor)
+pdf_dev_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
pdf_device *pdev = (pdf_device*)dev;
fz_text_span *span;
@@ -871,7 +871,7 @@ pdf_dev_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_mat
}
static void
-pdf_dev_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, const fz_rect *scissor)
+pdf_dev_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, fz_rect scissor)
{
pdf_device *pdev = (pdf_device*)dev;
@@ -891,7 +891,7 @@ pdf_dev_pop_clip(fz_context *ctx, fz_device *dev)
}
static void
-pdf_dev_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *bbox, int luminosity, fz_colorspace *colorspace, const float *color, const fz_color_params *color_params)
+pdf_dev_begin_mask(fz_context *ctx, fz_device *dev, fz_rect bbox, int luminosity, fz_colorspace *colorspace, const float *color, const fz_color_params *color_params)
{
pdf_device *pdev = (pdf_device*)dev;
pdf_document *doc = pdev->doc;
@@ -975,7 +975,7 @@ pdf_dev_end_mask(fz_context *ctx, fz_device *dev)
}
static void
-pdf_dev_begin_group(fz_context *ctx, fz_device *dev, const fz_rect *bbox, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
+pdf_dev_begin_group(fz_context *ctx, fz_device *dev, fz_rect bbox, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
{
pdf_device *pdev = (pdf_device*)dev;
pdf_document *doc = pdev->doc;
@@ -1029,7 +1029,7 @@ pdf_dev_end_group(fz_context *ctx, fz_device *dev)
}
static int
-pdf_dev_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix ctm, int id)
+pdf_dev_begin_tile(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm, int id)
{
pdf_device *pdev = (pdf_device*)dev;
@@ -1078,7 +1078,7 @@ pdf_dev_drop_device(fz_context *ctx, fz_device *dev)
fz_free(ctx, pdev->gstates);
}
-fz_device *pdf_new_pdf_device(fz_context *ctx, pdf_document *doc, fz_matrix topctm, const fz_rect *mediabox, pdf_obj *resources, fz_buffer *buf)
+fz_device *pdf_new_pdf_device(fz_context *ctx, pdf_document *doc, fz_matrix topctm, fz_rect mediabox, pdf_obj *resources, fz_buffer *buf)
{
pdf_device *dev = fz_new_derived_device(ctx, pdf_device);
@@ -1145,10 +1145,9 @@ fz_device *pdf_new_pdf_device(fz_context *ctx, pdf_document *doc, fz_matrix topc
return (fz_device*)dev;
}
-fz_device *pdf_page_write(fz_context *ctx, pdf_document *doc,
- const fz_rect *mediabox, pdf_obj **presources, fz_buffer **pcontents)
+fz_device *pdf_page_write(fz_context *ctx, pdf_document *doc, fz_rect mediabox, pdf_obj **presources, fz_buffer **pcontents)
{
- fz_matrix pagectm = { 1, 0, 0, -1, -mediabox->x0, mediabox->y1 };
+ fz_matrix pagectm = { 1, 0, 0, -1, -mediabox.x0, mediabox.y1 };
*presources = pdf_new_dict(ctx, doc, 0);
*pcontents = fz_new_buffer(ctx, 0);
return pdf_new_pdf_device(ctx, doc, pagectm, mediabox, *presources, *pcontents);
diff --git a/source/pdf/pdf-op-run.c b/source/pdf/pdf-op-run.c
index b08657a6..0bd4ec21 100644
--- a/source/pdf/pdf-op-run.c
+++ b/source/pdf/pdf-op-run.c
@@ -139,7 +139,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
fz_try(ctx)
{
- fz_begin_mask(ctx, pr->dev, &mask_bbox, gstate->luminosity, mask_colorspace, gstate->softmask_bc, &gstate->fill.color_params);
+ fz_begin_mask(ctx, pr->dev, mask_bbox, gstate->luminosity, mask_colorspace, gstate->softmask_bc, &gstate->fill.color_params);
pdf_run_xobject(ctx, pr, softmask, save->page_resources, fz_identity, 1);
}
fz_always(ctx)
@@ -177,7 +177,7 @@ end_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
}
static pdf_gstate *
-pdf_begin_group(fz_context *ctx, pdf_run_processor *pr, const fz_rect *bbox, softmask_save *softmask)
+pdf_begin_group(fz_context *ctx, pdf_run_processor *pr, fz_rect bbox, softmask_save *softmask)
{
pdf_gstate *gstate = begin_softmask(ctx, pr, softmask);
@@ -210,7 +210,7 @@ pdf_show_shade(fz_context *ctx, pdf_run_processor *pr, fz_shade *shd)
bbox = fz_bound_shade(ctx, shd, gstate->ctm);
- gstate = pdf_begin_group(ctx, pr, &bbox, &softmask);
+ gstate = pdf_begin_group(ctx, pr, bbox, &softmask);
/* FIXME: The gstate->ctm in the next line may be wrong; maybe
* it should be the parent gstates ctm? */
@@ -341,7 +341,7 @@ pdf_grestore(fz_context *ctx, pdf_run_processor *pr)
}
static void
-pdf_show_pattern(fz_context *ctx, pdf_run_processor *pr, pdf_pattern *pat, pdf_gstate *pat_gstate, const fz_rect *area, int what)
+pdf_show_pattern(fz_context *ctx, pdf_run_processor *pr, pdf_pattern *pat, pdf_gstate *pat_gstate, fz_rect area, int what)
{
pdf_gstate *gstate;
int gparent_save;
@@ -403,7 +403,7 @@ pdf_show_pattern(fz_context *ctx, pdf_run_processor *pr, pdf_pattern *pat, pdf_g
/* patterns are painted using the parent_ctm. area = bbox of
* shape to be filled in device space. Map it back to pattern
* space. */
- local_area = fz_transform_rect(*area, invptm);
+ local_area = fz_transform_rect(area, invptm);
fx0 = (local_area.x0 - pat->bbox.x0) / pat->xstep;
fy0 = (local_area.y0 - pat->bbox.y0) / pat->ystep;
@@ -428,7 +428,7 @@ pdf_show_pattern(fz_context *ctx, pdf_run_processor *pr, pdf_pattern *pat, pdf_g
if (0)
#endif
{
- int cached = fz_begin_tile_id(ctx, pr->dev, &local_area, &pat->bbox, pat->xstep, pat->ystep, ptm, id);
+ int cached = fz_begin_tile_id(ctx, pr->dev, local_area, pat->bbox, pat->xstep, pat->ystep, ptm, id);
if (cached)
{
fz_end_tile(ctx, pr->dev);
@@ -499,7 +499,7 @@ pdf_show_pattern(fz_context *ctx, pdf_run_processor *pr, pdf_pattern *pat, pdf_g
}
static void
-pdf_show_image_imp(fz_context *ctx, pdf_run_processor *pr, fz_image *image, fz_matrix image_ctm, fz_rect *bbox)
+pdf_show_image_imp(fz_context *ctx, pdf_run_processor *pr, fz_image *image, fz_matrix image_ctm, fz_rect bbox)
{
pdf_gstate *gstate = pr->gstate + pr->gtop;
@@ -552,10 +552,10 @@ pdf_show_image(fz_context *ctx, pdf_run_processor *pr, fz_image *image)
if (image->mask && gstate->blendmode)
{
/* apply blend group even though we skip the soft mask */
- fz_begin_group(ctx, pr->dev, &bbox, NULL, 0, 0, gstate->blendmode, 1);
+ fz_begin_group(ctx, pr->dev, bbox, NULL, 0, 0, gstate->blendmode, 1);
fz_try(ctx)
- fz_clip_image_mask(ctx, pr->dev, image->mask, image_ctm, &bbox);
+ fz_clip_image_mask(ctx, pr->dev, image->mask, image_ctm, bbox);
fz_catch(ctx)
{
fz_end_group(ctx, pr->dev);
@@ -563,7 +563,7 @@ pdf_show_image(fz_context *ctx, pdf_run_processor *pr, fz_image *image)
}
fz_try(ctx)
- pdf_show_image_imp(ctx, pr, image, image_ctm, &bbox);
+ pdf_show_image_imp(ctx, pr, image, image_ctm, bbox);
fz_always(ctx)
{
fz_pop_clip(ctx, pr->dev);
@@ -574,9 +574,9 @@ pdf_show_image(fz_context *ctx, pdf_run_processor *pr, fz_image *image)
}
else if (image->mask)
{
- fz_clip_image_mask(ctx, pr->dev, image->mask, image_ctm, &bbox);
+ fz_clip_image_mask(ctx, pr->dev, image->mask, image_ctm, bbox);
fz_try(ctx)
- pdf_show_image_imp(ctx, pr, image, image_ctm, &bbox);
+ pdf_show_image_imp(ctx, pr, image, image_ctm, bbox);
fz_always(ctx)
fz_pop_clip(ctx, pr->dev);
fz_catch(ctx)
@@ -586,10 +586,10 @@ pdf_show_image(fz_context *ctx, pdf_run_processor *pr, fz_image *image)
{
softmask_save softmask = { NULL };
- gstate = pdf_begin_group(ctx, pr, &bbox, &softmask);
+ gstate = pdf_begin_group(ctx, pr, bbox, &softmask);
fz_try(ctx)
- pdf_show_image_imp(ctx, pr, image, image_ctm, &bbox);
+ pdf_show_image_imp(ctx, pr, image, image_ctm, bbox);
fz_always(ctx)
pdf_end_group(ctx, pr, &softmask);
fz_catch(ctx)
@@ -633,7 +633,7 @@ pdf_show_path(fz_context *ctx, pdf_run_processor *pr, int doclose, int dofill, i
dostroke = dofill = 0;
if (dofill || dostroke)
- gstate = pdf_begin_group(ctx, pr, &bbox, &softmask);
+ gstate = pdf_begin_group(ctx, pr, bbox, &softmask);
if (dofill && dostroke)
{
@@ -649,7 +649,7 @@ pdf_show_path(fz_context *ctx, pdf_run_processor *pr, int doclose, int dofill, i
else
{
knockout_group = 1;
- fz_begin_group(ctx, pr->dev, &bbox, NULL, 0, 1, FZ_BLEND_NORMAL, 1);
+ fz_begin_group(ctx, pr->dev, bbox, NULL, 0, 1, FZ_BLEND_NORMAL, 1);
}
}
@@ -666,15 +666,15 @@ pdf_show_path(fz_context *ctx, pdf_run_processor *pr, int doclose, int dofill, i
case PDF_MAT_PATTERN:
if (gstate->fill.pattern)
{
- fz_clip_path(ctx, pr->dev, path, even_odd, gstate->ctm, &bbox);
- pdf_show_pattern(ctx, pr, gstate->fill.pattern, &pr->gstate[gstate->fill.gstate_num], &bbox, PDF_FILL);
+ fz_clip_path(ctx, pr->dev, path, even_odd, gstate->ctm, bbox);
+ pdf_show_pattern(ctx, pr, gstate->fill.pattern, &pr->gstate[gstate->fill.gstate_num], bbox, PDF_FILL);
fz_pop_clip(ctx, pr->dev);
}
break;
case PDF_MAT_SHADE:
if (gstate->fill.shade)
{
- fz_clip_path(ctx, pr->dev, path, even_odd, gstate->ctm, &bbox);
+ fz_clip_path(ctx, pr->dev, path, even_odd, gstate->ctm, bbox);
/* The cluster and page 2 of patterns.pdf shows that fz_fill_shade should NOT be called with gstate->ctm. */
fz_fill_shade(ctx, pr->dev, gstate->fill.shade, pr->gstate[gstate->fill.gstate_num].ctm, gstate->fill.alpha, &gstate->fill.color_params);
fz_pop_clip(ctx, pr->dev);
@@ -696,15 +696,15 @@ pdf_show_path(fz_context *ctx, pdf_run_processor *pr, int doclose, int dofill, i
case PDF_MAT_PATTERN:
if (gstate->stroke.pattern)
{
- fz_clip_stroke_path(ctx, pr->dev, path, gstate->stroke_state, gstate->ctm, &bbox);
- pdf_show_pattern(ctx, pr, gstate->stroke.pattern, &pr->gstate[gstate->stroke.gstate_num], &bbox, PDF_STROKE);
+ fz_clip_stroke_path(ctx, pr->dev, path, gstate->stroke_state, gstate->ctm, bbox);
+ pdf_show_pattern(ctx, pr, gstate->stroke.pattern, &pr->gstate[gstate->stroke.gstate_num], bbox, PDF_STROKE);
fz_pop_clip(ctx, pr->dev);
}
break;
case PDF_MAT_SHADE:
if (gstate->stroke.shade)
{
- fz_clip_stroke_path(ctx, pr->dev, path, gstate->stroke_state, gstate->ctm, &bbox);
+ fz_clip_stroke_path(ctx, pr->dev, path, gstate->stroke_state, gstate->ctm, bbox);
fz_fill_shade(ctx, pr->dev, gstate->stroke.shade, pr->gstate[gstate->stroke.gstate_num].ctm, gstate->stroke.alpha, &gstate->stroke.color_params);
fz_pop_clip(ctx, pr->dev);
}
@@ -722,7 +722,7 @@ pdf_show_path(fz_context *ctx, pdf_run_processor *pr, int doclose, int dofill, i
{
gstate = pr->gstate + pr->gtop; /* in case it was changed by pdf_begin_group */
gstate->clip_depth++;
- fz_clip_path(ctx, pr->dev, path, pr->clip_even_odd, gstate->ctm, &bbox);
+ fz_clip_path(ctx, pr->dev, path, pr->clip_even_odd, gstate->ctm, bbox);
pr->clip = 0;
}
}
@@ -783,7 +783,7 @@ pdf_flush_text(fz_context *ctx, pdf_run_processor *pr)
break;
if (dofill || dostroke)
- gstate = pdf_begin_group(ctx, pr, &tb, &softmask);
+ gstate = pdf_begin_group(ctx, pr, tb, &softmask);
if (dofill && dostroke)
{
@@ -799,7 +799,7 @@ pdf_flush_text(fz_context *ctx, pdf_run_processor *pr)
else
{
knockout_group = 1;
- fz_begin_group(ctx, pr->dev, &tb, NULL, 0, 1, FZ_BLEND_NORMAL, 1);
+ fz_begin_group(ctx, pr->dev, tb, NULL, 0, 1, FZ_BLEND_NORMAL, 1);
}
}
@@ -819,15 +819,15 @@ pdf_flush_text(fz_context *ctx, pdf_run_processor *pr)
case PDF_MAT_PATTERN:
if (gstate->fill.pattern)
{
- fz_clip_text(ctx, pr->dev, text, gstate->ctm, &tb);
- pdf_show_pattern(ctx, pr, gstate->fill.pattern, &pr->gstate[gstate->fill.gstate_num], &tb, PDF_FILL);
+ fz_clip_text(ctx, pr->dev, text, gstate->ctm, tb);
+ pdf_show_pattern(ctx, pr, gstate->fill.pattern, &pr->gstate[gstate->fill.gstate_num], tb, PDF_FILL);
fz_pop_clip(ctx, pr->dev);
}
break;
case PDF_MAT_SHADE:
if (gstate->fill.shade)
{
- fz_clip_text(ctx, pr->dev, text, gstate->ctm, &tb);
+ fz_clip_text(ctx, pr->dev, text, gstate->ctm, tb);
/* Page 2 of patterns.pdf shows that fz_fill_shade should NOT be called with gstate->ctm */
fz_fill_shade(ctx, pr->dev, gstate->fill.shade, pr->gstate[gstate->fill.gstate_num].ctm, gstate->fill.alpha, &gstate->fill.color_params);
fz_pop_clip(ctx, pr->dev);
@@ -849,15 +849,15 @@ pdf_flush_text(fz_context *ctx, pdf_run_processor *pr)
case PDF_MAT_PATTERN:
if (gstate->stroke.pattern)
{
- fz_clip_stroke_text(ctx, pr->dev, text, gstate->stroke_state, gstate->ctm, &tb);
- pdf_show_pattern(ctx, pr, gstate->stroke.pattern, &pr->gstate[gstate->stroke.gstate_num], &tb, PDF_STROKE);
+ fz_clip_stroke_text(ctx, pr->dev, text, gstate->stroke_state, gstate->ctm, tb);
+ pdf_show_pattern(ctx, pr, gstate->stroke.pattern, &pr->gstate[gstate->stroke.gstate_num], tb, PDF_STROKE);
fz_pop_clip(ctx, pr->dev);
}
break;
case PDF_MAT_SHADE:
if (gstate->stroke.shade)
{
- fz_clip_stroke_text(ctx, pr->dev, text, gstate->stroke_state, gstate->ctm, &tb);
+ fz_clip_stroke_text(ctx, pr->dev, text, gstate->stroke_state, gstate->ctm, tb);
fz_fill_shade(ctx, pr->dev, gstate->stroke.shade, pr->gstate[gstate->stroke.gstate_num].ctm, gstate->stroke.alpha, &gstate->stroke.color_params);
fz_pop_clip(ctx, pr->dev);
}
@@ -874,7 +874,7 @@ pdf_flush_text(fz_context *ctx, pdf_run_processor *pr)
if (doclip)
{
gstate->clip_depth++;
- fz_clip_text(ctx, pr->dev, text, gstate->ctm, &tb);
+ fz_clip_text(ctx, pr->dev, text, gstate->ctm, tb);
}
}
fz_always(ctx)
@@ -1253,7 +1253,7 @@ pdf_run_xobject(fz_context *ctx, pdf_run_processor *proc, pdf_obj *xobj, pdf_obj
cleanup_state = 2;
if (isolated)
cs = pdf_xobject_colorspace(ctx, xobj);
- fz_begin_group(ctx, pr->dev, &bbox,
+ fz_begin_group(ctx, pr->dev, bbox,
cs,
(is_smask ? 1 : isolated),
pdf_xobject_knockout(ctx, xobj),
diff --git a/source/pdf/pdf-run.c b/source/pdf/pdf-run.c
index ae936253..5e4badf3 100644
--- a/source/pdf/pdf-run.c
+++ b/source/pdf/pdf-run.c
@@ -78,7 +78,7 @@ pdf_run_page_contents_with_usage(fz_context *ctx, pdf_document *doc, pdf_page *p
else
colorspace = fz_keep_colorspace(ctx, fz_default_output_intent(ctx, default_cs));
- fz_begin_group(ctx, dev, &mediabox, colorspace, 1, 0, 0, 1);
+ fz_begin_group(ctx, dev, mediabox, colorspace, 1, 0, 0, 1);
fz_drop_colorspace(ctx, colorspace);
colorspace = NULL;
}
diff --git a/source/pdf/pdf-write.c b/source/pdf/pdf-write.c
index 63863104..f1f49299 100644
--- a/source/pdf/pdf-write.c
+++ b/source/pdf/pdf-write.c
@@ -3286,11 +3286,11 @@ struct pdf_writer_s
};
static fz_device *
-pdf_writer_begin_page(fz_context *ctx, fz_document_writer *wri_, const fz_rect *mediabox)
+pdf_writer_begin_page(fz_context *ctx, fz_document_writer *wri_, fz_rect mediabox)
{
pdf_writer *wri = (pdf_writer*)wri_;
- wri->mediabox = *mediabox;
- return pdf_page_write(ctx, wri->pdf, &wri->mediabox, &wri->resources, &wri->contents);
+ wri->mediabox = mediabox;
+ return pdf_page_write(ctx, wri->pdf, wri->mediabox, &wri->resources, &wri->contents);
}
static void
diff --git a/source/tools/muconvert.c b/source/tools/muconvert.c
index e68a77c7..4a0e99de 100644
--- a/source/tools/muconvert.c
+++ b/source/tools/muconvert.c
@@ -76,7 +76,7 @@ static void runpage(int number)
fz_try(ctx)
{
mediabox = fz_bound_page(ctx, page);
- dev = fz_begin_page(ctx, out, &mediabox);
+ dev = fz_begin_page(ctx, out, mediabox);
fz_run_page(ctx, page, dev, fz_identity, NULL);
}
fz_always(ctx)
diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c
index 828db0d0..cbd605b7 100644
--- a/source/tools/mudraw.c
+++ b/source/tools/mudraw.c
@@ -461,7 +461,7 @@ file_level_trailers(fz_context *ctx)
}
-static void drawband(fz_context *ctx, fz_page *page, fz_display_list *list, fz_matrix ctm, const fz_rect *tbounds, fz_cookie *cookie, int band_start, fz_pixmap *pix, fz_bitmap **bit)
+static void drawband(fz_context *ctx, fz_page *page, fz_display_list *list, fz_matrix ctm, fz_rect tbounds, fz_cookie *cookie, int band_start, fz_pixmap *pix, fz_bitmap **bit)
{
fz_device *dev = NULL;
@@ -538,7 +538,7 @@ static void dodrawpage(fz_context *ctx, fz_page *page, fz_display_list *list, in
if (lowmemory)
fz_enable_device_hints(ctx, dev, FZ_NO_CACHE);
if (list)
- fz_run_display_list(ctx, list, dev, fz_identity, &fz_infinite_rect, cookie);
+ fz_run_display_list(ctx, list, dev, fz_identity, fz_infinite_rect, cookie);
else
fz_run_page(ctx, page, dev, fz_identity, cookie);
fz_write_printf(ctx, out, "</page>\n");
@@ -578,7 +578,7 @@ static void dodrawpage(fz_context *ctx, fz_page *page, fz_display_list *list, in
if (lowmemory)
fz_enable_device_hints(ctx, dev, FZ_NO_CACHE);
if (list)
- fz_run_display_list(ctx, list, dev, ctm, &fz_infinite_rect, cookie);
+ fz_run_display_list(ctx, list, dev, ctm, fz_infinite_rect, cookie);
else
fz_run_page(ctx, page, dev, ctm, cookie);
fz_close_device(ctx, dev);
@@ -629,9 +629,9 @@ static void dodrawpage(fz_context *ctx, fz_page *page, fz_display_list *list, in
{
pdf_obj *page_obj;
- dev = pdf_page_write(ctx, pdfout, &mediabox, &resources, &contents);
+ dev = pdf_page_write(ctx, pdfout, mediabox, &resources, &contents);
if (list)
- fz_run_display_list(ctx, list, dev, fz_identity, NULL, cookie);
+ fz_run_display_list(ctx, list, dev, fz_identity, fz_infinite_rect, cookie);
else
fz_run_page(ctx, page, dev, fz_identity, cookie);
fz_close_device(ctx, dev);
@@ -686,7 +686,7 @@ static void dodrawpage(fz_context *ctx, fz_page *page, fz_display_list *list, in
if (lowmemory)
fz_enable_device_hints(ctx, dev, FZ_NO_CACHE);
if (list)
- fz_run_display_list(ctx, list, dev, ctm, &tbounds, cookie);
+ fz_run_display_list(ctx, list, dev, ctm, tbounds, cookie);
else
fz_run_page(ctx, page, dev, ctm, cookie);
fz_close_device(ctx, dev);
@@ -880,7 +880,7 @@ static void dodrawpage(fz_context *ctx, fz_page *page, fz_display_list *list, in
cookie->errors += w->cookie.errors;
}
else
- drawband(ctx, page, list, ctm, &tbounds, cookie, band * band_height, pix, &bit);
+ drawband(ctx, page, list, ctm, tbounds, cookie, band * band_height, pix, &bit);
if (output)
{
@@ -1115,7 +1115,7 @@ static void drawpage(fz_context *ctx, fz_document *doc, int pagenum)
fz_try(ctx)
{
if (list)
- fz_run_display_list(ctx, list, dev, fz_identity, &fz_infinite_rect, NULL);
+ fz_run_display_list(ctx, list, dev, fz_identity, fz_infinite_rect, NULL);
else
fz_run_page(ctx, page, dev, fz_identity, &cookie);
fz_close_device(ctx, dev);
@@ -1314,7 +1314,7 @@ static void worker_thread(void *arg)
mu_wait_semaphore(&me->start);
DEBUG_THREADS(("Worker %d woken for band %d\n", me->num, me->band));
if (me->band >= 0)
- drawband(me->ctx, NULL, me->list, me->ctm, &me->tbounds, &me->cookie, me->band * band_height, me->pix, &me->bit);
+ drawband(me->ctx, NULL, me->list, me->ctm, me->tbounds, &me->cookie, me->band * band_height, me->pix, &me->bit);
DEBUG_THREADS(("Worker %d completed band %d\n", me->num, me->band));
mu_trigger_semaphore(&me->stop);
}
diff --git a/source/tools/muraster.c b/source/tools/muraster.c
index 71e8dead..628229ae 100644
--- a/source/tools/muraster.c
+++ b/source/tools/muraster.c
@@ -522,7 +522,7 @@ static int gettime(void)
return (now.tv_sec - first.tv_sec) * 1000 + (now.tv_usec - first.tv_usec) / 1000;
}
-static int drawband(fz_context *ctx, fz_page *page, fz_display_list *list, fz_matrix ctm, const fz_rect *tbounds, fz_cookie *cookie, int band_start, fz_pixmap *pix, fz_bitmap **bit)
+static int drawband(fz_context *ctx, fz_page *page, fz_display_list *list, fz_matrix ctm, fz_rect tbounds, fz_cookie *cookie, int band_start, fz_pixmap *pix, fz_bitmap **bit)
{
fz_device *dev = NULL;
diff --git a/source/tools/murun.c b/source/tools/murun.c
index b2a12484..c6ad673f 100644
--- a/source/tools/murun.c
+++ b/source/tools/murun.c
@@ -835,7 +835,7 @@ js_dev_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_
static void
js_dev_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm,
- const fz_rect *scissor)
+ fz_rect scissor)
{
js_State *J = ((js_device*)dev)->J;
if (js_try(J))
@@ -874,7 +874,7 @@ js_dev_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path,
static void
js_dev_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke,
- fz_matrix ctm, const fz_rect *scissor)
+ fz_matrix ctm, fz_rect scissor)
{
js_State *J = ((js_device*)dev)->J;
if (js_try(J))
@@ -930,7 +930,7 @@ js_dev_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const f
}
static void
-js_dev_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor)
+js_dev_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, fz_rect scissor)
{
js_State *J = ((js_device*)dev)->J;
if (js_try(J))
@@ -947,7 +947,7 @@ js_dev_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix
static void
js_dev_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke,
- fz_matrix ctm, const fz_rect *scissor)
+ fz_matrix ctm, fz_rect scissor)
{
js_State *J = ((js_device*)dev)->J;
if (js_try(J))
@@ -1035,7 +1035,7 @@ js_dev_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matr
}
static void
-js_dev_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, const fz_rect *scissor)
+js_dev_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, fz_rect scissor)
{
js_State *J = ((js_device*)dev)->J;
if (js_try(J))
@@ -1065,7 +1065,7 @@ js_dev_pop_clip(fz_context *ctx, fz_device *dev)
}
static void
-js_dev_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *bbox, int luminosity,
+js_dev_begin_mask(fz_context *ctx, fz_device *dev, fz_rect bbox, int luminosity,
fz_colorspace *colorspace, const float *color, const fz_color_params *color_params)
{
js_State *J = ((js_device*)dev)->J;
@@ -1073,7 +1073,7 @@ js_dev_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *bbox, int lumi
rethrow_as_fz(J);
if (js_hasproperty(J, -1, "beginMask")) {
js_copy(J, -2);
- ffi_pushrect(J, *bbox);
+ ffi_pushrect(J, bbox);
js_pushboolean(J, luminosity);
ffi_pushcolor(J, colorspace, color, 1);
ffi_pushcolorparams(J, color_params);
@@ -1098,7 +1098,7 @@ js_dev_end_mask(fz_context *ctx, fz_device *dev)
}
static void
-js_dev_begin_group(fz_context *ctx, fz_device *dev, const fz_rect *bbox,
+js_dev_begin_group(fz_context *ctx, fz_device *dev, fz_rect bbox,
fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
{
js_State *J = ((js_device*)dev)->J;
@@ -1106,7 +1106,7 @@ js_dev_begin_group(fz_context *ctx, fz_device *dev, const fz_rect *bbox,
rethrow_as_fz(J);
if (js_hasproperty(J, -1, "beginGroup")) {
js_copy(J, -2);
- ffi_pushrect(J, *bbox);
+ ffi_pushrect(J, bbox);
js_pushboolean(J, isolated);
js_pushboolean(J, knockout);
js_pushliteral(J, fz_blendmode_name(blendmode));
@@ -1132,7 +1132,7 @@ js_dev_end_group(fz_context *ctx, fz_device *dev)
}
static int
-js_dev_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz_rect *view,
+js_dev_begin_tile(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view,
float xstep, float ystep, fz_matrix ctm, int id)
{
js_State *J = ((js_device*)dev)->J;
@@ -1141,8 +1141,8 @@ js_dev_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz
if (js_hasproperty(J, -1, "beginTile")) {
int n;
js_copy(J, -2);
- ffi_pushrect(J, *area);
- ffi_pushrect(J, *view);
+ ffi_pushrect(J, area);
+ ffi_pushrect(J, view);
js_pushnumber(J, xstep);
js_pushnumber(J, ystep);
ffi_pushmatrix(J, ctm);
@@ -1286,7 +1286,7 @@ static void ffi_Device_clipPath(js_State *J)
int even_odd = js_toboolean(J, 2);
fz_matrix ctm = ffi_tomatrix(J, 3);
fz_try(ctx)
- fz_clip_path(ctx, dev, path, even_odd, ctm, NULL);
+ fz_clip_path(ctx, dev, path, even_odd, ctm, fz_infinite_rect);
fz_catch(ctx)
rethrow(J);
}
@@ -1299,7 +1299,7 @@ static void ffi_Device_clipStrokePath(js_State *J)
fz_stroke_state stroke = ffi_tostroke(J, 2);
fz_matrix ctm = ffi_tomatrix(J, 3);
fz_try(ctx)
- fz_clip_stroke_path(ctx, dev, path, &stroke, ctm, NULL);
+ fz_clip_stroke_path(ctx, dev, path, &stroke, ctm, fz_infinite_rect);
fz_catch(ctx)
rethrow(J);
}
@@ -1340,7 +1340,7 @@ static void ffi_Device_clipText(js_State *J)
fz_text *text = js_touserdata(J, 1, "fz_text");
fz_matrix ctm = ffi_tomatrix(J, 2);
fz_try(ctx)
- fz_clip_text(ctx, dev, text, ctm, NULL);
+ fz_clip_text(ctx, dev, text, ctm, fz_infinite_rect);
fz_catch(ctx)
rethrow(J);
}
@@ -1353,7 +1353,7 @@ static void ffi_Device_clipStrokeText(js_State *J)
fz_stroke_state stroke = ffi_tostroke(J, 2);
fz_matrix ctm = ffi_tomatrix(J, 3);
fz_try(ctx)
- fz_clip_stroke_text(ctx, dev, text, &stroke, ctm, NULL);
+ fz_clip_stroke_text(ctx, dev, text, &stroke, ctm, fz_infinite_rect);
fz_catch(ctx)
rethrow(J);
}
@@ -1419,7 +1419,7 @@ static void ffi_Device_clipImageMask(js_State *J)
fz_image *image = js_touserdata(J, 1, "fz_image");
fz_matrix ctm = ffi_tomatrix(J, 2);
fz_try(ctx)
- fz_clip_image_mask(ctx, dev, image, ctm, NULL);
+ fz_clip_image_mask(ctx, dev, image, ctm, fz_infinite_rect);
fz_catch(ctx)
rethrow(J);
}
@@ -1443,7 +1443,7 @@ static void ffi_Device_beginMask(js_State *J)
struct color c = ffi_tocolor(J, 3);
fz_color_params *color_params = ffi_tocolorparams(J, 6);
fz_try(ctx)
- fz_begin_mask(ctx, dev, &area, luminosity, c.colorspace, c.color, color_params);
+ fz_begin_mask(ctx, dev, area, luminosity, c.colorspace, c.color, color_params);
fz_catch(ctx)
rethrow(J);
}
@@ -1468,7 +1468,7 @@ static void ffi_Device_beginGroup(js_State *J)
int blendmode = fz_lookup_blendmode(js_tostring(J, 4));
float alpha = js_tonumber(J, 5);
fz_try(ctx)
- fz_begin_group(ctx, dev, &area, NULL, isolated, knockout, blendmode, alpha);
+ fz_begin_group(ctx, dev, area, NULL, isolated, knockout, blendmode, alpha);
fz_catch(ctx)
rethrow(J);
}
@@ -1495,7 +1495,7 @@ static void ffi_Device_beginTile(js_State *J)
int id = js_tonumber(J, 6);
int n = 0;
fz_try(ctx)
- n = fz_begin_tile_id(ctx, dev, &area, &view, xstep, ystep, ctm, id);
+ n = fz_begin_tile_id(ctx, dev, area, view, xstep, ystep, ctm, id);
fz_catch(ctx)
rethrow(J);
js_pushnumber(J, n);
@@ -2731,14 +2731,14 @@ static void ffi_DisplayList_run(js_State *J)
if (js_isuserdata(J, 1, "fz_device")) {
device = js_touserdata(J, 1, "fz_device");
fz_try(ctx)
- fz_run_display_list(ctx, list, device, ctm, NULL, NULL);
+ fz_run_display_list(ctx, list, device, ctm, fz_infinite_rect, NULL);
fz_catch(ctx)
rethrow(J);
} else {
device = new_js_device(ctx, J);
js_copy(J, 1);
fz_try(ctx) {
- fz_run_display_list(ctx, list, device, ctm, NULL, NULL);
+ fz_run_display_list(ctx, list, device, ctm, fz_infinite_rect, NULL);
fz_close_device(ctx, device);
}
fz_always(ctx)
@@ -2923,7 +2923,7 @@ static void ffi_DocumentWriter_beginPage(js_State *J)
fz_device *device = NULL;
fz_try(ctx)
- device = fz_begin_page(ctx, wri, &mediabox);
+ device = fz_begin_page(ctx, wri, mediabox);
fz_catch(ctx)
rethrow(J);
diff --git a/source/tools/mutrace.c b/source/tools/mutrace.c
index c9e988b9..5d179b36 100644
--- a/source/tools/mutrace.c
+++ b/source/tools/mutrace.c
@@ -51,7 +51,7 @@ static void runpage(fz_context *ctx, fz_document *doc, int number)
if (use_display_list)
{
list = fz_new_display_list_from_page(ctx, page);
- fz_run_display_list(ctx, list, dev, fz_identity, NULL, NULL);
+ fz_run_display_list(ctx, list, dev, fz_identity, fz_infinite_rect, NULL);
}
else
{
diff --git a/source/tools/pdfposter.c b/source/tools/pdfposter.c
index 387d8cae..1ec70460 100644
--- a/source/tools/pdfposter.c
+++ b/source/tools/pdfposter.c
@@ -23,7 +23,7 @@ static void usage(void)
}
static void
-intersect_box(fz_context *ctx, pdf_document *doc, pdf_obj *page, pdf_obj *box_name, const fz_rect *mb)
+intersect_box(fz_context *ctx, pdf_document *doc, pdf_obj *page, pdf_obj *box_name, fz_rect mb)
{
pdf_obj *box = pdf_dict_get(ctx, page, box_name);
pdf_obj *newbox;
@@ -37,14 +37,14 @@ intersect_box(fz_context *ctx, pdf_document *doc, pdf_obj *page, pdf_obj *box_na
old_rect.x1 = pdf_array_get_real(ctx, box, 2);
old_rect.y1 = pdf_array_get_real(ctx, box, 3);
- if (old_rect.x0 < mb->x0)
- old_rect.x0 = mb->x0;
- if (old_rect.y0 < mb->y0)
- old_rect.y0 = mb->y0;
- if (old_rect.x1 > mb->x1)
- old_rect.x1 = mb->x1;
- if (old_rect.y1 > mb->y1)
- old_rect.y1 = mb->y1;
+ if (old_rect.x0 < mb.x0)
+ old_rect.x0 = mb.x0;
+ if (old_rect.y0 < mb.y0)
+ old_rect.y0 = mb.y0;
+ if (old_rect.x1 > mb.x1)
+ old_rect.x1 = mb.x1;
+ if (old_rect.y1 > mb.y1)
+ old_rect.y1 = mb.y1;
newbox = pdf_new_array(ctx, doc, 4);
pdf_array_push_real(ctx, newbox, old_rect.x0);
@@ -139,10 +139,10 @@ static void decimatepages(fz_context *ctx, pdf_document *doc)
pdf_dict_put(ctx, newpageobj, PDF_NAME(Parent), pages);
pdf_dict_put_drop(ctx, newpageobj, PDF_NAME(MediaBox), newmediabox);
- intersect_box(ctx, doc, newpageobj, PDF_NAME(CropBox), &mb);
- intersect_box(ctx, doc, newpageobj, PDF_NAME(BleedBox), &mb);
- intersect_box(ctx, doc, newpageobj, PDF_NAME(TrimBox), &mb);
- intersect_box(ctx, doc, newpageobj, PDF_NAME(ArtBox), &mb);
+ intersect_box(ctx, doc, newpageobj, PDF_NAME(CropBox), mb);
+ intersect_box(ctx, doc, newpageobj, PDF_NAME(BleedBox), mb);
+ intersect_box(ctx, doc, newpageobj, PDF_NAME(TrimBox), mb);
+ intersect_box(ctx, doc, newpageobj, PDF_NAME(ArtBox), mb);
/* Store page object in new kids array */
pdf_drop_obj(ctx, newpageobj);
diff --git a/source/xps/xps-common.c b/source/xps/xps-common.c
index 75baa2bf..0e895885 100644
--- a/source/xps/xps-common.c
+++ b/source/xps/xps-common.c
@@ -109,7 +109,7 @@ xps_begin_opacity(fz_context *ctx, xps_document *doc, fz_matrix ctm, fz_rect are
if (opacity_mask_tag)
{
- fz_begin_mask(ctx, dev, &area, 0, NULL, NULL, NULL);
+ fz_begin_mask(ctx, dev, area, 0, NULL, NULL, NULL);
xps_parse_brush(ctx, doc, ctm, area, base_uri, dict, opacity_mask_tag);
fz_end_mask(ctx, dev);
}
diff --git a/source/xps/xps-glyphs.c b/source/xps/xps-glyphs.c
index de9b4f45..75d49e68 100644
--- a/source/xps/xps-glyphs.c
+++ b/source/xps/xps-glyphs.c
@@ -613,7 +613,7 @@ xps_parse_glyphs(fz_context *ctx, xps_document *doc, fz_matrix ctm,
if (fill_tag)
{
- fz_clip_text(ctx, dev, text, ctm, &area);
+ fz_clip_text(ctx, dev, text, ctm, area);
xps_parse_brush(ctx, doc, ctm, area, fill_uri, dict, fill_tag);
fz_pop_clip(ctx, dev);
}
diff --git a/source/xps/xps-path.c b/source/xps/xps-path.c
index 42ecd2b1..d1d80b23 100644
--- a/source/xps/xps-path.c
+++ b/source/xps/xps-path.c
@@ -767,7 +767,7 @@ xps_clip(fz_context *ctx, xps_document *doc, fz_matrix ctm, xps_resource *dict,
path = xps_parse_path_geometry(ctx, doc, dict, clip_tag, 0, &fill_rule);
else
path = fz_new_path(ctx);
- fz_clip_path(ctx, dev, path, fill_rule == 0, ctm, NULL);
+ fz_clip_path(ctx, dev, path, fill_rule == 0, ctm, fz_infinite_rect);
fz_drop_path(ctx, path);
}
@@ -1007,7 +1007,7 @@ xps_parse_path(fz_context *ctx, xps_document *doc, fz_matrix ctm, char *base_uri
if (fill_tag)
{
- fz_clip_path(ctx, dev, path, fill_rule == 0, ctm, &area);
+ fz_clip_path(ctx, dev, path, fill_rule == 0, ctm, area);
xps_parse_brush(ctx, doc, ctm, area, fill_uri, dict, fill_tag);
fz_pop_clip(ctx, dev);
}
@@ -1024,7 +1024,7 @@ xps_parse_path(fz_context *ctx, xps_document *doc, fz_matrix ctm, char *base_uri
if (stroke_tag)
{
- fz_clip_stroke_path(ctx, dev, stroke_path, stroke, ctm, &area);
+ fz_clip_stroke_path(ctx, dev, stroke_path, stroke, ctm, area);
xps_parse_brush(ctx, doc, ctm, area, stroke_uri, dict, stroke_tag);
fz_pop_clip(ctx, dev);
}
diff --git a/source/xps/xps-tile.c b/source/xps/xps-tile.c
index 83903dd2..7def81c9 100644
--- a/source/xps/xps-tile.c
+++ b/source/xps/xps-tile.c
@@ -33,7 +33,7 @@ xps_paint_tiling_brush_clipped(fz_context *ctx, xps_document *doc, fz_matrix ctm
fz_lineto(ctx, path, viewbox.x1, viewbox.y1);
fz_lineto(ctx, path, viewbox.x1, viewbox.y0);
fz_closepath(ctx, path);
- fz_clip_path(ctx, dev, path, 0, ctm, NULL);
+ fz_clip_path(ctx, dev, path, 0, ctm, fz_infinite_rect);
fz_drop_path(ctx, path);
c->func(ctx, doc, ctm, viewbox, c->base_uri, c->dict, c->root, c->user);
fz_pop_clip(ctx, dev);
@@ -183,7 +183,7 @@ xps_parse_tiling_brush(fz_context *ctx, xps_document *doc, fz_matrix ctm, fz_rec
fz_rect bigview = viewbox;
bigview.x1 = bigview.x0 + xstep;
bigview.y1 = bigview.y0 + ystep;
- fz_begin_tile(ctx, dev, &area, &bigview, xstep, ystep, ctm);
+ fz_begin_tile(ctx, dev, area, bigview, xstep, ystep, ctm);
xps_paint_tiling_brush(ctx, doc, ctm, viewbox, tile_mode, &c);
fz_end_tile(ctx, dev);
}