diff options
Diffstat (limited to 'source/fitz')
-rw-r--r-- | source/fitz/bbox-device.c | 52 | ||||
-rw-r--r-- | source/fitz/colorspace.c | 4 | ||||
-rw-r--r-- | source/fitz/device.c | 40 | ||||
-rw-r--r-- | source/fitz/document.c | 6 | ||||
-rw-r--r-- | source/fitz/draw-affine.c | 43 | ||||
-rw-r--r-- | source/fitz/draw-device.c | 110 | ||||
-rw-r--r-- | source/fitz/draw-glyph.c | 16 | ||||
-rw-r--r-- | source/fitz/draw-imp.h | 38 | ||||
-rw-r--r-- | source/fitz/draw-mesh.c | 4 | ||||
-rw-r--r-- | source/fitz/draw-path.c | 98 | ||||
-rw-r--r-- | source/fitz/draw-unpack.c | 2 | ||||
-rw-r--r-- | source/fitz/font-imp.h | 2 | ||||
-rw-r--r-- | source/fitz/font.c | 121 | ||||
-rw-r--r-- | source/fitz/glyph-cache-imp.h | 20 | ||||
-rw-r--r-- | source/fitz/halftone.c | 8 | ||||
-rw-r--r-- | source/fitz/image.c | 6 | ||||
-rw-r--r-- | source/fitz/list-device.c | 116 | ||||
-rw-r--r-- | source/fitz/paint-glyph.h | 4 | ||||
-rw-r--r-- | source/fitz/stext-device.c | 38 | ||||
-rw-r--r-- | source/fitz/svg-device.c | 147 | ||||
-rw-r--r-- | source/fitz/test-device.c | 30 | ||||
-rw-r--r-- | source/fitz/text.c | 12 | ||||
-rw-r--r-- | source/fitz/trace-device.c | 33 | ||||
-rw-r--r-- | source/fitz/util.c | 36 |
24 files changed, 490 insertions, 496 deletions
diff --git a/source/fitz/bbox-device.c b/source/fitz/bbox-device.c index 7238936a..9492a2da 100644 --- a/source/fitz/bbox-device.c +++ b/source/fitz/bbox-device.c @@ -35,80 +35,80 @@ fz_bbox_add_rect(fz_context *ctx, fz_device *dev, fz_rect rect, int clip) } static void -fz_bbox_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const fz_matrix *ctm, +fz_bbox_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) { - fz_bbox_add_rect(ctx, dev, fz_bound_path(ctx, path, NULL, *ctm), 0); + fz_bbox_add_rect(ctx, dev, fz_bound_path(ctx, path, NULL, ctm), 0); } static void fz_bbox_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, - const fz_matrix *ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params) + fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params) { - fz_bbox_add_rect(ctx, dev, fz_bound_path(ctx, path, stroke, *ctm), 0); + fz_bbox_add_rect(ctx, dev, fz_bound_path(ctx, path, stroke, ctm), 0); } static void -fz_bbox_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm, +fz_bbox_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) { - fz_bbox_add_rect(ctx, dev, fz_bound_text(ctx, text, NULL, *ctm), 0); + fz_bbox_add_rect(ctx, dev, fz_bound_text(ctx, text, NULL, ctm), 0); } static void fz_bbox_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, - const fz_matrix *ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params) + fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params) { - fz_bbox_add_rect(ctx, dev, fz_bound_text(ctx, text, stroke, *ctm), 0); + fz_bbox_add_rect(ctx, dev, fz_bound_text(ctx, text, stroke, ctm), 0); } static void -fz_bbox_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha, const fz_color_params *color_params) +fz_bbox_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, fz_matrix ctm, float alpha, const fz_color_params *color_params) { - fz_bbox_add_rect(ctx, dev, fz_bound_shade(ctx, shade, *ctm), 0); + fz_bbox_add_rect(ctx, dev, fz_bound_shade(ctx, shade, ctm), 0); } static void -fz_bbox_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha, const fz_color_params *color_params) +fz_bbox_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, float alpha, const fz_color_params *color_params) { - fz_bbox_add_rect(ctx, dev, fz_transform_rect(fz_unit_rect, *ctm), 0); + fz_bbox_add_rect(ctx, dev, fz_transform_rect(fz_unit_rect, ctm), 0); } static void -fz_bbox_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, +fz_bbox_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) { - fz_bbox_add_rect(ctx, dev, fz_transform_rect(fz_unit_rect, *ctm), 0); + fz_bbox_add_rect(ctx, dev, fz_transform_rect(fz_unit_rect, ctm), 0); } static void -fz_bbox_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const 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, const fz_rect *scissor) { - fz_bbox_add_rect(ctx, dev, fz_bound_path(ctx, path, NULL, *ctm), 1); + 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, const 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, const fz_rect *scissor) { - fz_bbox_add_rect(ctx, dev, fz_bound_path(ctx, path, stroke, *ctm), 1); + 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, const fz_matrix *ctm, const fz_rect *scissor) +fz_bbox_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor) { - fz_bbox_add_rect(ctx, dev, fz_bound_text(ctx, text, NULL, *ctm), 1); + 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, const 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, const fz_rect *scissor) { - fz_bbox_add_rect(ctx, dev, fz_bound_text(ctx, text, stroke, *ctm), 1); + 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, const fz_matrix *ctm, const fz_rect *scissor) +fz_bbox_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, const fz_rect *scissor) { - fz_bbox_add_rect(ctx, dev, fz_transform_rect(fz_unit_rect, *ctm), 1); + fz_bbox_add_rect(ctx, dev, fz_transform_rect(fz_unit_rect, ctm), 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, const fz_matrix *ctm, int id) +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_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/colorspace.c b/source/fitz/colorspace.c index 54435743..eee90f46 100644 --- a/source/fitz/colorspace.c +++ b/source/fitz/colorspace.c @@ -2130,8 +2130,8 @@ fast_cmyk_to_rgb_ARM(unsigned char *dst, unsigned char *src, int n) } #endif -static inline void cached_cmyk_conv(unsigned char *FZ_RESTRICT const pr, unsigned char *FZ_RESTRICT const pg, unsigned char *FZ_RESTRICT const pb, - unsigned int *FZ_RESTRICT const C, unsigned int *FZ_RESTRICT const M, unsigned int *FZ_RESTRICT const Y, unsigned int *FZ_RESTRICT const K, +static inline void cached_cmyk_conv(unsigned char * FZ_RESTRICT pr, unsigned char * FZ_RESTRICT pg, unsigned char * FZ_RESTRICT pb, + unsigned int * FZ_RESTRICT C, unsigned int * FZ_RESTRICT M, unsigned int * FZ_RESTRICT Y, unsigned int * FZ_RESTRICT K, unsigned int c, unsigned int m, unsigned int y, unsigned int k) { #ifdef SLOWCMYK diff --git a/source/fitz/device.c b/source/fitz/device.c index 2cc4a2e7..cad71a6a 100644 --- a/source/fitz/device.c +++ b/source/fitz/device.c @@ -114,7 +114,7 @@ pop_clip_stack(fz_context *ctx, fz_device *dev) } void -fz_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const fz_matrix *ctm, +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) { if (dev->error_depth) @@ -124,7 +124,7 @@ fz_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, } void -fz_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, +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) { if (dev->error_depth) @@ -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, const 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, const fz_rect *scissor) { if (dev->error_depth) { @@ -148,7 +148,7 @@ fz_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, { if (scissor == NULL) { - fz_rect bbox = fz_bound_path(ctx, path, NULL, *ctm); + fz_rect bbox = fz_bound_path(ctx, path, NULL, ctm); push_clip_stack(ctx, dev, &bbox, fz_device_container_stack_is_clip_path); } else @@ -166,7 +166,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, const 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, const fz_rect *scissor) { if (dev->error_depth) { @@ -180,7 +180,7 @@ fz_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const { if (scissor == NULL) { - fz_rect bbox = fz_bound_path(ctx, path, stroke, *ctm); + 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 @@ -198,7 +198,7 @@ fz_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const } void -fz_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm, +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) { if (dev->error_depth) @@ -208,7 +208,7 @@ fz_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matr } void -fz_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm, +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) { if (dev->error_depth) @@ -218,7 +218,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, const fz_matrix *ctm, const fz_rect *scissor) +fz_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor) { if (dev->error_depth) { @@ -232,7 +232,7 @@ fz_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matr { if (scissor == NULL) { - fz_rect bbox = fz_bound_text(ctx, text, NULL, *ctm); + fz_rect bbox = fz_bound_text(ctx, text, NULL, ctm); push_clip_stack(ctx, dev, &bbox, fz_device_container_stack_is_clip_text); } else @@ -250,7 +250,7 @@ fz_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matr } void -fz_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const 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, const fz_rect *scissor) { if (dev->error_depth) { @@ -264,7 +264,7 @@ fz_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const { if (scissor == NULL) { - fz_rect bbox = fz_bound_text(ctx, text, stroke, *ctm); + 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 @@ -282,7 +282,7 @@ fz_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const } void -fz_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm) +fz_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm) { if (dev->error_depth) return; @@ -307,7 +307,7 @@ fz_pop_clip(fz_context *ctx, fz_device *dev) } void -fz_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha, const fz_color_params *color_params) +fz_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, fz_matrix ctm, float alpha, const fz_color_params *color_params) { if (dev->error_depth) return; @@ -316,7 +316,7 @@ fz_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_matrix } void -fz_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha, const fz_color_params *color_params) +fz_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, float alpha, const fz_color_params *color_params) { if (dev->error_depth) return; @@ -325,7 +325,7 @@ fz_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix } void -fz_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, +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) { if (dev->error_depth) @@ -335,7 +335,7 @@ fz_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_ma } void -fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, const fz_rect *scissor) +fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, const fz_rect *scissor) { if (dev->error_depth) { @@ -349,7 +349,7 @@ fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_ma { if (scissor == NULL) { - fz_rect bbox = fz_transform_rect(fz_unit_rect, *ctm); + 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 @@ -457,13 +457,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, const fz_matrix *ctm) +fz_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const 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, const fz_matrix *ctm, int id) +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) { int ret = 0; diff --git a/source/fitz/document.c b/source/fitz/document.c index 3dc41a75..013badb0 100644 --- a/source/fitz/document.c +++ b/source/fitz/document.c @@ -366,7 +366,7 @@ fz_bound_annot(fz_context *ctx, fz_annot *annot) } void -fz_run_page_contents(fz_context *ctx, fz_page *page, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie) +fz_run_page_contents(fz_context *ctx, fz_page *page, fz_device *dev, fz_matrix transform, fz_cookie *cookie) { if (page && page->run_page_contents && page) { @@ -383,7 +383,7 @@ fz_run_page_contents(fz_context *ctx, fz_page *page, fz_device *dev, const fz_ma } void -fz_run_annot(fz_context *ctx, fz_annot *annot, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie) +fz_run_annot(fz_context *ctx, fz_annot *annot, fz_device *dev, fz_matrix transform, fz_cookie *cookie) { if (annot && annot->run_annot) { @@ -400,7 +400,7 @@ fz_run_annot(fz_context *ctx, fz_annot *annot, fz_device *dev, const fz_matrix * } void -fz_run_page(fz_context *ctx, fz_page *page, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie) +fz_run_page(fz_context *ctx, fz_page *page, fz_device *dev, fz_matrix transform, fz_cookie *cookie) { fz_annot *annot; diff --git a/source/fitz/draw-affine.c b/source/fitz/draw-affine.c index 9f626415..61f7eb3f 100644 --- a/source/fitz/draw-affine.c +++ b/source/fitz/draw-affine.c @@ -7,7 +7,7 @@ typedef unsigned char byte; -typedef void (paintfn_t)(byte * FZ_RESTRICT dp, int da, const byte * FZ_RESTRICT sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * FZ_RESTRICT color, byte * FZ_RESTRICT hp, byte * FZ_RESTRICT gp, const fz_overprint * FZ_RESTRICT eop); +typedef void (paintfn_t)(byte * FZ_RESTRICT dp, int da, const byte * FZ_RESTRICT sp, int sw, int sh, int ss, int sa, int u, int v, int fa, int fb, int w, int dn, int sn, int alpha, const byte * FZ_RESTRICT color, byte * FZ_RESTRICT hp, byte * FZ_RESTRICT gp, const fz_overprint *eop); static inline int lerp(int a, int b, int t) { @@ -3868,7 +3868,7 @@ fz_gridfit_matrix(int as_tiled, fz_matrix m) /* Draw an image with an affine transform on destination */ static void -fz_paint_image_imp(fz_pixmap * FZ_RESTRICT dst, const fz_irect *scissor, fz_pixmap * FZ_RESTRICT shape, fz_pixmap * FZ_RESTRICT group_alpha, const fz_pixmap * FZ_RESTRICT img, const fz_matrix * FZ_RESTRICT ctm, const byte * FZ_RESTRICT color, int alpha, int lerp_allowed, int as_tiled, const fz_overprint * FZ_RESTRICT eop) +fz_paint_image_imp(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *group_alpha, const fz_pixmap *img, fz_matrix ctm, const byte *color, int alpha, int lerp_allowed, int as_tiled, const fz_overprint *eop) { byte *dp, *sp, *hp, *gp; int u, v, fa, fb, fc, fd; @@ -3877,35 +3877,34 @@ fz_paint_image_imp(fz_pixmap * FZ_RESTRICT dst, const fz_irect *scissor, fz_pixm fz_irect bbox; int dolerp; paintfn_t *paintfn; - fz_matrix local_ctm; int is_rectilinear; if (alpha == 0) return; /* grid fit the image */ - local_ctm = fz_gridfit_matrix(as_tiled, *ctm); + ctm = fz_gridfit_matrix(as_tiled, ctm); /* turn on interpolation for upscaled and non-rectilinear transforms */ dolerp = 0; - is_rectilinear = fz_is_rectilinear(local_ctm); + is_rectilinear = fz_is_rectilinear(ctm); if (!is_rectilinear) dolerp = lerp_allowed; - if (sqrtf(local_ctm.a * local_ctm.a + local_ctm.b * local_ctm.b) > img->w) + if (sqrtf(ctm.a * ctm.a + ctm.b * ctm.b) > img->w) dolerp = lerp_allowed; - if (sqrtf(local_ctm.c * local_ctm.c + local_ctm.d * local_ctm.d) > img->h) + if (sqrtf(ctm.c * ctm.c + ctm.d * ctm.d) > img->h) dolerp = lerp_allowed; /* except when we shouldn't, at large magnifications */ if (!(img->flags & FZ_PIXMAP_FLAG_INTERPOLATE)) { - if (sqrtf(local_ctm.a * local_ctm.a + local_ctm.b * local_ctm.b) > img->w * 2) + if (sqrtf(ctm.a * ctm.a + ctm.b * ctm.b) > img->w * 2) dolerp = 0; - if (sqrtf(local_ctm.c * local_ctm.c + local_ctm.d * local_ctm.d) > img->h * 2) + if (sqrtf(ctm.c * ctm.c + ctm.d * ctm.d) > img->h * 2) dolerp = 0; } - bbox = fz_irect_from_rect(fz_transform_rect(fz_unit_rect, local_ctm)); + bbox = fz_irect_from_rect(fz_transform_rect(fz_unit_rect, ctm)); bbox = fz_intersect_irect(bbox, *scissor); x = bbox.x0; @@ -3934,21 +3933,21 @@ fz_paint_image_imp(fz_pixmap * FZ_RESTRICT dst, const fz_irect *scissor, fz_pixm return; /* map from screen space (x,y) to image space (u,v) */ - local_ctm = fz_pre_scale(local_ctm, 1.0f / img->w, 1.0f / img->h); - local_ctm = fz_invert_matrix(local_ctm); + ctm = fz_pre_scale(ctm, 1.0f / img->w, 1.0f / img->h); + ctm = fz_invert_matrix(ctm); - fa = (int)(local_ctm.a *= 65536.0f); - fb = (int)(local_ctm.b *= 65536.0f); - fc = (int)(local_ctm.c *= 65536.0f); - fd = (int)(local_ctm.d *= 65536.0f); - local_ctm.e *= 65536.0f; - local_ctm.f *= 65536.0f; + fa = (int)(ctm.a *= 65536.0f); + fb = (int)(ctm.b *= 65536.0f); + fc = (int)(ctm.c *= 65536.0f); + fd = (int)(ctm.d *= 65536.0f); + ctm.e *= 65536.0f; + ctm.f *= 65536.0f; /* Calculate initial texture positions. Do a half step to start. */ /* Bug 693021: Keep calculation in float for as long as possible to * avoid overflow. */ - u = (int)((local_ctm.a * x) + (local_ctm.c * y) + local_ctm.e + ((local_ctm.a + local_ctm.c) * .5f)); - v = (int)((local_ctm.b * x) + (local_ctm.d * y) + local_ctm.f + ((local_ctm.b + local_ctm.d) * .5f)); + u = (int)((ctm.a * x) + (ctm.c * y) + ctm.e + ((ctm.a + ctm.c) * .5f)); + v = (int)((ctm.b * x) + (ctm.d * y) + ctm.f + ((ctm.b + ctm.d) * .5f)); dp = dst->samples + (unsigned int)((y - dst->y) * dst->stride + (x - dst->x) * dst->n); da = dst->alpha; @@ -4063,14 +4062,14 @@ fz_paint_image_imp(fz_pixmap * FZ_RESTRICT dst, const fz_irect *scissor, fz_pixm } void -fz_paint_image_with_color(fz_pixmap * FZ_RESTRICT dst, const fz_irect * FZ_RESTRICT scissor, fz_pixmap * FZ_RESTRICT shape, fz_pixmap * FZ_RESTRICT group_alpha, const fz_pixmap * FZ_RESTRICT img, const fz_matrix * FZ_RESTRICT ctm, const byte * FZ_RESTRICT color, int lerp_allowed, int as_tiled, const fz_overprint * FZ_RESTRICT eop) +fz_paint_image_with_color(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *group_alpha, const fz_pixmap *img, fz_matrix ctm, const byte *color, int lerp_allowed, int as_tiled, const fz_overprint *eop) { assert(img->n == 1); fz_paint_image_imp(dst, scissor, shape, group_alpha, img, ctm, color, 255, lerp_allowed, as_tiled, eop); } void -fz_paint_image(fz_pixmap * FZ_RESTRICT dst, const fz_irect * FZ_RESTRICT scissor, fz_pixmap * FZ_RESTRICT shape, fz_pixmap * FZ_RESTRICT group_alpha, const fz_pixmap * FZ_RESTRICT img, const fz_matrix * FZ_RESTRICT ctm, int alpha, int lerp_allowed, int as_tiled, const fz_overprint * FZ_RESTRICT eop) +fz_paint_image(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *group_alpha, const fz_pixmap *img, fz_matrix ctm, int alpha, int lerp_allowed, int as_tiled, const fz_overprint *eop) { fz_paint_image_imp(dst, scissor, shape, group_alpha, img, ctm, NULL, alpha, lerp_allowed, as_tiled, eop); } diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c index 63b20f67..d31fa9d8 100644 --- a/source/fitz/draw-device.c +++ b/source/fitz/draw-device.c @@ -601,11 +601,11 @@ push_group_for_separations(fz_context *ctx, fz_draw_device *dev, const fz_color_ } static void -fz_draw_fill_path(fz_context *ctx, fz_device *devp, const fz_path *path, int even_odd, const fz_matrix *in_ctm, +fz_draw_fill_path(fz_context *ctx, fz_device *devp, const fz_path *path, int even_odd, fz_matrix in_ctm, fz_colorspace *colorspace_in, const float *color, float alpha, const fz_color_params *color_params) { fz_draw_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = fz_concat(*in_ctm, dev->transform); + fz_matrix ctm = fz_concat(in_ctm, dev->transform); fz_rasterizer *rast = dev->rast; fz_colorspace *colorspace = fz_default_colorspace(ctx, dev->default_cs, colorspace_in); float expansion = fz_matrix_expansion(ctm); @@ -623,7 +623,7 @@ fz_draw_fill_path(fz_context *ctx, fz_device *devp, const fz_path *path, int eve flatness = 0.001f; bbox = fz_intersect_irect(fz_pixmap_bbox(ctx, state->dest), state->scissor); - if (fz_flatten_fill_path(ctx, rast, path, &ctm, flatness, &bbox, &bbox)) + if (fz_flatten_fill_path(ctx, rast, path, ctm, flatness, &bbox, &bbox)) return; if (state->blendmode & FZ_BLEND_KNOCKOUT) @@ -635,7 +635,7 @@ fz_draw_fill_path(fz_context *ctx, fz_device *devp, const fz_path *path, int eve if (state->shape) { if (!rast->fns.reusable) - fz_flatten_fill_path(ctx, rast, path, &ctm, flatness, &bbox, NULL); + fz_flatten_fill_path(ctx, rast, path, ctm, flatness, &bbox, NULL); colorbv[0] = 255; fz_convert_rasterizer(ctx, rast, even_odd, state->shape, colorbv, 0); @@ -643,7 +643,7 @@ fz_draw_fill_path(fz_context *ctx, fz_device *devp, const fz_path *path, int eve if (state->group_alpha) { if (!rast->fns.reusable) - fz_flatten_fill_path(ctx, rast, path, &ctm, flatness, &bbox, NULL); + fz_flatten_fill_path(ctx, rast, path, ctm, flatness, &bbox, NULL); colorbv[0] = alpha * 255; fz_convert_rasterizer(ctx, rast, even_odd, state->group_alpha, colorbv, 0); @@ -654,11 +654,11 @@ fz_draw_fill_path(fz_context *ctx, fz_device *devp, const fz_path *path, int eve } static void -fz_draw_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, const fz_stroke_state *stroke, const fz_matrix *in_ctm, +fz_draw_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, const fz_stroke_state *stroke, fz_matrix in_ctm, fz_colorspace *colorspace_in, const float *color, float alpha, const fz_color_params *color_params) { fz_draw_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = fz_concat(*in_ctm, dev->transform); + fz_matrix ctm = fz_concat(in_ctm, dev->transform); fz_rasterizer *rast = dev->rast; fz_colorspace *colorspace = fz_default_colorspace(ctx, dev->default_cs, colorspace_in); float expansion = fz_matrix_expansion(ctm); @@ -683,7 +683,7 @@ fz_draw_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, const flatness = 0.001f; bbox = fz_intersect_irect(fz_pixmap_bbox_no_ctx(state->dest), state->scissor); - if (fz_flatten_stroke_path(ctx, rast, path, stroke, &ctm, flatness, linewidth, &bbox, &bbox)) + if (fz_flatten_stroke_path(ctx, rast, path, stroke, ctm, flatness, linewidth, &bbox, &bbox)) return; if (state->blendmode & FZ_BLEND_KNOCKOUT) @@ -704,7 +704,7 @@ fz_draw_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, const if (state->shape) { if (!rast->fns.reusable) - (void)fz_flatten_stroke_path(ctx, rast, path, stroke, &ctm, flatness, linewidth, &bbox, NULL); + (void)fz_flatten_stroke_path(ctx, rast, path, stroke, ctm, flatness, linewidth, &bbox, NULL); colorbv[0] = 255; fz_convert_rasterizer(ctx, rast, 0, state->shape, colorbv, 0); @@ -712,7 +712,7 @@ fz_draw_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, const if (state->group_alpha) { if (!rast->fns.reusable) - (void)fz_flatten_stroke_path(ctx, rast, path, stroke, &ctm, flatness, linewidth, &bbox, NULL); + (void)fz_flatten_stroke_path(ctx, rast, path, stroke, ctm, flatness, linewidth, &bbox, NULL); colorbv[0] = 255 * alpha; fz_convert_rasterizer(ctx, rast, 0, state->group_alpha, colorbv, 0); @@ -732,10 +732,10 @@ 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, const 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, const fz_rect *scissor) { fz_draw_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = fz_concat(*in_ctm, dev->transform); + fz_matrix ctm = fz_concat(in_ctm, dev->transform); fz_rasterizer *rast = dev->rast; float expansion = fz_matrix_expansion(ctm); @@ -765,7 +765,7 @@ fz_draw_clip_path(fz_context *ctx, fz_device *devp, const fz_path *path, int eve bbox = fz_intersect_irect(fz_pixmap_bbox(ctx, state->dest), state->scissor); } - if (fz_flatten_fill_path(ctx, rast, path, &ctm, flatness, &bbox, &bbox) || fz_is_rect_rasterizer(ctx, rast)) + if (fz_flatten_fill_path(ctx, rast, path, ctm, flatness, &bbox, &bbox) || fz_is_rect_rasterizer(ctx, rast)) { state[1].scissor = bbox; state[1].mask = NULL; @@ -806,10 +806,10 @@ 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, const 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, const fz_rect *scissor) { fz_draw_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = fz_concat(*in_ctm, dev->transform); + fz_matrix ctm = fz_concat(in_ctm, dev->transform); fz_rasterizer *rast = dev->rast; float expansion = fz_matrix_expansion(ctm); @@ -846,7 +846,7 @@ fz_draw_clip_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, bbox = fz_intersect_irect(fz_pixmap_bbox(ctx, state->dest), state->scissor); } - if (fz_flatten_stroke_path(ctx, rast, path, stroke, &ctm, flatness, linewidth, &bbox, &bbox)) + if (fz_flatten_stroke_path(ctx, rast, path, stroke, ctm, flatness, linewidth, &bbox, &bbox)) { state[1].scissor = bbox; state[1].mask = NULL; @@ -965,11 +965,11 @@ draw_glyph(unsigned char *colorbv, fz_pixmap *dst, fz_glyph *glyph, } static void -fz_draw_fill_text(fz_context *ctx, fz_device *devp, const fz_text *text, const fz_matrix *in_ctm, +fz_draw_fill_text(fz_context *ctx, fz_device *devp, const fz_text *text, fz_matrix in_ctm, fz_colorspace *colorspace_in, const float *color, float alpha, const fz_color_params *color_params) { fz_draw_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = fz_concat(*in_ctm, dev->transform); + fz_matrix ctm = fz_concat(in_ctm, dev->transform); fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *model = state->dest->colorspace; unsigned char colorbv[FZ_MAX_COLORS + 1]; @@ -1037,13 +1037,13 @@ fz_draw_fill_text(fz_context *ctx, fz_device *devp, const fz_text *text, const f fz_matrix mat; mat.a = pixmap->w; mat.b = mat.c = 0; mat.d = pixmap->h; mat.e = x + pixmap->x; mat.f = y + pixmap->y; - fz_paint_image(state->dest, &state->scissor, state->shape, state->group_alpha, pixmap, &mat, alpha * 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, eop); + fz_paint_image(state->dest, &state->scissor, state->shape, state->group_alpha, pixmap, mat, alpha * 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, eop); } fz_drop_glyph(ctx, glyph); } else { - fz_path *path = fz_outline_glyph(ctx, span->font, gid, &tm); + fz_path *path = fz_outline_glyph(ctx, span->font, gid, tm); if (path) { fz_draw_fill_path(ctx, devp, path, 0, in_ctm, colorspace, color, alpha, color_params); @@ -1063,10 +1063,10 @@ fz_draw_fill_text(fz_context *ctx, fz_device *devp, const fz_text *text, const f static void fz_draw_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, const fz_stroke_state *stroke, - const fz_matrix *in_ctm, fz_colorspace *colorspace_in, const float *color, float alpha, const fz_color_params *color_params) + fz_matrix in_ctm, fz_colorspace *colorspace_in, const float *color, float alpha, const fz_color_params *color_params) { fz_draw_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = fz_concat(*in_ctm, dev->transform); + fz_matrix ctm = fz_concat(in_ctm, dev->transform); fz_draw_state *state = &dev->stack[dev->top]; unsigned char colorbv[FZ_MAX_COLORS + 1]; unsigned char solid = 255; @@ -1107,7 +1107,7 @@ fz_draw_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, const tm.f = span->items[i].y; trm = fz_concat(tm, ctm); - glyph = fz_render_stroked_glyph(ctx, span->font, gid, &trm, &ctm, stroke, &state->scissor, aa); + glyph = fz_render_stroked_glyph(ctx, span->font, gid, &trm, ctm, stroke, &state->scissor, aa); if (glyph) { int x = (int)trm.e; @@ -1121,7 +1121,7 @@ fz_draw_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, const } else { - fz_path *path = fz_outline_glyph(ctx, span->font, gid, &tm); + fz_path *path = fz_outline_glyph(ctx, span->font, gid, tm); if (path) { fz_draw_stroke_path(ctx, devp, path, stroke, in_ctm, colorspace, color, alpha, color_params); @@ -1140,10 +1140,10 @@ 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, const 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, const fz_rect *scissor) { fz_draw_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = fz_concat(*in_ctm, dev->transform); + fz_matrix ctm = fz_concat(in_ctm, dev->transform); fz_irect bbox; fz_pixmap *mask, *dest, *shape, *group_alpha; fz_matrix tm, trm; @@ -1238,7 +1238,7 @@ fz_draw_clip_text(fz_context *ctx, fz_device *devp, const fz_text *text, const f } else { - fz_path *path = fz_outline_glyph(ctx, span->font, gid, &tm); + fz_path *path = fz_outline_glyph(ctx, span->font, gid, tm); if (path) { fz_pixmap *old_dest; @@ -1278,10 +1278,10 @@ fz_draw_clip_text(fz_context *ctx, fz_device *devp, const fz_text *text, const f } static void -fz_draw_clip_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, const fz_stroke_state *stroke, const 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, const fz_rect *scissor) { fz_draw_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = fz_concat(*in_ctm, dev->transform); + fz_matrix ctm = fz_concat(in_ctm, dev->transform); fz_irect bbox; fz_pixmap *mask, *dest, *shape, *group_alpha; fz_matrix tm, trm; @@ -1356,7 +1356,7 @@ fz_draw_clip_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, tm.f = span->items[i].y; trm = fz_concat(tm, ctm); - glyph = fz_render_stroked_glyph(ctx, span->font, gid, &trm, &ctm, stroke, &state->scissor, aa); + glyph = fz_render_stroked_glyph(ctx, span->font, gid, &trm, ctm, stroke, &state->scissor, aa); if (glyph) { int x = (int)trm.e; @@ -1370,7 +1370,7 @@ fz_draw_clip_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, } else { - fz_path *path = fz_outline_glyph(ctx, span->font, gid, &tm); + fz_path *path = fz_outline_glyph(ctx, span->font, gid, tm); if (path) { fz_pixmap *old_dest; @@ -1411,15 +1411,15 @@ fz_draw_clip_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, } static void -fz_draw_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm) +fz_draw_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm) { } static void -fz_draw_fill_shade(fz_context *ctx, fz_device *devp, fz_shade *shade, const fz_matrix *in_ctm, float alpha, const fz_color_params *color_params) +fz_draw_fill_shade(fz_context *ctx, fz_device *devp, fz_shade *shade, fz_matrix in_ctm, float alpha, const fz_color_params *color_params) { fz_draw_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = fz_concat(*in_ctm, dev->transform); + fz_matrix ctm = fz_concat(in_ctm, dev->transform); fz_irect bbox, scissor; fz_pixmap *dest, *shape, *group_alpha; unsigned char colorbv[FZ_MAX_COLORS + 1]; @@ -1542,7 +1542,7 @@ fz_draw_fill_shade(fz_context *ctx, fz_device *devp, fz_shade *shade, const fz_m 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) @@ -1682,10 +1682,10 @@ convert_pixmap_for_painting(fz_context *ctx, fz_pixmap *pixmap, fz_colorspace *m } static void -fz_draw_fill_image(fz_context *ctx, fz_device *devp, fz_image *image, const fz_matrix *in_ctm, float alpha, const fz_color_params *color_params) +fz_draw_fill_image(fz_context *ctx, fz_device *devp, fz_image *image, fz_matrix in_ctm, float alpha, const fz_color_params *color_params) { fz_draw_device *dev = (fz_draw_device*)devp; - fz_matrix local_ctm = fz_concat(*in_ctm, dev->transform); + fz_matrix local_ctm = fz_concat(in_ctm, dev->transform); fz_pixmap *pixmap; int after; int dx, dy; @@ -1816,7 +1816,7 @@ fz_draw_fill_image(fz_context *ctx, fz_device *devp, fz_image *image, const fz_m pixmap = convert_pixmap_for_painting(ctx, pixmap, model, src_cs, state->dest, color_params, dev, &eop); } - fz_paint_image(state->dest, &state->scissor, state->shape, state->group_alpha, pixmap, &local_ctm, alpha * 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, eop); + fz_paint_image(state->dest, &state->scissor, state->shape, state->group_alpha, pixmap, local_ctm, alpha * 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, eop); } fz_always(ctx) { @@ -1829,11 +1829,11 @@ fz_draw_fill_image(fz_context *ctx, fz_device *devp, fz_image *image, const fz_m } static void -fz_draw_fill_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const fz_matrix *in_ctm, +fz_draw_fill_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, fz_matrix in_ctm, fz_colorspace *colorspace_in, const float *color, float alpha, const fz_color_params *color_params) { fz_draw_device *dev = (fz_draw_device*)devp; - fz_matrix local_ctm = fz_concat(*in_ctm, dev->transform); + fz_matrix local_ctm = fz_concat(in_ctm, dev->transform); unsigned char colorbv[FZ_MAX_COLORS + 1]; fz_pixmap *scaled = NULL; fz_pixmap *pixmap; @@ -1926,7 +1926,7 @@ fz_draw_fill_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const eop = resolve_color(ctx, &op, color, colorspace, alpha, color_params, colorbv, state->dest); - fz_paint_image_with_color(state->dest, &state->scissor, state->shape, state->group_alpha, pixmap, &local_ctm, colorbv, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, eop); + fz_paint_image_with_color(state->dest, &state->scissor, state->shape, state->group_alpha, pixmap, local_ctm, colorbv, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, eop); if (state->blendmode & FZ_BLEND_KNOCKOUT) fz_knockout_end(ctx, dev); @@ -1938,10 +1938,10 @@ fz_draw_fill_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const } static void -fz_draw_clip_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const 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, const fz_rect *scissor) { fz_draw_device *dev = (fz_draw_device*)devp; - fz_matrix local_ctm = fz_concat(*in_ctm, dev->transform); + fz_matrix local_ctm = fz_concat(in_ctm, dev->transform); fz_irect bbox; fz_pixmap *scaled = NULL; fz_pixmap *pixmap = NULL; @@ -2029,7 +2029,7 @@ fz_draw_clip_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const if (state[1].group_alpha) fz_dump_blend(ctx, "/GA=", state[1].group_alpha); #endif - fz_paint_image(state[1].mask, &bbox, state[1].shape, state[1].group_alpha, pixmap, &local_ctm, 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, 0); + fz_paint_image(state[1].mask, &bbox, state[1].shape, state[1].group_alpha, pixmap, local_ctm, 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES), devp->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, 0); #ifdef DUMP_GROUP_BLENDS fz_dump_blend(ctx, " to get ", state[1].mask); if (state[1].shape) @@ -2581,10 +2581,10 @@ 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, const fz_matrix *in_ctm, int id) +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_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = fz_concat(*in_ctm, dev->transform); + fz_matrix ctm = fz_concat(in_ctm, dev->transform); fz_pixmap *dest = NULL; fz_pixmap *shape, *group_alpha; fz_irect bbox; @@ -2974,7 +2974,7 @@ fz_draw_drop_device(fz_context *ctx, fz_device *devp) } fz_device * -new_draw_device(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest, const fz_aa_context *aa, const fz_irect *clip, fz_colorspace *proof_cs) +new_draw_device(fz_context *ctx, fz_matrix transform, fz_pixmap *dest, const fz_aa_context *aa, const fz_irect *clip, fz_colorspace *proof_cs) { fz_draw_device *dev = fz_new_derived_device(ctx, fz_draw_device); @@ -3011,7 +3011,7 @@ new_draw_device(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest, co dev->super.set_default_colorspaces = fz_draw_set_default_colorspaces; dev->proof_cs = fz_keep_colorspace(ctx, proof_cs); - dev->transform = transform ? *transform : fz_identity; + dev->transform = transform; dev->flags = 0; dev->resolve_spots = 0; dev->top = 0; @@ -3079,31 +3079,31 @@ new_draw_device(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest, co } fz_device * -fz_new_draw_device(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest) +fz_new_draw_device(fz_context *ctx, fz_matrix transform, fz_pixmap *dest) { return new_draw_device(ctx, transform, dest, NULL, NULL, NULL); } fz_device * -fz_new_draw_device_with_bbox(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest, const fz_irect *clip) +fz_new_draw_device_with_bbox(fz_context *ctx, fz_matrix transform, fz_pixmap *dest, const fz_irect *clip) { return new_draw_device(ctx, transform, dest, NULL, clip, NULL); } fz_device * -fz_new_draw_device_with_proof(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest, fz_colorspace *cs) +fz_new_draw_device_with_proof(fz_context *ctx, fz_matrix transform, fz_pixmap *dest, fz_colorspace *cs) { return new_draw_device(ctx, transform, dest, NULL, NULL, cs); } fz_device * -fz_new_draw_device_with_bbox_proof(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest, const fz_irect *clip, fz_colorspace *cs) +fz_new_draw_device_with_bbox_proof(fz_context *ctx, fz_matrix transform, fz_pixmap *dest, const fz_irect *clip, fz_colorspace *cs) { return new_draw_device(ctx, transform, dest, NULL, clip, cs); } fz_device * -fz_new_draw_device_type3(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest) +fz_new_draw_device_type3(fz_context *ctx, fz_matrix transform, fz_pixmap *dest) { fz_draw_device *dev = (fz_draw_device*)fz_new_draw_device(ctx, transform, dest); dev->flags |= FZ_DRAWDEV_FLAGS_TYPE3; @@ -3111,7 +3111,7 @@ fz_new_draw_device_type3(fz_context *ctx, const fz_matrix *transform, fz_pixmap } fz_irect * -fz_bound_path_accurate(fz_context *ctx, fz_irect *bbox, const fz_irect *scissor, const fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, float flatness, float linewidth) +fz_bound_path_accurate(fz_context *ctx, fz_irect *bbox, const fz_irect *scissor, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, float flatness, float linewidth) { fz_rasterizer *rast = fz_new_rasterizer(ctx, NULL); @@ -3271,7 +3271,7 @@ fz_new_draw_device_with_options(fz_context *ctx, const fz_draw_options *opts, co else fz_clear_pixmap_with_value(ctx, *pixmap, 255); - dev = new_draw_device(ctx, &transform, *pixmap, &aa, NULL, NULL); + dev = new_draw_device(ctx, transform, *pixmap, &aa, NULL, NULL); } fz_catch(ctx) { diff --git a/source/fitz/draw-glyph.c b/source/fitz/draw-glyph.c index 7696a59c..21b43539 100644 --- a/source/fitz/draw-glyph.c +++ b/source/fitz/draw-glyph.c @@ -178,7 +178,7 @@ fz_subpixel_adjust(fz_context *ctx, fz_matrix *ctm, fz_matrix *subpix_ctm, unsig } fz_glyph * -fz_render_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *stroke, const fz_irect *scissor, int aa) +fz_render_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *trm, fz_matrix ctm, const fz_stroke_state *stroke, const fz_irect *scissor, int aa) { if (fz_font_ft_face(ctx, font)) { @@ -188,13 +188,13 @@ fz_render_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *trm, if (stroke->dash_len > 0) return NULL; (void)fz_subpixel_adjust(ctx, trm, &subpix_trm, &qe, &qf); - return fz_render_ft_stroked_glyph(ctx, font, gid, &subpix_trm, ctm, stroke, aa); + return fz_render_ft_stroked_glyph(ctx, font, gid, subpix_trm, ctm, stroke, aa); } return fz_render_glyph(ctx, font, gid, trm, NULL, scissor, 1, aa); } fz_pixmap * -fz_render_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *stroke, const fz_irect *scissor, int aa) +fz_render_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matrix *trm, fz_matrix ctm, const fz_stroke_state *stroke, const fz_irect *scissor, int aa) { if (fz_font_ft_face(ctx, font)) { @@ -204,7 +204,7 @@ fz_render_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matri if (stroke->dash_len > 0) return NULL; (void)fz_subpixel_adjust(ctx, trm, &subpix_trm, &qe, &qf); - return fz_render_ft_stroked_glyph_pixmap(ctx, font, gid, &subpix_trm, ctm, stroke, aa); + return fz_render_ft_stroked_glyph_pixmap(ctx, font, gid, subpix_trm, ctm, stroke, aa); } return fz_render_glyph_pixmap(ctx, font, gid, trm, scissor, aa); } @@ -315,7 +315,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colo { if (is_ft_font) { - val = fz_render_ft_glyph(ctx, font, gid, &subpix_ctm, aa); + val = fz_render_ft_glyph(ctx, font, gid, subpix_ctm, aa); } else if (fz_font_t3_procs(ctx, font)) { @@ -330,7 +330,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colo */ fz_unlock(ctx, FZ_LOCK_GLYPHCACHE); locked = 0; - val = fz_render_t3_glyph(ctx, font, gid, &subpix_ctm, model, scissor, aa); + val = fz_render_t3_glyph(ctx, font, gid, subpix_ctm, model, scissor, aa); fz_lock(ctx, FZ_LOCK_GLYPHCACHE); locked = 1; } @@ -432,11 +432,11 @@ fz_render_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, if (is_ft_font) { - val = fz_render_ft_glyph_pixmap(ctx, font, gid, &subpix_ctm, aa); + val = fz_render_ft_glyph_pixmap(ctx, font, gid, subpix_ctm, aa); } else if (fz_font_t3_procs(ctx, font)) { - val = fz_render_t3_glyph_pixmap(ctx, font, gid, &subpix_ctm, NULL, scissor, aa); + val = fz_render_t3_glyph_pixmap(ctx, font, gid, subpix_ctm, NULL, scissor, aa); } else { diff --git a/source/fitz/draw-imp.h b/source/fitz/draw-imp.h index eb3e36d2..1d6e691a 100644 --- a/source/fitz/draw-imp.h +++ b/source/fitz/draw-imp.h @@ -438,36 +438,36 @@ typedef enum fz_rasterizer *fz_new_edgebuffer(fz_context *ctx, fz_edgebuffer_rule rule); -int fz_flatten_fill_path(fz_context *ctx, fz_rasterizer *rast, const fz_path *path, const fz_matrix *ctm, float flatness, const fz_irect *irect, fz_irect *bounds); -int fz_flatten_stroke_path(fz_context *ctx, fz_rasterizer *rast, const fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, float flatness, float linewidth, const fz_irect *irect, fz_irect *bounds); +int fz_flatten_fill_path(fz_context *ctx, fz_rasterizer *rast, const fz_path *path, fz_matrix ctm, float flatness, const fz_irect *irect, fz_irect *bounds); +int fz_flatten_stroke_path(fz_context *ctx, fz_rasterizer *rast, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, float flatness, float linewidth, const fz_irect *irect, fz_irect *bounds); -fz_irect *fz_bound_path_accurate(fz_context *ctx, fz_irect *bbox, const fz_irect *scissor, const fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, float flatness, float linewidth); +fz_irect *fz_bound_path_accurate(fz_context *ctx, fz_irect *bbox, const fz_irect *scissor, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, float flatness, float linewidth); /* * Plotting functions. */ -typedef void (fz_solid_color_painter_t)(unsigned char * FZ_RESTRICT dp, int n, int w, const unsigned char * FZ_RESTRICT color, int da, const fz_overprint * FZ_RESTRICT eop); +typedef void (fz_solid_color_painter_t)(unsigned char * FZ_RESTRICT dp, int n, int w, const unsigned char * FZ_RESTRICT color, int da, const fz_overprint *eop); -typedef void (fz_span_painter_t)(unsigned char * FZ_RESTRICT dp, int da, const unsigned char * FZ_RESTRICT sp, int sa, int n, int w, int alpha, const fz_overprint * FZ_RESTRICT eop); -typedef void (fz_span_color_painter_t)(unsigned char * FZ_RESTRICT dp, const unsigned char * FZ_RESTRICT mp, int n, int w, const unsigned char * FZ_RESTRICT color, int da, const fz_overprint * FZ_RESTRICT eop); +typedef void (fz_span_painter_t)(unsigned char * FZ_RESTRICT dp, int da, const unsigned char * FZ_RESTRICT sp, int sa, int n, int w, int alpha, const fz_overprint *eop); +typedef void (fz_span_color_painter_t)(unsigned char * FZ_RESTRICT dp, const unsigned char * FZ_RESTRICT mp, int n, int w, const unsigned char * FZ_RESTRICT color, int da, const fz_overprint *eop); -fz_solid_color_painter_t *fz_get_solid_color_painter(int n, const unsigned char * FZ_RESTRICT color, int da, const fz_overprint * FZ_RESTRICT eop); -fz_span_painter_t *fz_get_span_painter(int da, int sa, int n, int alpha, const fz_overprint * FZ_RESTRICT eop); -fz_span_color_painter_t *fz_get_span_color_painter(int n, int da, const unsigned char * FZ_RESTRICT color, const fz_overprint * FZ_RESTRICT eop); +fz_solid_color_painter_t *fz_get_solid_color_painter(int n, const unsigned char *color, int da, const fz_overprint *eop); +fz_span_painter_t *fz_get_span_painter(int da, int sa, int n, int alpha, const fz_overprint *eop); +fz_span_color_painter_t *fz_get_span_color_painter(int n, int da, const unsigned char *color, const fz_overprint *eop); -void fz_paint_image(fz_pixmap * FZ_RESTRICT dst, const fz_irect * FZ_RESTRICT scissor, fz_pixmap * FZ_RESTRICT shape, fz_pixmap * FZ_RESTRICT group_alpha, const fz_pixmap * FZ_RESTRICT img, const fz_matrix * FZ_RESTRICT ctm, int alpha, int lerp_allowed, int gridfit_as_tiled, const fz_overprint * FZ_RESTRICT eop); -void fz_paint_image_with_color(fz_pixmap * FZ_RESTRICT dst, const fz_irect * FZ_RESTRICT scissor, fz_pixmap *FZ_RESTRICT shape, fz_pixmap * FZ_RESTRICT group_alpha, const fz_pixmap * FZ_RESTRICT img, const fz_matrix * FZ_RESTRICT ctm, const unsigned char * FZ_RESTRICT colorbv, int lerp_allowed, int gridfit_as_tiled, const fz_overprint * FZ_RESTRICT eop); +void fz_paint_image(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *group_alpha, const fz_pixmap *img, fz_matrix ctm, int alpha, int lerp_allowed, int gridfit_as_tiled, const fz_overprint *eop); +void fz_paint_image_with_color(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *group_alpha, const fz_pixmap *img, fz_matrix ctm, const unsigned char *colorbv, int lerp_allowed, int gridfit_as_tiled, const fz_overprint *eop); -void fz_paint_pixmap(fz_pixmap * FZ_RESTRICT dst, const fz_pixmap * FZ_RESTRICT src, int alpha); -void fz_paint_pixmap_alpha(fz_pixmap * FZ_RESTRICT dst, const fz_pixmap * FZ_RESTRICT src, int alpha); -void fz_paint_pixmap_with_mask(fz_pixmap * FZ_RESTRICT dst, const fz_pixmap * FZ_RESTRICT src, const fz_pixmap * FZ_RESTRICT msk); -void fz_paint_pixmap_with_bbox(fz_pixmap * FZ_RESTRICT dst, const fz_pixmap * FZ_RESTRICT src, int alpha, fz_irect bbox); -void fz_paint_pixmap_with_overprint(fz_pixmap * FZ_RESTRICT dst, const fz_pixmap * FZ_RESTRICT src, const fz_overprint *op); +void fz_paint_pixmap(fz_pixmap *dst, const fz_pixmap *src, int alpha); +void fz_paint_pixmap_alpha(fz_pixmap *dst, const fz_pixmap *src, int alpha); +void fz_paint_pixmap_with_mask(fz_pixmap *dst, const fz_pixmap *src, const fz_pixmap *msk); +void fz_paint_pixmap_with_bbox(fz_pixmap *dst, const fz_pixmap *src, int alpha, fz_irect bbox); +void fz_paint_pixmap_with_overprint(fz_pixmap *dst, const fz_pixmap *src, const fz_overprint *op); -void fz_blend_pixmap(fz_context *ctx, fz_pixmap * FZ_RESTRICT dst, fz_pixmap * FZ_RESTRICT src, int alpha, int blendmode, int isolated, const fz_pixmap * FZ_RESTRICT shape); -void fz_blend_pixmap_knockout(fz_context *ctx, fz_pixmap * FZ_RESTRICT dst, fz_pixmap * FZ_RESTRICT src, const fz_pixmap * FZ_RESTRICT shape); +void fz_blend_pixmap(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, int alpha, int blendmode, int isolated, const fz_pixmap *shape); +void fz_blend_pixmap_knockout(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, const fz_pixmap *shape); -void fz_paint_glyph(const unsigned char * FZ_RESTRICT colorbv, fz_pixmap * FZ_RESTRICT dst, unsigned char * FZ_RESTRICT dp, const fz_glyph * FZ_RESTRICT glyph, int w, int h, int skip_x, int skip_y, const fz_overprint * FZ_RESTRICT eop); +void fz_paint_glyph(const unsigned char *colorbv, fz_pixmap *dst, unsigned char *dp, const fz_glyph *glyph, int w, int h, int skip_x, int skip_y, const fz_overprint *eop); #endif diff --git a/source/fitz/draw-mesh.c b/source/fitz/draw-mesh.c index 5a3bef40..3b08c1e1 100644 --- a/source/fitz/draw-mesh.c +++ b/source/fitz/draw-mesh.c @@ -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, const 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, const fz_irect *bbox, const fz_overprint *op) { unsigned char clut[256][FZ_MAX_COLORS]; fz_pixmap *temp = NULL; @@ -230,7 +230,7 @@ fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_colorspace *colorspace, cons fz_try(ctx) { - local_ctm = fz_concat(shade->matrix, *ctm); + local_ctm = fz_concat(shade->matrix, ctm); if (shade->use_function) { diff --git a/source/fitz/draw-path.c b/source/fitz/draw-path.c index 74456df5..d809b7d8 100644 --- a/source/fitz/draw-path.c +++ b/source/fitz/draw-path.c @@ -48,17 +48,17 @@ static void -line(fz_context *ctx, fz_rasterizer *rast, const fz_matrix *ctm, float x0, float y0, float x1, float y1) +line(fz_context *ctx, fz_rasterizer *rast, fz_matrix ctm, float x0, float y0, float x1, float y1) { - float tx0 = ctm->a * x0 + ctm->c * y0 + ctm->e; - float ty0 = ctm->b * x0 + ctm->d * y0 + ctm->f; - float tx1 = ctm->a * x1 + ctm->c * y1 + ctm->e; - float ty1 = ctm->b * x1 + ctm->d * y1 + ctm->f; + float tx0 = ctm.a * x0 + ctm.c * y0 + ctm.e; + float ty0 = ctm.b * x0 + ctm.d * y0 + ctm.f; + float tx1 = ctm.a * x1 + ctm.c * y1 + ctm.e; + float ty1 = ctm.b * x1 + ctm.d * y1 + ctm.f; fz_insert_rasterizer(ctx, rast, tx0, ty0, tx1, ty1, 0); } static void -bezier(fz_context *ctx, fz_rasterizer *rast, const fz_matrix *ctm, float flatness, +bezier(fz_context *ctx, fz_rasterizer *rast, fz_matrix ctm, float flatness, float xa, float ya, float xb, float yb, float xc, float yc, @@ -112,7 +112,7 @@ bezier(fz_context *ctx, fz_rasterizer *rast, const fz_matrix *ctm, float flatnes } static void -quad(fz_context *ctx, fz_rasterizer *rast, const fz_matrix *ctm, float flatness, +quad(fz_context *ctx, fz_rasterizer *rast, fz_matrix ctm, float flatness, float xa, float ya, float xb, float yb, float xc, float yc, int depth) @@ -153,7 +153,7 @@ quad(fz_context *ctx, fz_rasterizer *rast, const fz_matrix *ctm, float flatness, typedef struct { fz_rasterizer *rast; - const fz_matrix *ctm; + fz_matrix ctm; float flatness; fz_point b; fz_point c; @@ -218,7 +218,7 @@ static void flatten_rectto(fz_context *ctx, void *arg_, float x0, float y0, float x1, float y1) { flatten_arg *arg = (flatten_arg *)arg_; - const fz_matrix *ctm = arg->ctm; + fz_matrix ctm = arg->ctm; flatten_moveto(ctx, arg_, x0, y0); @@ -226,21 +226,21 @@ flatten_rectto(fz_context *ctx, void *arg_, float x0, float y0, float x1, float { /* In the case where we have an axis aligned rectangle, do some * horrid antidropout stuff. */ - if (ctm->b == 0 && ctm->c == 0) + if (ctm.b == 0 && ctm.c == 0) { - float tx0 = ctm->a * x0 + ctm->e; - float ty0 = ctm->d * y0 + ctm->f; - float tx1 = ctm->a * x1 + ctm->e; - float ty1 = ctm->d * y1 + ctm->f; + float tx0 = ctm.a * x0 + ctm.e; + float ty0 = ctm.d * y0 + ctm.f; + float tx1 = ctm.a * x1 + ctm.e; + float ty1 = ctm.d * y1 + ctm.f; fz_insert_rasterizer_rect(ctx, arg->rast, tx0, ty0, tx1, ty1); return; } - else if (ctm->a == 0 && ctm->d == 0) + else if (ctm.a == 0 && ctm.d == 0) { - float tx0 = ctm->c * y0 + ctm->e; - float ty0 = ctm->b * x0 + ctm->f; - float tx1 = ctm->c * y1 + ctm->e; - float ty1 = ctm->b * x1 + ctm->f; + float tx0 = ctm.c * y0 + ctm.e; + float ty0 = ctm.b * x0 + ctm.f; + float tx1 = ctm.c * y1 + ctm.e; + float ty1 = ctm.b * x1 + ctm.f; fz_insert_rasterizer_rect(ctx, arg->rast, tx0, ty1, tx1, ty0); return; } @@ -265,7 +265,7 @@ static const fz_path_walker flatten_proc = }; int -fz_flatten_fill_path(fz_context *ctx, fz_rasterizer *rast, const fz_path *path, const fz_matrix *ctm, float flatness, const fz_irect *scissor, fz_irect *bbox) +fz_flatten_fill_path(fz_context *ctx, fz_rasterizer *rast, const fz_path *path, fz_matrix ctm, float flatness, const fz_irect *scissor, fz_irect *bbox) { flatten_arg arg; @@ -312,7 +312,7 @@ enum { typedef struct sctx { fz_rasterizer *rast; - const fz_matrix *ctm; + fz_matrix ctm; float flatness; const fz_stroke_state *stroke; @@ -341,10 +341,10 @@ typedef struct sctx static void fz_add_line(fz_context *ctx, sctx *s, float x0, float y0, float x1, float y1, int rev) { - float tx0 = s->ctm->a * x0 + s->ctm->c * y0 + s->ctm->e; - float ty0 = s->ctm->b * x0 + s->ctm->d * y0 + s->ctm->f; - float tx1 = s->ctm->a * x1 + s->ctm->c * y1 + s->ctm->e; - float ty1 = s->ctm->b * x1 + s->ctm->d * y1 + s->ctm->f; + float tx0 = s->ctm.a * x0 + s->ctm.c * y0 + s->ctm.e; + float ty0 = s->ctm.b * x0 + s->ctm.d * y0 + s->ctm.f; + float tx1 = s->ctm.a * x1 + s->ctm.c * y1 + s->ctm.e; + float ty1 = s->ctm.b * x1 + s->ctm.d * y1 + s->ctm.f; fz_insert_rasterizer(ctx, s->rast, tx0, ty0, tx1, ty1, rev); } @@ -353,21 +353,21 @@ static void fz_add_horiz_rect(fz_context *ctx, sctx *s, float x0, float y0, float x1, float y1) { if (fz_antidropout_rasterizer(ctx, s->rast)) { - if (s->ctm->b == 0 && s->ctm->c == 0) + if (s->ctm.b == 0 && s->ctm.c == 0) { - float tx0 = s->ctm->a * x0 + s->ctm->e; - float ty0 = s->ctm->d * y0 + s->ctm->f; - float tx1 = s->ctm->a * x1 + s->ctm->e; - float ty1 = s->ctm->d * y1 + s->ctm->f; + float tx0 = s->ctm.a * x0 + s->ctm.e; + float ty0 = s->ctm.d * y0 + s->ctm.f; + float tx1 = s->ctm.a * x1 + s->ctm.e; + float ty1 = s->ctm.d * y1 + s->ctm.f; fz_insert_rasterizer_rect(ctx, s->rast, tx1, ty1, tx0, ty0); return; } - else if (s->ctm->a == 0 && s->ctm->d == 0) + else if (s->ctm.a == 0 && s->ctm.d == 0) { - float tx0 = s->ctm->c * y0 + s->ctm->e; - float ty0 = s->ctm->b * x0 + s->ctm->f; - float tx1 = s->ctm->c * y1 + s->ctm->e; - float ty1 = s->ctm->b * x1 + s->ctm->f; + float tx0 = s->ctm.c * y0 + s->ctm.e; + float ty0 = s->ctm.b * x0 + s->ctm.f; + float tx1 = s->ctm.c * y1 + s->ctm.e; + float ty1 = s->ctm.b * x1 + s->ctm.f; fz_insert_rasterizer_rect(ctx, s->rast, tx1, ty0, tx0, ty1); return; } @@ -382,21 +382,21 @@ fz_add_vert_rect(fz_context *ctx, sctx *s, float x0, float y0, float x1, float y { if (fz_antidropout_rasterizer(ctx, s->rast)) { - if (s->ctm->b == 0 && s->ctm->c == 0) + if (s->ctm.b == 0 && s->ctm.c == 0) { - float tx0 = s->ctm->a * x0 + s->ctm->e; - float ty0 = s->ctm->d * y0 + s->ctm->f; - float tx1 = s->ctm->a * x1 + s->ctm->e; - float ty1 = s->ctm->d * y1 + s->ctm->f; + float tx0 = s->ctm.a * x0 + s->ctm.e; + float ty0 = s->ctm.d * y0 + s->ctm.f; + float tx1 = s->ctm.a * x1 + s->ctm.e; + float ty1 = s->ctm.d * y1 + s->ctm.f; fz_insert_rasterizer_rect(ctx, s->rast, tx0, ty1, tx1, ty0); return; } - else if (s->ctm->a == 0 && s->ctm->d == 0) + else if (s->ctm.a == 0 && s->ctm.d == 0) { - float tx0 = s->ctm->c * y0 + s->ctm->e; - float ty0 = s->ctm->b * x0 + s->ctm->f; - float tx1 = s->ctm->c * y1 + s->ctm->e; - float ty1 = s->ctm->b * x1 + s->ctm->f; + float tx0 = s->ctm.c * y0 + s->ctm.e; + float ty0 = s->ctm.b * x0 + s->ctm.f; + float tx1 = s->ctm.c * y1 + s->ctm.e; + float ty1 = s->ctm.b * x1 + s->ctm.f; fz_insert_rasterizer_rect(ctx, s->rast, tx0, ty0, tx1, ty1); return; } @@ -1419,7 +1419,7 @@ static const fz_path_walker dash_proc = }; static int -do_flatten_stroke(fz_context *ctx, fz_rasterizer *rast, const fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, float flatness, float linewidth, const fz_irect *scissor, fz_irect *bbox) +do_flatten_stroke(fz_context *ctx, fz_rasterizer *rast, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, float flatness, float linewidth, const fz_irect *scissor, fz_irect *bbox) { struct sctx s; const fz_path_walker *proc = &stroke_proc; @@ -1455,7 +1455,7 @@ do_flatten_stroke(fz_context *ctx, fz_rasterizer *rast, const fz_path *path, con return 1; s.rect = fz_scissor_rasterizer(ctx, rast); - if (fz_try_invert_matrix(&inv, *ctm)) + if (fz_try_invert_matrix(&inv, ctm)) return 1; s.rect = fz_transform_rect(s.rect, inv); s.rect.x0 -= linewidth; @@ -1463,7 +1463,7 @@ do_flatten_stroke(fz_context *ctx, fz_rasterizer *rast, const fz_path *path, con s.rect.y0 -= linewidth; s.rect.y1 += linewidth; - max_expand = fz_matrix_max_expansion(*ctm); + max_expand = fz_matrix_max_expansion(ctm); if (s.dash_total >= 0.01f && s.dash_total * max_expand >= 0.5f) { proc = &dash_proc; @@ -1484,7 +1484,7 @@ do_flatten_stroke(fz_context *ctx, fz_rasterizer *rast, const fz_path *path, con } int -fz_flatten_stroke_path(fz_context *ctx, fz_rasterizer *rast, const fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, float flatness, float linewidth, const fz_irect *scissor, fz_irect *bbox) +fz_flatten_stroke_path(fz_context *ctx, fz_rasterizer *rast, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, float flatness, float linewidth, const fz_irect *scissor, fz_irect *bbox) { if (fz_reset_rasterizer(ctx, rast, *scissor)) { diff --git a/source/fitz/draw-unpack.c b/source/fitz/draw-unpack.c index ad1076bd..77180f5c 100644 --- a/source/fitz/draw-unpack.c +++ b/source/fitz/draw-unpack.c @@ -70,7 +70,7 @@ init_get1_tables(void) } void -fz_unpack_tile(fz_context *ctx, fz_pixmap *dst, unsigned char * FZ_RESTRICT src, int n, int depth, size_t stride, int scale) +fz_unpack_tile(fz_context *ctx, fz_pixmap *dst, unsigned char *src, int n, int depth, size_t stride, int scale) { int pad, x, y, k, skip; int w = dst->w; diff --git a/source/fitz/font-imp.h b/source/fitz/font-imp.h index f121923c..383d7d21 100644 --- a/source/fitz/font-imp.h +++ b/source/fitz/font-imp.h @@ -19,7 +19,7 @@ struct fz_font_s float *t3widths; /* has 256 entries if used */ unsigned short *t3flags; /* has 256 entries if used */ void *t3doc; /* a pdf_document for the callback */ - void (*t3run)(fz_context *ctx, void *doc, void *resources, fz_buffer *contents, struct fz_device_s *dev, const fz_matrix *ctm, void *gstate, int nested_depth, fz_default_colorspaces *default_cs); + void (*t3run)(fz_context *ctx, void *doc, void *resources, fz_buffer *contents, struct fz_device_s *dev, fz_matrix ctm, void *gstate, int nested_depth, fz_default_colorspaces *default_cs); void (*t3freeres)(fz_context *ctx, void *doc, void *resources); fz_rect bbox; /* font bbox is used only for t3 fonts */ diff --git a/source/fitz/font.c b/source/fitz/font.c index d7c58d0d..f24d639b 100644 --- a/source/fitz/font.c +++ b/source/fitz/font.c @@ -778,20 +778,19 @@ pixmap_from_ft_bitmap(fz_context *ctx, int left, int top, FT_Bitmap *bitmap) /* Takes the freetype lock, and returns with it held */ static FT_GlyphSlot -do_ft_render_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, int aa) +do_ft_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, int aa) { FT_Face face = font->ft_face; FT_Matrix m; FT_Vector v; FT_Error fterr; - fz_matrix local_trm = *trm; - float strength = fz_matrix_expansion(*trm) * 0.02f; + float strength = fz_matrix_expansion(trm) * 0.02f; - fz_adjust_ft_glyph_width(ctx, font, gid, &local_trm); + fz_adjust_ft_glyph_width(ctx, font, gid, &trm); if (font->flags.fake_italic) - local_trm = fz_pre_shear(local_trm, SHEAR, 0); + trm = fz_pre_shear(trm, SHEAR, 0); /* Freetype mutilates complex glyphs if they are loaded @@ -801,12 +800,12 @@ do_ft_render_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm into FT_Set_Char_Size instead */ - m.xx = local_trm.a * 64; /* should be 65536 */ - m.yx = local_trm.b * 64; - m.xy = local_trm.c * 64; - m.yy = local_trm.d * 64; - v.x = local_trm.e * 64; - v.y = local_trm.f * 64; + m.xx = trm.a * 64; /* should be 65536 */ + m.yx = trm.b * 64; + m.xy = trm.c * 64; + m.yy = trm.d * 64; + v.x = trm.e * 64; + v.y = trm.f * 64; fz_lock(ctx, FZ_LOCK_FREETYPE); fterr = FT_Set_Char_Size(face, 65536, 65536, 72, 72); /* should be 64, 64 */ @@ -817,11 +816,11 @@ do_ft_render_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm if (aa == 0) { /* enable grid fitting for non-antialiased rendering */ - float scale = fz_matrix_expansion(local_trm); - m.xx = local_trm.a * 65536 / scale; - m.yx = local_trm.b * 65536 / scale; - m.xy = local_trm.c * 65536 / scale; - m.yy = local_trm.d * 65536 / scale; + float scale = fz_matrix_expansion(trm); + m.xx = trm.a * 65536 / scale; + m.yx = trm.b * 65536 / scale; + m.xy = trm.c * 65536 / scale; + m.yy = trm.d * 65536 / scale; v.x = 0; v.y = 0; @@ -862,7 +861,7 @@ retry_unhinted: } fz_pixmap * -fz_render_ft_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, int aa) +fz_render_ft_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, int aa) { FT_GlyphSlot slot = do_ft_render_glyph(ctx, font, gid, trm, aa); fz_pixmap *pixmap = NULL; @@ -891,7 +890,7 @@ fz_render_ft_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matr /* The glyph cache lock is always taken when this is called. */ fz_glyph * -fz_render_ft_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, int aa) +fz_render_ft_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, int aa) { FT_GlyphSlot slot = do_ft_render_glyph(ctx, font, gid, trm, aa); fz_glyph *glyph = NULL; @@ -920,10 +919,10 @@ fz_render_ft_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm /* Takes the freetype lock, and returns with it held */ static FT_Glyph -do_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *state, int aa) +do_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_matrix ctm, const fz_stroke_state *state, int aa) { FT_Face face = font->ft_face; - float expansion = fz_matrix_expansion(*ctm); + float expansion = fz_matrix_expansion(ctm); int linewidth = state->linewidth * expansion * 64 / 2; FT_Matrix m; FT_Vector v; @@ -932,19 +931,18 @@ do_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, const fz_mat FT_Glyph glyph; FT_Stroker_LineJoin line_join; FT_Stroker_LineCap line_cap; - fz_matrix local_trm = *trm; - fz_adjust_ft_glyph_width(ctx, font, gid, &local_trm); + fz_adjust_ft_glyph_width(ctx, font, gid, &trm); if (font->flags.fake_italic) - local_trm = fz_pre_shear(local_trm, SHEAR, 0); + trm = fz_pre_shear(trm, SHEAR, 0); - m.xx = local_trm.a * 64; /* should be 65536 */ - m.yx = local_trm.b * 64; - m.xy = local_trm.c * 64; - m.yy = local_trm.d * 64; - v.x = local_trm.e * 64; - v.y = local_trm.f * 64; + m.xx = trm.a * 64; /* should be 65536 */ + m.yx = trm.b * 64; + m.xy = trm.c * 64; + m.yy = trm.d * 64; + v.x = trm.e * 64; + v.y = trm.f * 64; fz_lock(ctx, FZ_LOCK_FREETYPE); fterr = FT_Set_Char_Size(face, 65536, 65536, 72, 72); /* should be 64, 64 */ @@ -1014,7 +1012,7 @@ do_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, const fz_mat } fz_pixmap * -fz_render_ft_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *state, int aa) +fz_render_ft_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_matrix ctm, const fz_stroke_state *state, int aa) { FT_Glyph glyph = do_render_ft_stroked_glyph(ctx, font, gid, trm, ctm, state, aa); FT_BitmapGlyph bitmap = (FT_BitmapGlyph)glyph; @@ -1044,7 +1042,7 @@ fz_render_ft_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const } fz_glyph * -fz_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *state, int aa) +fz_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_matrix ctm, const fz_stroke_state *state, int aa) { FT_Glyph glyph = do_render_ft_stroked_glyph(ctx, font, gid, trm, ctm, state, aa); FT_BitmapGlyph bitmap = (FT_BitmapGlyph)glyph; @@ -1089,19 +1087,19 @@ fz_bound_ft_glyph(fz_context *ctx, fz_font *font, int gid) const int scale = face->units_per_EM; const float recip = 1.0f / scale; const float strength = 0.02f; - fz_matrix local_trm = fz_identity; + fz_matrix trm = fz_identity; - fz_adjust_ft_glyph_width(ctx, font, gid, &local_trm); + fz_adjust_ft_glyph_width(ctx, font, gid, &trm); if (font->flags.fake_italic) - local_trm = fz_pre_shear(local_trm, SHEAR, 0); + trm = fz_pre_shear(trm, SHEAR, 0); - m.xx = local_trm.a * 65536; - m.yx = local_trm.b * 65536; - m.xy = local_trm.c * 65536; - m.yy = local_trm.d * 65536; - v.x = local_trm.e * 65536; - v.y = local_trm.f * 65536; + m.xx = trm.a * 65536; + m.yx = trm.b * 65536; + m.xy = trm.c * 65536; + m.yy = trm.d * 65536; + v.x = trm.e * 65536; + v.y = trm.f * 65536; fz_lock(ctx, FZ_LOCK_FREETYPE); /* Set the char size to scale=face->units_per_EM to effectively give @@ -1117,8 +1115,8 @@ fz_bound_ft_glyph(fz_context *ctx, fz_font *font, int gid) { fz_warn(ctx, "freetype load glyph (gid %d): %s", gid, ft_error_string(fterr)); fz_unlock(ctx, FZ_LOCK_FREETYPE); - bounds->x0 = bounds->x1 = local_trm.e; - bounds->y0 = bounds->y1 = local_trm.f; + bounds->x0 = bounds->x1 = trm.e; + bounds->y0 = bounds->y1 = trm.f; return bounds; } @@ -1137,8 +1135,8 @@ fz_bound_ft_glyph(fz_context *ctx, fz_font *font, int gid) if (fz_is_empty_rect(*bounds)) { - bounds->x0 = bounds->x1 = local_trm.e; - bounds->y0 = bounds->y1 = local_trm.f; + bounds->x0 = bounds->x1 = trm.e; + bounds->y0 = bounds->y1 = trm.f; } return bounds; @@ -1210,21 +1208,20 @@ static const FT_Outline_Funcs outline_funcs = { }; fz_path * -fz_outline_ft_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm) +fz_outline_ft_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm) { struct closure cc; FT_Face face = font->ft_face; int fterr; - fz_matrix local_trm = *trm; const int scale = face->units_per_EM; const float recip = 1.0f / scale; const float strength = 0.02f; - fz_adjust_ft_glyph_width(ctx, font, gid, &local_trm); + fz_adjust_ft_glyph_width(ctx, font, gid, &trm); if (font->flags.fake_italic) - local_trm = fz_pre_shear(local_trm, SHEAR, 0); + trm = fz_pre_shear(trm, SHEAR, 0); fz_lock(ctx, FZ_LOCK_FREETYPE); @@ -1247,7 +1244,7 @@ fz_outline_ft_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *tr { cc.ctx = ctx; cc.path = fz_new_path(ctx); - cc.trm = fz_concat(fz_scale(recip, recip), local_trm); + cc.trm = fz_concat(fz_scale(recip, recip), trm); fz_moveto(ctx, cc.path, cc.trm.e, cc.trm.f); FT_Outline_Decompose(&face->glyph->outline, &outline_funcs, &cc); fz_closepath(ctx, cc.path); @@ -1310,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) @@ -1354,7 +1351,7 @@ fz_prepare_t3_glyph(fz_context *ctx, fz_font *font, int gid, int nested_depth) FZ_DEVFLAG_LINEWIDTH_UNDEFINED; fz_try(ctx) { - font->t3run(ctx, font->t3doc, font->t3resources, contents, dev, &fz_identity, NULL, 0, NULL); + font->t3run(ctx, font->t3doc, font->t3resources, contents, dev, fz_identity, NULL, 0, NULL); fz_close_device(ctx, dev); font->t3flags[gid] = dev->flags; d1_rect = dev->d1_rect; @@ -1394,7 +1391,7 @@ fz_prepare_t3_glyph(fz_context *ctx, fz_font *font, int gid, int nested_depth) } void -fz_run_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, fz_device *dev) +fz_run_t3_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_device *dev) { fz_display_list *list; fz_matrix ctm; @@ -1403,12 +1400,12 @@ fz_run_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, f if (!list) return; - ctm = fz_concat(font->t3matrix, *trm); - fz_run_display_list(ctx, list, dev, &ctm, &fz_infinite_rect, NULL); + ctm = fz_concat(font->t3matrix, trm); + fz_run_display_list(ctx, list, dev, ctm, &fz_infinite_rect, NULL); } fz_pixmap * -fz_render_t3_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, fz_colorspace *model, const fz_irect *scissor, int aa) +fz_render_t3_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_colorspace *model, const fz_irect *scissor, int aa) { fz_display_list *list; fz_rect bounds; @@ -1441,7 +1438,7 @@ fz_render_t3_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matr model = NULL; /* Treat as masked */ } - bounds = fz_expand_rect(fz_bound_glyph(ctx, font, gid, *trm), 1); + bounds = fz_expand_rect(fz_bound_glyph(ctx, font, gid, trm), 1); bbox = fz_irect_from_rect(bounds); bbox = fz_intersect_irect(bbox, *scissor); @@ -1452,7 +1449,7 @@ fz_render_t3_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matr fz_try(ctx) { fz_clear_pixmap(ctx, glyph); - dev = fz_new_draw_device_type3(ctx, NULL, glyph); + dev = fz_new_draw_device_type3(ctx, fz_identity, glyph); fz_run_t3_glyph(ctx, font, gid, trm, dev); fz_close_device(ctx, dev); } @@ -1488,14 +1485,14 @@ fz_render_t3_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matr } fz_glyph * -fz_render_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, fz_colorspace *model, const fz_irect *scissor, int aa) +fz_render_t3_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_colorspace *model, const fz_irect *scissor, int aa) { fz_pixmap *pixmap = fz_render_t3_glyph_pixmap(ctx, font, gid, trm, model, scissor, aa); return fz_new_glyph_from_pixmap(ctx, pixmap); } void -fz_render_t3_glyph_direct(fz_context *ctx, fz_device *dev, fz_font *font, int gid, const fz_matrix *trm, void *gstate, int nested_depth, fz_default_colorspaces *def_cs) +fz_render_t3_glyph_direct(fz_context *ctx, fz_device *dev, fz_font *font, int gid, fz_matrix trm, void *gstate, int nested_depth, fz_default_colorspaces *def_cs) { fz_matrix ctm; void *contents; @@ -1520,8 +1517,8 @@ fz_render_t3_glyph_direct(fz_context *ctx, fz_device *dev, fz_font *font, int gi fz_warn(ctx, "type3 glyph doesn't specify masked or colored"); } - ctm = fz_concat(font->t3matrix, *trm); - font->t3run(ctx, font->t3doc, font->t3resources, contents, dev, &ctm, gstate, nested_depth, def_cs); + ctm = fz_concat(font->t3matrix, trm); + font->t3run(ctx, font->t3doc, font->t3resources, contents, dev, ctm, gstate, nested_depth, def_cs); } fz_rect @@ -1552,7 +1549,7 @@ fz_bound_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm) } fz_path * -fz_outline_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *ctm) +fz_outline_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm) { if (!font->ft_face) return NULL; diff --git a/source/fitz/glyph-cache-imp.h b/source/fitz/glyph-cache-imp.h index f6226ae4..df4e2d76 100644 --- a/source/fitz/glyph-cache-imp.h +++ b/source/fitz/glyph-cache-imp.h @@ -1,16 +1,16 @@ #ifndef MUPDF_FITZ_GLYPH_CACHE_IMP_H #define MUPDF_FITZ_GLYPH_CACHE_IMP_H -fz_path *fz_outline_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *ctm); -fz_path *fz_outline_ft_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm); -fz_glyph *fz_render_ft_glyph(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, int aa); -fz_pixmap *fz_render_ft_glyph_pixmap(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, int aa); -fz_glyph *fz_render_t3_glyph(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, fz_colorspace *model, const fz_irect *scissor, int aa); -fz_pixmap *fz_render_t3_glyph_pixmap(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, fz_colorspace *model, const fz_irect *scissor, int aa); -fz_glyph *fz_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *state, int aa); -fz_pixmap *fz_render_ft_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *state, int aa); +fz_path *fz_outline_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm); +fz_path *fz_outline_ft_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm); +fz_glyph *fz_render_ft_glyph(fz_context *ctx, fz_font *font, int cid, fz_matrix trm, int aa); +fz_pixmap *fz_render_ft_glyph_pixmap(fz_context *ctx, fz_font *font, int cid, fz_matrix trm, int aa); +fz_glyph *fz_render_t3_glyph(fz_context *ctx, fz_font *font, int cid, fz_matrix trm, fz_colorspace *model, const fz_irect *scissor, int aa); +fz_pixmap *fz_render_t3_glyph_pixmap(fz_context *ctx, fz_font *font, int cid, fz_matrix trm, fz_colorspace *model, const fz_irect *scissor, int aa); +fz_glyph *fz_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_matrix ctm, const fz_stroke_state *state, int aa); +fz_pixmap *fz_render_ft_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_matrix ctm, const fz_stroke_state *state, int aa); fz_glyph *fz_render_glyph(fz_context *ctx, fz_font*, int gid, fz_matrix *, fz_colorspace *model, const fz_irect *scissor, int alpha, int aa); -fz_glyph *fz_render_stroked_glyph(fz_context *ctx, fz_font*, int, fz_matrix *, const fz_matrix *, const fz_stroke_state *stroke, const fz_irect *scissor, int aa); -fz_pixmap *fz_render_stroked_glyph_pixmap(fz_context *ctx, fz_font*, int, fz_matrix *, const fz_matrix *, const fz_stroke_state *stroke, const fz_irect *scissor, int aa); +fz_glyph *fz_render_stroked_glyph(fz_context *ctx, fz_font*, int, fz_matrix *, fz_matrix , const fz_stroke_state *stroke, const fz_irect *scissor, int aa); +fz_pixmap *fz_render_stroked_glyph_pixmap(fz_context *ctx, fz_font*, int, fz_matrix *, fz_matrix , const fz_stroke_state *stroke, const fz_irect *scissor, int aa); #endif diff --git a/source/fitz/halftone.c b/source/fitz/halftone.c index c99653f6..05cbcf2e 100644 --- a/source/fitz/halftone.c +++ b/source/fitz/halftone.c @@ -156,11 +156,11 @@ typedef void (threshold_fn)(const unsigned char *ht_line, const unsigned char *p #ifdef ARCH_ARM static void -do_threshold_1(const unsigned char * FZ_RESTRICT ht_line, const unsigned char * FZ_RESTRICT pixmap, unsigned char *FZ_RESTRICT out, int w, int ht_len) +do_threshold_1(const unsigned char * FZ_RESTRICT ht_line, const unsigned char * FZ_RESTRICT pixmap, unsigned char * FZ_RESTRICT out, int w, int ht_len) __attribute__((naked)); static void -do_threshold_1(const unsigned char * FZ_RESTRICT ht_line, const unsigned char * FZ_RESTRICT pixmap, unsigned char *FZ_RESTRICT out, int w, int ht_len) +do_threshold_1(const unsigned char * FZ_RESTRICT ht_line, const unsigned char * FZ_RESTRICT pixmap, unsigned char * FZ_RESTRICT out, int w, int ht_len) { asm volatile( ENTER_ARM @@ -348,11 +348,11 @@ static void do_threshold_1(const unsigned char * FZ_RESTRICT ht_line, const unsi */ #ifdef ARCH_ARM static void -do_threshold_4(const unsigned char * FZ_RESTRICT ht_line, const unsigned char * FZ_RESTRICT pixmap, unsigned char *FZ_RESTRICT out, int w, int ht_len) +do_threshold_4(const unsigned char * FZ_RESTRICT ht_line, const unsigned char * FZ_RESTRICT pixmap, unsigned char * FZ_RESTRICT out, int w, int ht_len) __attribute__((naked)); static void -do_threshold_4(const unsigned char * FZ_RESTRICT ht_line, const unsigned char * FZ_RESTRICT pixmap, unsigned char *FZ_RESTRICT out, int w, int ht_len) +do_threshold_4(const unsigned char * FZ_RESTRICT ht_line, const unsigned char * FZ_RESTRICT pixmap, unsigned char * FZ_RESTRICT out, int w, int ht_len) { asm volatile( ENTER_ARM diff --git a/source/fitz/image.c b/source/fitz/image.c index 8cda9687..7936adf8 100644 --- a/source/fitz/image.c +++ b/source/fitz/image.c @@ -252,7 +252,7 @@ static void fz_adjust_image_subarea(fz_context *ctx, fz_image *image, fz_irect * subarea->y1 = image->h; } -static void fz_compute_image_key(fz_context *ctx, fz_image *image, const fz_matrix *ctm, +static void fz_compute_image_key(fz_context *ctx, fz_image *image, fz_matrix *ctm, fz_image_key *key, const fz_irect *subarea, int l2factor, int *w, int *h, int *dw, int *dh) { key->refs = 1; @@ -1142,10 +1142,10 @@ display_list_image_get_pixmap(fz_context *ctx, fz_image *image_, fz_irect *subar ctm = fz_pre_scale(image->transform, w, h); fz_clear_pixmap(ctx, pix); /* clear to transparent */ - dev = fz_new_draw_device(ctx, &ctm, pix); + 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, NULL, NULL); fz_close_device(ctx, dev); } fz_always(ctx) diff --git a/source/fitz/list-device.c b/source/fitz/list-device.c index 883d6383..88ad2110 100644 --- a/source/fitz/list-device.c +++ b/source/fitz/list-device.c @@ -661,10 +661,10 @@ fz_unpack_color_params(fz_color_params *color_params, int flags) } static void -fz_list_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const fz_matrix *ctm, +fz_list_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) { - fz_rect rect = fz_bound_path(ctx, path, NULL, *ctm); + fz_rect rect = fz_bound_path(ctx, path, NULL, ctm); fz_append_display_node( ctx, dev, @@ -675,7 +675,7 @@ fz_list_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even color, colorspace, &alpha, /* alpha */ - ctm, + &ctm, NULL, /* stroke_state */ NULL, /* private_data */ 0); /* private_data_len */ @@ -683,9 +683,9 @@ fz_list_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even static void fz_list_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, - const fz_matrix *ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params) + fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params) { - fz_rect rect = fz_bound_path(ctx, path, stroke, *ctm); + fz_rect rect = fz_bound_path(ctx, path, stroke, ctm); fz_append_display_node( ctx, dev, @@ -696,16 +696,16 @@ fz_list_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const color, colorspace, &alpha, /* alpha */ - ctm, /* ctm */ + &ctm, /* ctm */ stroke, NULL, /* private_data */ 0); /* private_data_len */ } static void -fz_list_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const 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, const fz_rect *scissor) { - fz_rect rect = fz_bound_path(ctx, path, NULL, *ctm); + fz_rect rect = fz_bound_path(ctx, path, NULL, ctm); if (scissor) rect = fz_intersect_rect(rect, *scissor); fz_append_display_node( @@ -718,16 +718,16 @@ fz_list_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even NULL, /* color */ NULL, /* colorspace */ NULL, /* alpha */ - ctm, /* ctm */ + &ctm, /* ctm */ NULL, /* stroke */ NULL, /* private_data */ 0); /* private_data_len */ } static void -fz_list_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, const 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, const fz_rect *scissor) { - fz_rect rect = fz_bound_path(ctx, path, stroke, *ctm); + fz_rect rect = fz_bound_path(ctx, path, stroke, ctm); if (scissor) rect = fz_intersect_rect(rect, *scissor); fz_append_display_node( @@ -740,20 +740,20 @@ fz_list_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, c NULL, /* color */ NULL, /* colorspace */ NULL, /* alpha */ - ctm, /* ctm */ + &ctm, /* ctm */ stroke, /* stroke */ NULL, /* private_data */ 0); /* private_data_len */ } static void -fz_list_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm, +fz_list_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) { fz_text *cloned_text = fz_keep_text(ctx, text); fz_try(ctx) { - fz_rect rect = fz_bound_text(ctx, text, NULL, *ctm); + fz_rect rect = fz_bound_text(ctx, text, NULL, ctm); fz_append_display_node( ctx, dev, @@ -764,7 +764,7 @@ fz_list_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz color, /* color */ colorspace, /* colorspace */ &alpha, /* alpha */ - ctm, /* ctm */ + &ctm, /* ctm */ NULL, /* stroke */ &cloned_text, /* private_data */ sizeof(cloned_text)); /* private_data_len */ @@ -777,13 +777,13 @@ fz_list_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz } static void -fz_list_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm, +fz_list_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) { fz_text *cloned_text = fz_keep_text(ctx, text); fz_try(ctx) { - fz_rect rect = fz_bound_text(ctx, text, stroke, *ctm); + fz_rect rect = fz_bound_text(ctx, text, stroke, ctm); fz_append_display_node( ctx, dev, @@ -794,7 +794,7 @@ fz_list_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const color, /* color */ colorspace, /* colorspace */ &alpha, /* alpha */ - ctm, /* ctm */ + &ctm, /* ctm */ stroke, &cloned_text, /* private_data */ sizeof(cloned_text)); /* private_data_len */ @@ -807,12 +807,12 @@ 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, const fz_matrix *ctm, const fz_rect *scissor) +fz_list_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const 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); + fz_rect rect = fz_bound_text(ctx, text, NULL, ctm); if (scissor) rect = fz_intersect_rect(rect, *scissor); fz_append_display_node( @@ -825,7 +825,7 @@ fz_list_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz NULL, /* color */ NULL, /* colorspace */ NULL, /* alpha */ - ctm, /* ctm */ + &ctm, /* ctm */ NULL, /* stroke */ &cloned_text, /* private_data */ sizeof(cloned_text)); /* private_data_len */ @@ -838,12 +838,12 @@ fz_list_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz } static void -fz_list_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const 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, const 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); + fz_rect rect = fz_bound_text(ctx, text, stroke, ctm); if (scissor) rect = fz_intersect_rect(rect, *scissor); fz_append_display_node( @@ -856,7 +856,7 @@ fz_list_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, c NULL, /* color */ NULL, /* colorspace */ NULL, /* alpha */ - ctm, /* ctm */ + &ctm, /* ctm */ stroke, /* stroke */ &cloned_text, /* private_data */ sizeof(cloned_text)); /* private_data_len */ @@ -869,12 +869,12 @@ fz_list_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, c } static void -fz_list_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm) +fz_list_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm) { fz_text *cloned_text = fz_keep_text(ctx, text); fz_try(ctx) { - fz_rect rect = fz_bound_text(ctx, text, NULL, *ctm); + fz_rect rect = fz_bound_text(ctx, text, NULL, ctm); fz_append_display_node( ctx, dev, @@ -885,7 +885,7 @@ fz_list_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, const NULL, /* color */ NULL, /* colorspace */ NULL, /* alpha */ - ctm, /* ctm */ + &ctm, /* ctm */ NULL, /* stroke */ &cloned_text, /* private_data */ sizeof(cloned_text)); /* private_data_len */ @@ -917,12 +917,12 @@ fz_list_pop_clip(fz_context *ctx, fz_device *dev) } static void -fz_list_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha, const fz_color_params *color_params) +fz_list_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, fz_matrix ctm, float alpha, const fz_color_params *color_params) { fz_shade *shade2 = fz_keep_shade(ctx, shade); fz_try(ctx) { - fz_rect rect = fz_bound_shade(ctx, shade, *ctm); + fz_rect rect = fz_bound_shade(ctx, shade, ctm); fz_append_display_node( ctx, dev, @@ -933,7 +933,7 @@ fz_list_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_ma NULL, /* color */ NULL, /* colorspace */ &alpha, /* alpha */ - ctm, + &ctm, /* ctm */ NULL, /* stroke */ &shade2, /* private_data */ sizeof(shade2)); /* private_data_len */ @@ -946,12 +946,12 @@ fz_list_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_ma } static void -fz_list_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha, const fz_color_params *color_params) +fz_list_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, float alpha, const fz_color_params *color_params) { fz_image *image2 = fz_keep_image(ctx, image); fz_try(ctx) { - fz_rect rect = fz_transform_rect(fz_unit_rect, *ctm); + fz_rect rect = fz_transform_rect(fz_unit_rect, ctm); fz_append_display_node( ctx, dev, @@ -962,7 +962,7 @@ fz_list_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_ma NULL, /* color */ NULL, /* colorspace */ &alpha, /* alpha */ - ctm, + &ctm, /* ctm */ NULL, /* stroke */ &image2, /* private_data */ sizeof(image2)); /* private_data_len */ @@ -975,14 +975,14 @@ fz_list_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_ma } static void -fz_list_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, +fz_list_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) { fz_image *image2 = fz_keep_image(ctx, image); fz_try(ctx) { - fz_rect rect = fz_transform_rect(fz_unit_rect, *ctm); + fz_rect rect = fz_transform_rect(fz_unit_rect, ctm); fz_append_display_node( ctx, dev, @@ -993,7 +993,7 @@ fz_list_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const color, colorspace, &alpha, /* alpha */ - ctm, + &ctm, /* ctm */ NULL, /* stroke */ &image2, /* private_data */ sizeof(image2)); /* private_data_len */ @@ -1006,12 +1006,12 @@ fz_list_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const } static void -fz_list_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, const fz_rect *scissor) +fz_list_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, const fz_rect *scissor) { fz_image *image2 = fz_keep_image(ctx, image); fz_try(ctx) { - fz_rect rect = fz_transform_rect(fz_unit_rect, *ctm); + fz_rect rect = fz_transform_rect(fz_unit_rect, ctm); if (scissor) rect = fz_intersect_rect(rect, *scissor); fz_append_display_node( @@ -1024,7 +1024,7 @@ fz_list_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const NULL, /* color */ NULL, /* colorspace */ NULL, /* alpha */ - ctm, + &ctm, /* ctm */ NULL, /* stroke */ &image2, /* private_data */ sizeof(image2)); /* private_data_len */ @@ -1141,7 +1141,7 @@ 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, const fz_matrix *ctm, int id) +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_tile_data tile; @@ -1159,7 +1159,7 @@ fz_list_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const f NULL, /* color */ NULL, /* colorspace */ NULL, /* alpha */ - ctm, + &ctm, /* ctm */ NULL, /* stroke */ &tile, /* private_data */ sizeof(tile)); /* private_data_len */ @@ -1476,7 +1476,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, const 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, const fz_rect *scissor, fz_cookie *cookie) { fz_display_node *node; fz_display_node *node_end; @@ -1656,7 +1656,7 @@ fz_run_display_list(fz_context *ctx, fz_display_list *list, fz_device *dev, cons continue; } - trans_rect = fz_transform_rect(rect, *top_ctm); + trans_rect = fz_transform_rect(rect, top_ctm); /* cull objects to draw using a quick visibility test */ @@ -1701,7 +1701,7 @@ fz_run_display_list(fz_context *ctx, fz_display_list *list, fz_device *dev, cons } visible: - trans_ctm = fz_concat(ctm, *top_ctm); + trans_ctm = fz_concat(ctm, top_ctm); fz_try(ctx) { @@ -1709,49 +1709,49 @@ visible: { case FZ_CMD_FILL_PATH: fz_unpack_color_params(&color_params, n.flags); - fz_fill_path(ctx, dev, path, n.flags & 1, &trans_ctm, colorspace, color, alpha, &color_params); + fz_fill_path(ctx, dev, path, n.flags & 1, trans_ctm, colorspace, color, alpha, &color_params); break; case FZ_CMD_STROKE_PATH: fz_unpack_color_params(&color_params, n.flags); - fz_stroke_path(ctx, dev, path, stroke, &trans_ctm, colorspace, color, alpha, &color_params); + 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); - fz_fill_text(ctx, dev, *(fz_text **)node, &trans_ctm, colorspace, color, alpha, &color_params); + fz_fill_text(ctx, dev, *(fz_text **)node, trans_ctm, colorspace, color, alpha, &color_params); break; case FZ_CMD_STROKE_TEXT: fz_unpack_color_params(&color_params, n.flags); - fz_stroke_text(ctx, dev, *(fz_text **)node, stroke, &trans_ctm, colorspace, color, alpha, &color_params); + 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); + fz_ignore_text(ctx, dev, *(fz_text **)node, trans_ctm); break; case FZ_CMD_FILL_SHADE: fz_unpack_color_params(&color_params, n.flags); - fz_fill_shade(ctx, dev, *(fz_shade **)node, &trans_ctm, alpha, &color_params); + fz_fill_shade(ctx, dev, *(fz_shade **)node, trans_ctm, alpha, &color_params); break; case FZ_CMD_FILL_IMAGE: fz_unpack_color_params(&color_params, n.flags); - fz_fill_image(ctx, dev, *(fz_image **)node, &trans_ctm, alpha, &color_params); + fz_fill_image(ctx, dev, *(fz_image **)node, trans_ctm, alpha, &color_params); break; case FZ_CMD_FILL_IMAGE_MASK: fz_unpack_color_params(&color_params, n.flags); - fz_fill_image_mask(ctx, dev, *(fz_image **)node, &trans_ctm, colorspace, color, alpha, &color_params); + 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); @@ -1776,7 +1776,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/paint-glyph.h b/source/fitz/paint-glyph.h index cb0d0340..263e9628 100644 --- a/source/fitz/paint-glyph.h +++ b/source/fitz/paint-glyph.h @@ -35,9 +35,9 @@ FUNCTION_NAME(NAME,N,NAME2,NAME3)(const unsigned char * FZ_RESTRICT colorbv, #ifndef N const int n1, #endif - int span, unsigned char * FZ_RESTRICT dp, const fz_glyph * FZ_RESTRICT glyph, int w, int h, int skip_x, int skip_y + int span, unsigned char * FZ_RESTRICT dp, const fz_glyph *glyph, int w, int h, int skip_x, int skip_y #ifdef EOP - , const fz_overprint * FZ_RESTRICT eop + , const fz_overprint *eop #endif ) { diff --git a/source/fitz/stext-device.c b/source/fitz/stext-device.c index a4a8d002..346d9bc2 100644 --- a/source/fitz/stext-device.c +++ b/source/fitz/stext-device.c @@ -91,13 +91,13 @@ add_text_block_to_page(fz_context *ctx, fz_stext_page *page) } static fz_stext_block * -add_image_block_to_page(fz_context *ctx, fz_stext_page *page, const fz_matrix *ctm, fz_image *image) +add_image_block_to_page(fz_context *ctx, fz_stext_page *page, fz_matrix ctm, fz_image *image) { fz_stext_block *block = add_block_to_page(ctx, page); block->type = FZ_STEXT_BLOCK_IMAGE; - block->u.i.transform = *ctm; + block->u.i.transform = ctm; block->u.i.image = fz_keep_image(ctx, image); - block->bbox = fz_transform_rect(fz_unit_rect, *ctm); + block->bbox = fz_transform_rect(fz_unit_rect, ctm); return block; } @@ -494,61 +494,61 @@ fz_stext_extract(fz_context *ctx, fz_stext_device *dev, fz_text_span *span, fz_m } static void -fz_stext_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm, +fz_stext_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) { fz_stext_device *tdev = (fz_stext_device*)dev; fz_text_span *span; tdev->new_obj = 1; for (span = text->head; span; span = span->next) - fz_stext_extract(ctx, tdev, span, *ctm); + fz_stext_extract(ctx, tdev, span, ctm); } static void -fz_stext_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm, +fz_stext_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) { fz_stext_device *tdev = (fz_stext_device*)dev; fz_text_span *span; tdev->new_obj = 1; for (span = text->head; span; span = span->next) - fz_stext_extract(ctx, tdev, span, *ctm); + fz_stext_extract(ctx, tdev, span, ctm); } static void -fz_stext_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm, const fz_rect *scissor) +fz_stext_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor) { fz_stext_device *tdev = (fz_stext_device*)dev; fz_text_span *span; tdev->new_obj = 1; for (span = text->head; span; span = span->next) - fz_stext_extract(ctx, tdev, span, *ctm); + fz_stext_extract(ctx, tdev, span, ctm); } static void -fz_stext_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const 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, const fz_rect *scissor) { fz_stext_device *tdev = (fz_stext_device*)dev; fz_text_span *span; tdev->new_obj = 1; for (span = text->head; span; span = span->next) - fz_stext_extract(ctx, tdev, span, *ctm); + fz_stext_extract(ctx, tdev, span, ctm); } static void -fz_stext_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm) +fz_stext_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm) { fz_stext_device *tdev = (fz_stext_device*)dev; fz_text_span *span; tdev->new_obj = 1; for (span = text->head; span; span = span->next) - fz_stext_extract(ctx, tdev, span, *ctm); + fz_stext_extract(ctx, tdev, span, ctm); } /* Images and shadings */ static void -fz_stext_fill_image(fz_context *ctx, fz_device *dev, fz_image *img, const fz_matrix *ctm, float alpha, const fz_color_params *color_params) +fz_stext_fill_image(fz_context *ctx, fz_device *dev, fz_image *img, fz_matrix ctm, float alpha, const fz_color_params *color_params) { fz_stext_device *tdev = (fz_stext_device*)dev; @@ -560,7 +560,7 @@ fz_stext_fill_image(fz_context *ctx, fz_device *dev, fz_image *img, const fz_mat } static void -fz_stext_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *img, const fz_matrix *ctm, +fz_stext_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *img, fz_matrix ctm, fz_colorspace *cspace, const float *color, float alpha, const fz_color_params *color_params) { fz_stext_fill_image(ctx, dev, img, ctm, alpha, color_params); @@ -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) @@ -604,13 +604,13 @@ fz_new_image_from_shade(fz_context *ctx, fz_shade *shade, fz_matrix *in_out_ctm, } static void -fz_stext_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha, const fz_color_params *color_params) +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; + fz_matrix local_ctm = ctm; const 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); + fz_stext_fill_image(ctx, dev, image, local_ctm, alpha, color_params); fz_always(ctx) fz_drop_image(ctx, image); fz_catch(ctx) diff --git a/source/fitz/svg-device.c b/source/fitz/svg-device.c index 28f3a4d6..ec3441a3 100644 --- a/source/fitz/svg-device.c +++ b/source/fitz/svg-device.c @@ -156,24 +156,24 @@ svg_dev_path(fz_context *ctx, svg_device *sdev, const fz_path *path) } static void -svg_dev_ctm(fz_context *ctx, svg_device *sdev, const fz_matrix *ctm) +svg_dev_ctm(fz_context *ctx, svg_device *sdev, fz_matrix ctm) { fz_output *out = sdev->out; - if (ctm->a != 1.0f || ctm->b != 0 || ctm->c != 0 || ctm->d != 1.0f || ctm->e != 0 || ctm->f != 0) + if (ctm.a != 1.0f || ctm.b != 0 || ctm.c != 0 || ctm.d != 1.0f || ctm.e != 0 || ctm.f != 0) { fz_write_printf(ctx, out, " transform=\"matrix(%g,%g,%g,%g,%g,%g)\"", - ctm->a, ctm->b, ctm->c, ctm->d, ctm->e, ctm->f); + ctm.a, ctm.b, ctm.c, ctm.d, ctm.e, ctm.f); } } static void -svg_dev_stroke_state(fz_context *ctx, svg_device *sdev, const fz_stroke_state *stroke_state, const fz_matrix *ctm) +svg_dev_stroke_state(fz_context *ctx, svg_device *sdev, const fz_stroke_state *stroke_state, fz_matrix ctm) { fz_output *out = sdev->out; float exp; - exp = fz_matrix_expansion(*ctm); + exp = fz_matrix_expansion(ctm); if (exp == 0) exp = 1; exp = stroke_state->linewidth/exp; @@ -313,7 +313,7 @@ svg_cluster_advance(fz_context *ctx, const fz_text_span *span, int i, int end) } static void -svg_dev_text_span(fz_context *ctx, svg_device *sdev, const fz_matrix *ctm, const fz_text_span *span) +svg_dev_text_span(fz_context *ctx, svg_device *sdev, fz_matrix ctm, const fz_text_span *span) { fz_output *out = sdev->out; char font_family[100]; @@ -340,7 +340,7 @@ svg_dev_text_span(fz_context *ctx, svg_device *sdev, const fz_matrix *ctm, const final_tm.e = 0; final_tm.f = 0; inv_tm = fz_invert_matrix(final_tm); - final_tm = fz_concat(final_tm, *ctm); + final_tm = fz_concat(final_tm, ctm); tm.e = span->items[0].x; tm.f = span->items[0].y; @@ -419,7 +419,7 @@ svg_dev_text_span(fz_context *ctx, svg_device *sdev, const fz_matrix *ctm, const } static font * -svg_dev_text_span_as_paths_defs(fz_context *ctx, fz_device *dev, fz_text_span *span, const fz_matrix *ctm) +svg_dev_text_span_as_paths_defs(fz_context *ctx, fz_device *dev, fz_text_span *span, fz_matrix ctm) { svg_device *sdev = (svg_device*)dev; fz_output *out = sdev->out; @@ -473,7 +473,7 @@ svg_dev_text_span_as_paths_defs(fz_context *ctx, fz_device *dev, fz_text_span *s /* Need to send this one */ fz_rect rect; fz_path *path; - path = fz_outline_glyph(ctx, span->font, gid, &fz_identity); + path = fz_outline_glyph(ctx, span->font, gid, fz_identity); if (path) { rect = fz_bound_path(ctx, path, NULL, fz_identity); @@ -494,7 +494,7 @@ svg_dev_text_span_as_paths_defs(fz_context *ctx, fz_device *dev, fz_text_span *s shift.f = -rect.y0; out = start_def(ctx, sdev); fz_write_printf(ctx, out, "<symbol id=\"font_%x_%x\">\n", fnt->id, gid); - fz_run_t3_glyph(ctx, span->font, gid, &shift, dev); + fz_run_t3_glyph(ctx, span->font, gid, shift, dev); } fz_write_printf(ctx, out, "</symbol>\n"); out = end_def(ctx, sdev); @@ -506,40 +506,38 @@ svg_dev_text_span_as_paths_defs(fz_context *ctx, fz_device *dev, fz_text_span *s } static void -svg_dev_text_span_as_paths_fill(fz_context *ctx, fz_device *dev, const fz_text_span *span, const fz_matrix *ctm, +svg_dev_text_span_as_paths_fill(fz_context *ctx, fz_device *dev, const fz_text_span *span, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, font *fnt, const fz_color_params *color_params) { svg_device *sdev = (svg_device*)dev; fz_output *out = sdev->out; - - fz_matrix local_trm, local_trm2; - int i; fz_matrix shift = { 1, 0, 0, 1, 0, 0}; + fz_matrix trm, mtx; + int i; /* Rely on the fact that trm.{e,f} == 0 */ - local_trm.a = span->trm.a; - local_trm.b = span->trm.b; - local_trm.c = span->trm.c; - local_trm.d = span->trm.d; - local_trm.e = 0; - local_trm.f = 0; + trm.a = span->trm.a; + trm.b = span->trm.b; + trm.c = span->trm.c; + trm.d = span->trm.d; + trm.e = 0; + trm.f = 0; for (i=0; i < span->len; i++) { fz_text_item *it = &span->items[i]; int gid = it->gid; - if (gid < 0) continue; shift.e = fnt->sentlist[gid].x_off; shift.f = fnt->sentlist[gid].y_off; - local_trm.e = it->x; - local_trm.f = it->y; - local_trm2 = fz_concat(local_trm, *ctm); - local_trm2 = fz_concat(shift, local_trm2); + trm.e = it->x; + trm.f = it->y; + mtx = fz_concat(shift, fz_concat(trm, ctm)); + fz_write_printf(ctx, out, "<use xlink:href=\"#font_%x_%x\"", fnt->id, gid); - svg_dev_ctm(ctx, sdev, &local_trm2); + svg_dev_ctm(ctx, sdev, mtx); svg_dev_fill_color(ctx, sdev, colorspace, color, alpha, color_params); fz_write_printf(ctx, out, "/>\n"); } @@ -547,40 +545,39 @@ svg_dev_text_span_as_paths_fill(fz_context *ctx, fz_device *dev, const fz_text_s static void svg_dev_text_span_as_paths_stroke(fz_context *ctx, fz_device *dev, const fz_text_span *span, - const fz_stroke_state *stroke, const fz_matrix *ctm, + const fz_stroke_state *stroke, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, font *fnt, const fz_color_params *color_params) { svg_device *sdev = (svg_device*)dev; fz_output *out = sdev->out; - fz_matrix local_trm, local_trm2; - int i; fz_matrix shift = { 1, 0, 0, 1, 0, 0}; + fz_matrix trm, mtx; + int i; /* Rely on the fact that trm.{e,f} == 0 */ - local_trm.a = span->trm.a; - local_trm.b = span->trm.b; - local_trm.c = span->trm.c; - local_trm.d = span->trm.d; - local_trm.e = 0; - local_trm.f = 0; + trm.a = span->trm.a; + trm.b = span->trm.b; + trm.c = span->trm.c; + trm.d = span->trm.d; + trm.e = 0; + trm.f = 0; for (i=0; i < span->len; i++) { fz_text_item *it = &span->items[i]; int gid = it->gid; - if (gid < 0) continue; shift.e = fnt->sentlist[gid].x_off; shift.f = fnt->sentlist[gid].y_off; - local_trm.e = it->x; - local_trm.f = it->y; - local_trm2 = fz_concat(local_trm, *ctm); - local_trm2 = fz_concat(shift, local_trm2); + trm.e = it->x; + trm.f = it->y; + mtx = fz_concat(shift, fz_concat(trm, ctm)); + fz_write_printf(ctx, out, "<use xlink:href=\"#font_%x_%x\"", fnt->id, gid); - svg_dev_stroke_state(ctx, sdev, stroke, &local_trm2); - svg_dev_ctm(ctx, sdev, &local_trm2); + svg_dev_stroke_state(ctx, sdev, stroke, mtx); + svg_dev_ctm(ctx, sdev, mtx); svg_dev_stroke_color(ctx, sdev, colorspace, color, alpha, color_params); fz_write_printf(ctx, out, "/>\n"); } @@ -589,7 +586,7 @@ svg_dev_text_span_as_paths_stroke(fz_context *ctx, fz_device *dev, const fz_text /* Entry points */ static void -svg_dev_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const fz_matrix *ctm, +svg_dev_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) { svg_device *sdev = (svg_device*)dev; @@ -605,7 +602,7 @@ svg_dev_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even } static void -svg_dev_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, +svg_dev_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) { svg_device *sdev = (svg_device*)dev; @@ -613,14 +610,14 @@ svg_dev_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_write_printf(ctx, out, "<path"); svg_dev_ctm(ctx, sdev, ctm); - svg_dev_stroke_state(ctx, sdev, stroke, &fz_identity); + svg_dev_stroke_state(ctx, sdev, stroke, fz_identity); svg_dev_stroke_color(ctx, sdev, colorspace, color, alpha, color_params); svg_dev_path(ctx, sdev, path); fz_write_printf(ctx, out, "/>\n"); } static void -svg_dev_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const 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, const fz_rect *scissor) { svg_device *sdev = (svg_device*)dev; fz_output *out; @@ -640,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, const 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, const fz_rect *scissor) { svg_device *sdev = (svg_device*)dev; @@ -649,14 +646,14 @@ svg_dev_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, c int num = sdev->id++; float white[3] = { 1, 1, 1 }; - bounds = fz_bound_path(ctx, path, stroke, *ctm); + bounds = fz_bound_path(ctx, path, stroke, ctm); out = start_def(ctx, sdev); fz_write_printf(ctx, out, "<mask id=\"ma%d\" x=\"%g\" y=\"%g\" width=\"%g\" height=\"%g\" maskUnits=\"userSpaceOnUse\" maskContentUnits=\"userSpaceOnUse\">\n", num, bounds.x0, bounds.y0, bounds.x1 - bounds.x0, bounds.y1 - bounds.y0); fz_write_printf(ctx, out, "<path"); svg_dev_ctm(ctx, sdev, ctm); - svg_dev_stroke_state(ctx, sdev, stroke, &fz_identity); + svg_dev_stroke_state(ctx, sdev, stroke, fz_identity); svg_dev_stroke_color(ctx, sdev, fz_device_rgb(ctx), white, 1, NULL); svg_dev_path(ctx, sdev, path); fz_write_printf(ctx, out, "/>\n</mask>\n"); @@ -665,7 +662,7 @@ svg_dev_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, c } static void -svg_dev_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm, +svg_dev_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) { svg_device *sdev = (svg_device*)dev; @@ -693,7 +690,7 @@ svg_dev_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz } static void -svg_dev_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm, +svg_dev_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) { svg_device *sdev = (svg_device*)dev; @@ -721,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, const fz_matrix *ctm, const fz_rect *scissor) +svg_dev_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor) { svg_device *sdev = (svg_device*)dev; fz_output *out = sdev->out; @@ -732,7 +729,7 @@ svg_dev_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz font *fnt; fz_text_span *span; - bounds = fz_bound_text(ctx, text, NULL, *ctm); + bounds = fz_bound_text(ctx, text, NULL, ctm); out = start_def(ctx, sdev); fz_write_printf(ctx, out, "<mask id=\"ma%d\" x=\"%g\" y=\"%g\" width=\"%g\" height=\"%g\"", @@ -761,7 +758,7 @@ svg_dev_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz } static void -svg_dev_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const 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, const fz_rect *scissor) { svg_device *sdev = (svg_device*)dev; @@ -772,7 +769,7 @@ svg_dev_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, c font *fnt; fz_text_span *span; - bounds = fz_bound_text(ctx, text, NULL, *ctm); + bounds = fz_bound_text(ctx, text, NULL, ctm); out = start_def(ctx, sdev); fz_write_printf(ctx, out, "<mask id=\"ma%d\" x=\"%g\" y=\"%g\" width=\"%g\" height=\"%g\"", @@ -783,7 +780,7 @@ svg_dev_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, c for (span = text->head; span; span = span->next) { fz_write_printf(ctx, out, "<text"); - svg_dev_stroke_state(ctx, sdev, stroke, &fz_identity); + svg_dev_stroke_state(ctx, sdev, stroke, fz_identity); svg_dev_stroke_color(ctx, sdev, fz_device_rgb(ctx), white, 1, NULL); svg_dev_text_span(ctx, sdev, ctm, span); } @@ -802,7 +799,7 @@ svg_dev_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, c } static void -svg_dev_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm) +svg_dev_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm) { svg_device *sdev = (svg_device*)dev; fz_output *out = sdev->out; @@ -879,29 +876,29 @@ svg_send_image(fz_context *ctx, svg_device *sdev, fz_image *img, const fz_color_ } static void -svg_dev_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha, const fz_color_params *color_params) +svg_dev_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, float alpha, const fz_color_params *color_params) { svg_device *sdev = (svg_device*)dev; fz_output *out = sdev->out; - fz_matrix local_ctm = *ctm; + fz_matrix local_ctm = ctm; fz_matrix scale = { 0 }; scale.a = 1.0f / image->w; scale.d = 1.0f / image->h; - local_ctm = fz_concat(scale, *ctm); + local_ctm = fz_concat(scale, ctm); fz_write_printf(ctx, out, "<g"); if (alpha != 1.0f) fz_write_printf(ctx, out, " opacity=\"%g\"", alpha); - svg_dev_ctm(ctx, sdev, &local_ctm); + svg_dev_ctm(ctx, sdev, local_ctm); fz_write_printf(ctx, out, ">\n"); svg_send_image(ctx, sdev, image, color_params); fz_write_printf(ctx, out, "</g>\n"); } static void -svg_dev_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha, const fz_color_params *color_params) +svg_dev_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, fz_matrix ctm, float alpha, const fz_color_params *color_params) { svg_device *sdev = (svg_device*)dev; fz_output *out = sdev->out; @@ -914,7 +911,7 @@ svg_dev_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_ma if (dev->container_len == 0) return; - bbox = fz_round_rect(fz_intersect_rect(fz_bound_shade(ctx, shade, *ctm), dev->container[dev->container_len-1].scissor)); + bbox = fz_round_rect(fz_intersect_rect(fz_bound_shade(ctx, shade, ctm), dev->container[dev->container_len-1].scissor)); if (fz_is_empty_irect(bbox)) return; pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb(ctx), bbox, NULL, 1); @@ -944,19 +941,19 @@ svg_dev_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_ma } static void -svg_dev_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, +svg_dev_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) { svg_device *sdev = (svg_device*)dev; fz_output *out; - fz_matrix local_ctm = *ctm; + fz_matrix local_ctm = ctm; fz_matrix scale = { 0 }; int mask = sdev->id++; scale.a = 1.0f / image->w; scale.d = 1.0f / image->h; - local_ctm = fz_concat(scale, *ctm); + local_ctm = fz_concat(scale, ctm); out = start_def(ctx, sdev); fz_write_printf(ctx, out, "<mask id=\"ma%d\">\n", mask); svg_send_image(ctx, sdev, image, color_params); @@ -964,26 +961,26 @@ svg_dev_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const out = end_def(ctx, sdev); fz_write_printf(ctx, out, "<rect x=\"0\" y=\"0\" width=\"%d\" height=\"%d\"", image->w, image->h); svg_dev_fill_color(ctx, sdev, colorspace, color, alpha, color_params); - svg_dev_ctm(ctx, sdev, &local_ctm); + svg_dev_ctm(ctx, sdev, local_ctm); fz_write_printf(ctx, out, " mask=\"url(#ma%d)\"/>\n", mask); } static void -svg_dev_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, const fz_rect *scissor) +svg_dev_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, const fz_rect *scissor) { svg_device *sdev = (svg_device*)dev; fz_output *out; - fz_matrix local_ctm = *ctm; + fz_matrix local_ctm = ctm; fz_matrix scale = { 0 }; int mask = sdev->id++; scale.a = 1.0f / image->w; scale.d = 1.0f / image->h; - local_ctm = fz_concat(scale, *ctm); + local_ctm = fz_concat(scale, ctm); out = start_def(ctx, sdev); fz_write_printf(ctx, out, "<mask id=\"ma%d\">\n<g", mask); - svg_dev_ctm(ctx, sdev, &local_ctm); + svg_dev_ctm(ctx, sdev, local_ctm); fz_write_printf(ctx, out, ">\n"); svg_send_image(ctx, sdev, image, NULL/* FIXME */); fz_write_printf(ctx, out, "</g>\n</mask>\n"); @@ -1053,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, const fz_matrix *ctm, int id) +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_device *sdev = (svg_device*)dev; fz_output *out; @@ -1071,7 +1068,7 @@ svg_dev_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const f t = &sdev->tiles[num]; t->area = *area; t->view = *view; - t->ctm = *ctm; + t->ctm = ctm; t->pattern = sdev->id++; t->step.x = xstep; t->step.y = ystep; @@ -1140,7 +1137,7 @@ svg_dev_end_tile(fz_context *ctx, fz_device *dev) * undo the current one to allow for this */ inverse = fz_invert_matrix(t->ctm); fz_write_printf(ctx, out, "<g"); - svg_dev_ctm(ctx, sdev, &inverse); + svg_dev_ctm(ctx, sdev, inverse); fz_write_printf(ctx, out, ">\n"); w = t->view.x1 - t->view.x0; @@ -1158,7 +1155,7 @@ svg_dev_end_tile(fz_context *ctx, fz_device *dev) /* Finally, fill a rectangle with the pattern. */ fz_write_printf(ctx, out, "<rect"); - svg_dev_ctm(ctx, sdev, &t->ctm); + svg_dev_ctm(ctx, sdev, t->ctm); fz_write_printf(ctx, out, " fill=\"url(#pa%d)\" x=\"%g\" y=\"%g\" width=\"%g\" height=\"%g\"/>\n", t->pattern, t->area.x0, t->area.y0, t->area.x1 - t->area.x0, t->area.y1 - t->area.y0); } diff --git a/source/fitz/test-device.c b/source/fitz/test-device.c index 6eb1709e..ce8923a4 100644 --- a/source/fitz/test-device.c +++ b/source/fitz/test-device.c @@ -61,7 +61,7 @@ fz_test_color(fz_context *ctx, fz_test_device *t, fz_colorspace *colorspace, con } static void -fz_test_fill_path(fz_context *ctx, fz_device *dev_, const fz_path *path, int even_odd, const fz_matrix *ctm, +fz_test_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) { fz_test_device *dev = (fz_test_device*)dev_; @@ -78,7 +78,7 @@ fz_test_fill_path(fz_context *ctx, fz_device *dev_, const fz_path *path, int eve static void fz_test_stroke_path(fz_context *ctx, fz_device *dev_, const fz_path *path, const fz_stroke_state *stroke, - const fz_matrix *ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params) + fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params) { fz_test_device *dev = (fz_test_device*)dev_; @@ -93,7 +93,7 @@ fz_test_stroke_path(fz_context *ctx, fz_device *dev_, const fz_path *path, const } static void -fz_test_fill_text(fz_context *ctx, fz_device *dev_, const fz_text *text, const fz_matrix *ctm, +fz_test_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) { fz_test_device *dev = (fz_test_device*)dev_; @@ -110,7 +110,7 @@ fz_test_fill_text(fz_context *ctx, fz_device *dev_, const fz_text *text, const f static void fz_test_stroke_text(fz_context *ctx, fz_device *dev_, const fz_text *text, const fz_stroke_state *stroke, - const fz_matrix *ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params) + fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params) { fz_test_device *dev = (fz_test_device*)dev_; @@ -142,7 +142,7 @@ prepare_vertex(fz_context *ctx, void *arg_, fz_vertex *v, const float *color) } static void -fz_test_fill_shade(fz_context *ctx, fz_device *dev_, fz_shade *shade, const fz_matrix *ctm, float alpha, const fz_color_params *color_params) +fz_test_fill_shade(fz_context *ctx, fz_device *dev_, fz_shade *shade, fz_matrix ctm, float alpha, const fz_color_params *color_params) { fz_test_device *dev = (fz_test_device*)dev_; @@ -177,7 +177,7 @@ fz_test_fill_shade(fz_context *ctx, fz_device *dev_, fz_shade *shade, const fz_m arg.dev = dev; arg.shade = shade; arg.color_params = color_params; - fz_process_shade(ctx, shade, *ctm, prepare_vertex, NULL, &arg); + fz_process_shade(ctx, shade, ctm, prepare_vertex, NULL, &arg); } } } @@ -186,7 +186,7 @@ fz_test_fill_shade(fz_context *ctx, fz_device *dev_, fz_shade *shade, const fz_m } static void -fz_test_fill_image(fz_context *ctx, fz_device *dev_, fz_image *image, const fz_matrix *ctm, float alpha, const fz_color_params *color_params) +fz_test_fill_image(fz_context *ctx, fz_device *dev_, fz_image *image, fz_matrix ctm, float alpha, const fz_color_params *color_params) { fz_test_device *dev = (fz_test_device*)dev_; @@ -363,7 +363,7 @@ fz_test_fill_image(fz_context *ctx, fz_device *dev_, fz_image *image, const fz_m } static void -fz_test_fill_image_mask(fz_context *ctx, fz_device *dev_, fz_image *image, const fz_matrix *ctm, +fz_test_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) { fz_test_device *dev = (fz_test_device*)dev_; @@ -381,7 +381,7 @@ fz_test_fill_image_mask(fz_context *ctx, fz_device *dev_, fz_image *image, const } static void -fz_test_clip_path(fz_context *ctx, fz_device *dev_, const fz_path *path, int even_odd, const 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, const 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, const 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, const 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, const fz_matrix *ctm, const fz_rect *scissor) +fz_test_clip_text(fz_context *ctx, fz_device *dev_, const fz_text *text, fz_matrix ctm, const 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, const f } static void -fz_test_clip_stroke_text(fz_context *ctx, fz_device *dev_, const fz_text *text, const fz_stroke_state *stroke, const 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, const fz_rect *scissor) { fz_test_device *dev = (fz_test_device*)dev_; @@ -413,7 +413,7 @@ fz_test_clip_stroke_text(fz_context *ctx, fz_device *dev_, const fz_text *text, } static void -fz_test_ignore_text(fz_context *ctx, fz_device *dev_, const fz_text *text, const fz_matrix *ctm) +fz_test_ignore_text(fz_context *ctx, fz_device *dev_, const fz_text *text, fz_matrix ctm) { 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, const } static void -fz_test_clip_image_mask(fz_context *ctx, fz_device *dev_, fz_image *img, const fz_matrix *ctm, const fz_rect *scissor) +fz_test_clip_image_mask(fz_context *ctx, fz_device *dev_, fz_image *img, fz_matrix ctm, const fz_rect *scissor) { 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, const fz_matrix *ctm, int id) +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_device *dev = (fz_test_device*)dev_; diff --git a/source/fitz/text.c b/source/fitz/text.c index 7fb46ae5..ef57db4b 100644 --- a/source/fitz/text.c +++ b/source/fitz/text.c @@ -107,8 +107,8 @@ fz_show_glyph(fz_context *ctx, fz_text *text, fz_font *font, fz_matrix trm, int span->len++; } -void -fz_show_string(fz_context *ctx, fz_text *text, fz_font *user_font, fz_matrix *trm, const char *s, int wmode, int bidi_level, fz_bidi_direction markup_dir, fz_text_language language) +fz_matrix +fz_show_string(fz_context *ctx, fz_text *text, fz_font *user_font, fz_matrix trm, const char *s, int wmode, int bidi_level, fz_bidi_direction markup_dir, fz_text_language language) { fz_font *font; int gid, ucs; @@ -118,13 +118,15 @@ fz_show_string(fz_context *ctx, fz_text *text, fz_font *user_font, fz_matrix *tr { s += fz_chartorune(&ucs, s); gid = fz_encode_character_with_fallback(ctx, user_font, ucs, 0, language, &font); - fz_show_glyph(ctx, text, font, *trm, gid, ucs, wmode, bidi_level, markup_dir, language); + fz_show_glyph(ctx, text, font, trm, gid, ucs, wmode, bidi_level, markup_dir, language); adv = fz_advance_glyph(ctx, font, gid, wmode); if (wmode == 0) - *trm = fz_pre_translate(*trm, adv, 0); + trm = fz_pre_translate(trm, adv, 0); else - *trm = fz_pre_translate(*trm, 0, -adv); + trm = fz_pre_translate(trm, 0, -adv); } + + return trm; } fz_rect diff --git a/source/fitz/trace-device.c b/source/fitz/trace-device.c index 59d625c7..b89661ad 100644 --- a/source/fitz/trace-device.c +++ b/source/fitz/trace-device.c @@ -7,10 +7,9 @@ typedef struct fz_trace_device_s } fz_trace_device; static void -fz_trace_matrix(fz_context *ctx, fz_output *out, const fz_matrix *ctm) +fz_trace_matrix(fz_context *ctx, fz_output *out, fz_matrix ctm) { - fz_write_printf(ctx, out, " matrix=\"%g %g %g %g %g %g\"", - ctm->a, ctm->b, ctm->c, ctm->d, ctm->e, ctm->f); + fz_write_printf(ctx, out, " matrix=\"%g %g %g %g %g %g\"", ctm.a, ctm.b, ctm.c, ctm.d, ctm.e, ctm.f); } static void @@ -116,7 +115,7 @@ fz_trace_path(fz_context *ctx, fz_output *out, const fz_path *path) } static void -fz_trace_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const fz_matrix *ctm, +fz_trace_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) { fz_output *out = ((fz_trace_device*)dev)->out; @@ -133,7 +132,7 @@ fz_trace_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int eve } static void -fz_trace_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, +fz_trace_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) { fz_output *out = ((fz_trace_device*)dev)->out; @@ -163,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, const 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, const fz_rect *scissor) { fz_output *out = ((fz_trace_device*)dev)->out; fz_write_printf(ctx, out, "<clip_path"); @@ -178,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, const 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, const fz_rect *scissor) { fz_output *out = ((fz_trace_device*)dev)->out; fz_write_printf(ctx, out, "<clip_stroke_path"); @@ -189,7 +188,7 @@ fz_trace_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, } static void -fz_trace_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm, +fz_trace_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) { fz_output *out = ((fz_trace_device*)dev)->out; @@ -202,7 +201,7 @@ fz_trace_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const f } static void -fz_trace_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm, +fz_trace_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) { fz_output *out = ((fz_trace_device*)dev)->out; @@ -215,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, const fz_matrix *ctm, const fz_rect *scissor) +fz_trace_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor) { fz_output *out = ((fz_trace_device*)dev)->out; fz_write_printf(ctx, out, "<clip_text"); @@ -226,7 +225,7 @@ fz_trace_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, const f } static void -fz_trace_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const 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, const fz_rect *scissor) { fz_output *out = ((fz_trace_device*)dev)->out; fz_write_printf(ctx, out, "<clip_stroke_text"); @@ -237,7 +236,7 @@ fz_trace_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, } static void -fz_trace_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm) +fz_trace_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm) { fz_output *out = ((fz_trace_device*)dev)->out; fz_write_printf(ctx, out, "<ignore_text"); @@ -248,7 +247,7 @@ fz_trace_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, const } static void -fz_trace_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha, const fz_color_params *color_params) +fz_trace_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, float alpha, const fz_color_params *color_params) { fz_output *out = ((fz_trace_device*)dev)->out; fz_write_printf(ctx, out, "<fill_image alpha=\"%g\"", alpha); @@ -258,7 +257,7 @@ fz_trace_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_m } static void -fz_trace_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha, const fz_color_params *color_params) +fz_trace_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, fz_matrix ctm, float alpha, const fz_color_params *color_params) { fz_output *out = ((fz_trace_device*)dev)->out; fz_write_printf(ctx, out, "<fill_shade alpha=\"%g\"", alpha); @@ -267,7 +266,7 @@ fz_trace_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_m } static void -fz_trace_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, +fz_trace_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) { fz_output *out = ((fz_trace_device*)dev)->out; @@ -279,7 +278,7 @@ fz_trace_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const } static void -fz_trace_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, const fz_rect *scissor) +fz_trace_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, const fz_rect *scissor) { fz_output *out = ((fz_trace_device*)dev)->out; fz_write_printf(ctx, out, "<clip_image_mask"); @@ -329,7 +328,7 @@ 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, const fz_matrix *ctm, int id) +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_output *out = ((fz_trace_device*)dev)->out; fz_write_printf(ctx, out, "<tile id=\"%d\"", id); diff --git a/source/fitz/util.c b/source/fitz/util.c index ddbb36b8..4e1f4e1e 100644 --- a/source/fitz/util.c +++ b/source/fitz/util.c @@ -12,7 +12,7 @@ fz_new_display_list_from_page(fz_context *ctx, fz_page *page) fz_try(ctx) { dev = fz_new_list_device(ctx, list); - fz_run_page(ctx, page, dev, &fz_identity, NULL); + fz_run_page(ctx, page, dev, fz_identity, NULL); fz_close_device(ctx, dev); } fz_always(ctx) @@ -55,7 +55,7 @@ fz_new_display_list_from_page_contents(fz_context *ctx, fz_page *page) fz_try(ctx) { dev = fz_new_list_device(ctx, list); - fz_run_page_contents(ctx, page, dev, &fz_identity, NULL); + fz_run_page_contents(ctx, page, dev, fz_identity, NULL); fz_close_device(ctx, dev); } fz_always(ctx) @@ -82,7 +82,7 @@ fz_new_display_list_from_annot(fz_context *ctx, fz_annot *annot) fz_try(ctx) { dev = fz_new_list_device(ctx, list); - fz_run_annot(ctx, annot, dev, &fz_identity, NULL); + fz_run_annot(ctx, annot, dev, fz_identity, NULL); fz_close_device(ctx, dev); } fz_always(ctx) @@ -99,7 +99,7 @@ fz_new_display_list_from_annot(fz_context *ctx, fz_annot *annot) } fz_pixmap * -fz_new_pixmap_from_display_list(fz_context *ctx, fz_display_list *list, const fz_matrix *ctm, fz_colorspace *cs, int alpha) +fz_new_pixmap_from_display_list(fz_context *ctx, fz_display_list *list, fz_matrix ctm, fz_colorspace *cs, int alpha) { fz_rect rect; fz_irect bbox; @@ -107,7 +107,7 @@ fz_new_pixmap_from_display_list(fz_context *ctx, fz_display_list *list, const fz fz_device *dev = NULL; rect = fz_bound_display_list(ctx, list); - rect = fz_transform_rect(rect, *ctm); + rect = fz_transform_rect(rect, ctm); bbox = fz_round_rect(rect); pix = fz_new_pixmap_with_bbox(ctx, cs, bbox, 0, alpha); @@ -119,7 +119,7 @@ fz_new_pixmap_from_display_list(fz_context *ctx, fz_display_list *list, const fz 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, NULL, NULL); fz_close_device(ctx, dev); } fz_always(ctx) @@ -136,7 +136,7 @@ fz_new_pixmap_from_display_list(fz_context *ctx, fz_display_list *list, const fz } fz_pixmap * -fz_new_pixmap_from_page_contents(fz_context *ctx, fz_page *page, const fz_matrix *ctm, fz_colorspace *cs, int alpha) +fz_new_pixmap_from_page_contents(fz_context *ctx, fz_page *page, fz_matrix ctm, fz_colorspace *cs, int alpha) { fz_rect rect; fz_irect bbox; @@ -144,7 +144,7 @@ fz_new_pixmap_from_page_contents(fz_context *ctx, fz_page *page, const fz_matrix fz_device *dev = NULL; rect = fz_bound_page(ctx, page); - rect = fz_transform_rect(rect, *ctm); + rect = fz_transform_rect(rect, ctm); bbox = fz_round_rect(rect); pix = fz_new_pixmap_with_bbox(ctx, cs, bbox, 0, alpha); @@ -156,7 +156,7 @@ fz_new_pixmap_from_page_contents(fz_context *ctx, fz_page *page, const fz_matrix fz_try(ctx) { dev = fz_new_draw_device(ctx, ctm, pix); - fz_run_page_contents(ctx, page, dev, &fz_identity, NULL); + fz_run_page_contents(ctx, page, dev, fz_identity, NULL); fz_close_device(ctx, dev); } fz_always(ctx) @@ -173,7 +173,7 @@ fz_new_pixmap_from_page_contents(fz_context *ctx, fz_page *page, const fz_matrix } fz_pixmap * -fz_new_pixmap_from_annot(fz_context *ctx, fz_annot *annot, const fz_matrix *ctm, fz_colorspace *cs, int alpha) +fz_new_pixmap_from_annot(fz_context *ctx, fz_annot *annot, fz_matrix ctm, fz_colorspace *cs, int alpha) { fz_rect rect; fz_irect bbox; @@ -181,7 +181,7 @@ fz_new_pixmap_from_annot(fz_context *ctx, fz_annot *annot, const fz_matrix *ctm, fz_device *dev = NULL; rect = fz_bound_annot(ctx, annot); - rect = fz_transform_rect(rect, *ctm); + rect = fz_transform_rect(rect, ctm); bbox = fz_round_rect(rect); pix = fz_new_pixmap_with_bbox(ctx, cs, bbox, 0, alpha); @@ -193,7 +193,7 @@ fz_new_pixmap_from_annot(fz_context *ctx, fz_annot *annot, const fz_matrix *ctm, fz_try(ctx) { dev = fz_new_draw_device(ctx, ctm, pix); - fz_run_annot(ctx, annot, dev, &fz_identity, NULL); + fz_run_annot(ctx, annot, dev, fz_identity, NULL); fz_close_device(ctx, dev); } fz_always(ctx) @@ -210,7 +210,7 @@ fz_new_pixmap_from_annot(fz_context *ctx, fz_annot *annot, const fz_matrix *ctm, } fz_pixmap * -fz_new_pixmap_from_page(fz_context *ctx, fz_page *page, const fz_matrix *ctm, fz_colorspace *cs, int alpha) +fz_new_pixmap_from_page(fz_context *ctx, fz_page *page, fz_matrix ctm, fz_colorspace *cs, int alpha) { fz_rect rect; fz_irect bbox; @@ -218,7 +218,7 @@ fz_new_pixmap_from_page(fz_context *ctx, fz_page *page, const fz_matrix *ctm, fz fz_device *dev = NULL; rect = fz_bound_page(ctx, page); - rect = fz_transform_rect(rect, *ctm); + rect = fz_transform_rect(rect, ctm); bbox = fz_round_rect(rect); pix = fz_new_pixmap_with_bbox(ctx, cs, bbox, 0, alpha); @@ -230,7 +230,7 @@ fz_new_pixmap_from_page(fz_context *ctx, fz_page *page, const fz_matrix *ctm, fz fz_try(ctx) { dev = fz_new_draw_device(ctx, ctm, pix); - fz_run_page(ctx, page, dev, &fz_identity, NULL); + fz_run_page(ctx, page, dev, fz_identity, NULL); fz_close_device(ctx, dev); } fz_always(ctx) @@ -247,7 +247,7 @@ fz_new_pixmap_from_page(fz_context *ctx, fz_page *page, const fz_matrix *ctm, fz } fz_pixmap * -fz_new_pixmap_from_page_number(fz_context *ctx, fz_document *doc, int number, const fz_matrix *ctm, fz_colorspace *cs, int alpha) +fz_new_pixmap_from_page_number(fz_context *ctx, fz_document *doc, int number, fz_matrix ctm, fz_colorspace *cs, int alpha) { fz_page *page; fz_pixmap *pix = NULL; @@ -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, NULL, NULL); fz_close_device(ctx, dev); } fz_always(ctx) @@ -304,7 +304,7 @@ fz_new_stext_page_from_page(fz_context *ctx, fz_page *page, const fz_stext_optio fz_try(ctx) { dev = fz_new_stext_device(ctx, text, options); - fz_run_page_contents(ctx, page, dev, &fz_identity, NULL); + fz_run_page_contents(ctx, page, dev, fz_identity, NULL); fz_close_device(ctx, dev); } fz_always(ctx) |