diff options
Diffstat (limited to 'source/fitz/draw-device.c')
-rw-r--r-- | source/fitz/draw-device.c | 347 |
1 files changed, 163 insertions, 184 deletions
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c index f497949a..63b20f67 100644 --- a/source/fitz/draw-device.c +++ b/source/fitz/draw-device.c @@ -209,14 +209,14 @@ fz_knockout_begin(fz_context *ctx, fz_draw_device *dev) state = push_stack(ctx, dev); STACK_PUSHED("knockout"); - fz_pixmap_bbox(ctx, state->dest, &bbox); - fz_intersect_irect(&bbox, &state->scissor); - dest = fz_new_pixmap_with_bbox(ctx, state->dest->colorspace, &bbox, state->dest->seps, state->dest->alpha); + bbox = fz_pixmap_bbox(ctx, state->dest); + bbox = fz_intersect_irect(bbox, state->scissor); + dest = fz_new_pixmap_with_bbox(ctx, state->dest->colorspace, bbox, state->dest->seps, state->dest->alpha); if (state[0].group_alpha) { - fz_pixmap_bbox(ctx, state->group_alpha, &ga_bbox); - fz_intersect_irect(&ga_bbox, &state->scissor); - ga = fz_new_pixmap_with_bbox(ctx, state->group_alpha->colorspace, &ga_bbox, state->group_alpha->seps, state->group_alpha->alpha); + ga_bbox = fz_pixmap_bbox(ctx, state->group_alpha); + ga_bbox = fz_intersect_irect(ga_bbox, state->scissor); + ga = fz_new_pixmap_with_bbox(ctx, state->group_alpha->colorspace, ga_bbox, state->group_alpha->seps, state->group_alpha->alpha); } if (isolated) @@ -238,11 +238,11 @@ fz_knockout_begin(fz_context *ctx, fz_draw_device *dev) } if (prev->dest) { - fz_copy_pixmap_rect(ctx, dest, prev->dest, &bbox, dev->default_cs); + fz_copy_pixmap_rect(ctx, dest, prev->dest, bbox, dev->default_cs); if (ga) { if (prev->group_alpha) - fz_copy_pixmap_rect(ctx, ga, prev->group_alpha, &ga_bbox, dev->default_cs); + fz_copy_pixmap_rect(ctx, ga, prev->group_alpha, ga_bbox, dev->default_cs); else fz_clear_pixmap(ctx, ga); } @@ -256,7 +256,7 @@ fz_knockout_begin(fz_context *ctx, fz_draw_device *dev) } /* Knockout groups (and only knockout groups) rely on shape */ - shape = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + shape = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, shape); #ifdef DUMP_GROUP_BLENDS dump_spaces(dev->top-1, ""); @@ -341,13 +341,6 @@ static void fz_knockout_end(fz_context *ctx, fz_draw_device *dev) #endif } -static inline fz_matrix concat(const fz_matrix *one, const fz_matrix *two) -{ - fz_matrix ctm; - fz_concat(&ctm, one, two); - return ctm; -} - static int colors_supported(fz_context *ctx, fz_colorspace *cs, fz_pixmap *dest) { @@ -612,10 +605,10 @@ fz_draw_fill_path(fz_context *ctx, fz_device *devp, const fz_path *path, int eve 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 = 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); + float expansion = fz_matrix_expansion(ctm); float flatness = 0.3f / expansion; unsigned char colorbv[FZ_MAX_COLORS + 1]; fz_irect bbox; @@ -629,7 +622,7 @@ fz_draw_fill_path(fz_context *ctx, fz_device *devp, const fz_path *path, int eve if (flatness < 0.001f) flatness = 0.001f; - fz_intersect_irect(fz_pixmap_bbox_no_ctx(state->dest, &bbox), &state->scissor); + bbox = fz_intersect_irect(fz_pixmap_bbox(ctx, state->dest), state->scissor); if (fz_flatten_fill_path(ctx, rast, path, &ctm, flatness, &bbox, &bbox)) return; @@ -665,10 +658,10 @@ fz_draw_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, const 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 = 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); + float expansion = fz_matrix_expansion(ctm); float flatness = 0.3f / expansion; float linewidth = stroke->linewidth; unsigned char colorbv[FZ_MAX_COLORS + 1]; @@ -689,7 +682,7 @@ fz_draw_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, const if (flatness < 0.001f) flatness = 0.001f; - fz_intersect_irect(fz_pixmap_bbox_no_ctx(state->dest, &bbox), &state->scissor); + 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)) return; @@ -742,12 +735,12 @@ 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_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = 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); + float expansion = fz_matrix_expansion(ctm); float flatness = 0.3f / expansion; - fz_irect bbox, pixmap_bbox; + fz_irect bbox; fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *model; @@ -763,16 +756,13 @@ fz_draw_clip_path(fz_context *ctx, fz_device *devp, const fz_path *path, int eve if (scissor) { - fz_rect rect = *scissor; - fz_transform_rect(&rect, &dev->transform); - fz_irect_from_rect(&bbox, &rect); - fz_intersect_irect(&bbox, &state->scissor); - fz_intersect_irect(&bbox, fz_pixmap_bbox(ctx, state->dest, &pixmap_bbox)); + bbox = fz_irect_from_rect(fz_transform_rect(*scissor, dev->transform)); + bbox = fz_intersect_irect(bbox, fz_pixmap_bbox(ctx, state->dest)); + bbox = fz_intersect_irect(bbox, state->scissor); } else { - bbox = state->scissor; - fz_intersect_irect(&bbox, fz_pixmap_bbox(ctx, state->dest, &pixmap_bbox)); + 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)) @@ -787,18 +777,18 @@ fz_draw_clip_path(fz_context *ctx, fz_device *devp, const fz_path *path, int eve fz_try(ctx) { - state[1].mask = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].mask = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, state[1].mask); - state[1].dest = fz_new_pixmap_with_bbox(ctx, model, &bbox, state[0].dest->seps, state[0].dest->alpha); - fz_copy_pixmap_rect(ctx, state[1].dest, state[0].dest, &bbox, dev->default_cs); + state[1].dest = fz_new_pixmap_with_bbox(ctx, model, bbox, state[0].dest->seps, state[0].dest->alpha); + fz_copy_pixmap_rect(ctx, state[1].dest, state[0].dest, bbox, dev->default_cs); if (state[1].shape) { - state[1].shape = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].shape = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, state[1].shape); } if (state[1].group_alpha) { - state[1].group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, state[1].group_alpha); } @@ -819,13 +809,13 @@ 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_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = 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); + float expansion = fz_matrix_expansion(ctm); float flatness = 0.3f / expansion; float linewidth = stroke->linewidth; - fz_irect bbox, pixmap_bbox; + fz_irect bbox; fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *model; float aa_level = 2.0f/(fz_rasterizer_graphics_aa_level(rast)+2); @@ -847,19 +837,15 @@ fz_draw_clip_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, if (scissor) { - fz_rect rect = *scissor; - fz_transform_rect(&rect, &dev->transform); - fz_irect_from_rect(&bbox, &rect); - fz_intersect_irect(&bbox, &state->scissor); - fz_intersect_irect(&bbox, fz_pixmap_bbox(ctx, state->dest, &pixmap_bbox)); + bbox = fz_irect_from_rect(fz_transform_rect(*scissor, dev->transform)); + bbox = fz_intersect_irect(bbox, fz_pixmap_bbox(ctx, state->dest)); + bbox = fz_intersect_irect(bbox, state->scissor); } else { - bbox = state->scissor; - fz_intersect_irect(&bbox, fz_pixmap_bbox(ctx, state->dest, &pixmap_bbox)); + 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)) { state[1].scissor = bbox; @@ -872,25 +858,25 @@ fz_draw_clip_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path, fz_try(ctx) { - state[1].mask = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].mask = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, state[1].mask); /* When there is no alpha in the current destination (state[0].dest->alpha == 0) * we have a choice. We can either create the new destination WITH alpha, or * we can copy the old pixmap contents in. We opt for the latter here, but * may want to revisit this decision in the future. */ - state[1].dest = fz_new_pixmap_with_bbox(ctx, model, &bbox, state[0].dest->seps, state[0].dest->alpha); + state[1].dest = fz_new_pixmap_with_bbox(ctx, model, bbox, state[0].dest->seps, state[0].dest->alpha); if (state[0].dest->alpha) fz_clear_pixmap(ctx, state[1].dest); else - fz_copy_pixmap_rect(ctx, state[1].dest, state[0].dest, &bbox, dev->default_cs); + fz_copy_pixmap_rect(ctx, state[1].dest, state[0].dest, bbox, dev->default_cs); if (state->shape) { - state[1].shape = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].shape = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, state[1].shape); } if (state->group_alpha) { - state[1].group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, state[1].group_alpha); } @@ -913,16 +899,17 @@ draw_glyph(unsigned char *colorbv, fz_pixmap *dst, fz_glyph *glyph, int xorig, int yorig, const fz_irect *scissor, fz_overprint *eop) { unsigned char *dp; - fz_irect bbox, bbox2; + fz_irect bbox; int x, y, w, h; int skip_x, skip_y; fz_pixmap *msk; - fz_glyph_bbox_no_ctx(glyph, &bbox); - fz_translate_irect(&bbox, xorig, yorig); - fz_intersect_irect(&bbox, scissor); /* scissor < dst */ + bbox = fz_glyph_bbox_no_ctx(glyph); + bbox = fz_translate_irect(bbox, xorig, yorig); + bbox = fz_intersect_irect(bbox, *scissor); /* scissor < dst */ + bbox = fz_intersect_irect(bbox, fz_pixmap_bbox_no_ctx(dst)); - if (fz_is_empty_irect(fz_intersect_irect(&bbox, fz_pixmap_bbox_no_ctx(dst, &bbox2)))) + if (fz_is_empty_irect(bbox)) return; x = bbox.x0; @@ -982,7 +969,7 @@ fz_draw_fill_text(fz_context *ctx, fz_device *devp, const fz_text *text, const f 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 = 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]; @@ -1029,7 +1016,7 @@ fz_draw_fill_text(fz_context *ctx, fz_device *devp, const fz_text *text, const f tm.e = span->items[i].x; tm.f = span->items[i].y; - fz_concat(&trm, &tm, &ctm); + trm = fz_concat(tm, ctm); glyph = fz_render_glyph(ctx, span->font, gid, &trm, model, &state->scissor, state->dest->alpha, fz_rasterizer_text_aa_level(rast)); if (glyph) @@ -1079,7 +1066,7 @@ fz_draw_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, const const 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 = 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; @@ -1118,7 +1105,7 @@ fz_draw_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, const tm.e = span->items[i].x; tm.f = span->items[i].y; - fz_concat(&trm, &tm, &ctm); + trm = fz_concat(tm, ctm); glyph = fz_render_stroked_glyph(ctx, span->font, gid, &trm, &ctm, stroke, &state->scissor, aa); if (glyph) @@ -1156,7 +1143,7 @@ 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_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = 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; @@ -1165,7 +1152,6 @@ fz_draw_clip_text(fz_context *ctx, fz_device *devp, const fz_text *text, const f fz_draw_state *state; fz_colorspace *model; fz_text_span *span; - fz_rect rect; fz_rasterizer *rast = dev->rast; if (dev->top == 0 && dev->resolve_spots) @@ -1176,39 +1162,37 @@ fz_draw_clip_text(fz_context *ctx, fz_device *devp, const fz_text *text, const f model = state->dest->colorspace; /* make the mask the exact size needed */ - fz_irect_from_rect(&bbox, fz_bound_text(ctx, text, NULL, &ctm, &rect)); - fz_intersect_irect(&bbox, &state->scissor); + bbox = fz_irect_from_rect(fz_bound_text(ctx, text, NULL, ctm)); + bbox = fz_intersect_irect(bbox, state->scissor); if (scissor) { - fz_irect bbox2; - fz_rect tscissor = *scissor; - fz_transform_rect(&tscissor, &dev->transform); - fz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, &tscissor)); + fz_rect tscissor = fz_transform_rect(*scissor, dev->transform); + bbox = fz_intersect_irect(bbox, fz_irect_from_rect(tscissor)); } fz_try(ctx) { - mask = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + mask = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, mask); /* When there is no alpha in the current destination (state[0].dest->alpha == 0) * we have a choice. We can either create the new destination WITH alpha, or * we can copy the old pixmap contents in. We opt for the latter here, but * may want to revisit this decision in the future. */ - dest = fz_new_pixmap_with_bbox(ctx, model, &bbox, state[0].dest->seps, state[0].dest->alpha); + dest = fz_new_pixmap_with_bbox(ctx, model, bbox, state[0].dest->seps, state[0].dest->alpha); if (state[0].dest->alpha) fz_clear_pixmap(ctx, dest); else - fz_copy_pixmap_rect(ctx, dest, state[0].dest, &bbox, dev->default_cs); + fz_copy_pixmap_rect(ctx, dest, state[0].dest, bbox, dev->default_cs); if (state->shape) { - shape = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + shape = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, shape); } else shape = NULL; if (state->group_alpha) { - group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, group_alpha); } else @@ -1224,7 +1208,7 @@ fz_draw_clip_text(fz_context *ctx, fz_device *devp, const fz_text *text, const f dump_spaces(dev->top-1, "Clip (text) begin\n"); #endif - if (!fz_is_empty_irect(&bbox) && mask) + if (!fz_is_empty_irect(bbox) && mask) { for (span = text->head; span; span = span->next) { @@ -1238,7 +1222,7 @@ fz_draw_clip_text(fz_context *ctx, fz_device *devp, const fz_text *text, const f tm.e = span->items[i].x; tm.f = span->items[i].y; - fz_concat(&trm, &tm, &ctm); + trm = fz_concat(tm, ctm); glyph = fz_render_glyph(ctx, span->font, gid, &trm, model, &state->scissor, state[1].dest->alpha, fz_rasterizer_text_aa_level(rast)); if (glyph) @@ -1297,7 +1281,7 @@ 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_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = 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; @@ -1306,47 +1290,45 @@ fz_draw_clip_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, fz_draw_state *state = push_stack(ctx, dev); fz_colorspace *model = state->dest->colorspace; fz_text_span *span; - fz_rect rect; int aa = fz_rasterizer_text_aa_level(dev->rast); if (dev->top == 0 && dev->resolve_spots) state = push_group_for_separations(ctx, dev, fz_default_color_params(ctx)/* FIXME */, dev->default_cs); STACK_PUSHED("clip stroke text"); + /* make the mask the exact size needed */ - fz_irect_from_rect(&bbox, fz_bound_text(ctx, text, stroke, &ctm, &rect)); - fz_intersect_irect(&bbox, &state->scissor); + bbox = fz_irect_from_rect(fz_bound_text(ctx, text, stroke, ctm)); + bbox = fz_intersect_irect(bbox, state->scissor); if (scissor) { - fz_irect bbox2; - fz_rect tscissor = *scissor; - fz_transform_rect(&tscissor, &dev->transform); - fz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, &tscissor)); + fz_rect tscissor = fz_transform_rect(*scissor, dev->transform); + bbox = fz_intersect_irect(bbox, fz_irect_from_rect(tscissor)); } fz_try(ctx) { - state[1].mask = mask = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].mask = mask = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, mask); /* When there is no alpha in the current destination (state[0].dest->alpha == 0) * we have a choice. We can either create the new destination WITH alpha, or * we can copy the old pixmap contents in. We opt for the latter here, but * may want to revisit this decision in the future. */ - state[1].dest = dest = fz_new_pixmap_with_bbox(ctx, model, &bbox, state[0].dest->seps, state[0].dest->alpha); + state[1].dest = dest = fz_new_pixmap_with_bbox(ctx, model, bbox, state[0].dest->seps, state[0].dest->alpha); if (state[0].dest->alpha) fz_clear_pixmap(ctx, state[1].dest); else - fz_copy_pixmap_rect(ctx, state[1].dest, state[0].dest, &bbox, dev->default_cs); + fz_copy_pixmap_rect(ctx, state[1].dest, state[0].dest, bbox, dev->default_cs); if (state->shape) { - state[1].shape = shape = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].shape = shape = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, shape); } else shape = state->shape; if (state->group_alpha) { - state[1].group_alpha = group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].group_alpha = group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, group_alpha); } else @@ -1358,7 +1340,7 @@ fz_draw_clip_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, dump_spaces(dev->top-1, "Clip (stroke text) begin\n"); #endif - if (!fz_is_empty_irect(&bbox)) + if (!fz_is_empty_irect(bbox)) { for (span = text->head; span; span = span->next) { @@ -1372,7 +1354,7 @@ fz_draw_clip_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text, tm.e = span->items[i].x; tm.f = span->items[i].y; - fz_concat(&trm, &tm, &ctm); + trm = fz_concat(tm, ctm); glyph = fz_render_stroked_glyph(ctx, span->font, gid, &trm, &ctm, stroke, &state->scissor, aa); if (glyph) @@ -1437,8 +1419,7 @@ 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_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = concat(in_ctm, &dev->transform); - fz_rect bounds; + 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]; @@ -1451,11 +1432,11 @@ fz_draw_fill_shade(fz_context *ctx, fz_device *devp, fz_shade *shade, const fz_m if (dev->top == 0 && dev->resolve_spots) state = push_group_for_separations(ctx, dev, color_params, dev->default_cs); - fz_bound_shade(ctx, shade, &ctm, &bounds); scissor = state->scissor; - fz_intersect_irect(fz_irect_from_rect(&bbox, &bounds), &scissor); + bbox = fz_irect_from_rect(fz_bound_shade(ctx, shade, ctm)); + bbox = fz_intersect_irect(bbox, scissor); - if (fz_is_empty_irect(&bbox)) + if (fz_is_empty_irect(bbox)) return; if (color_params == NULL) @@ -1470,19 +1451,19 @@ fz_draw_fill_shade(fz_context *ctx, fz_device *devp, fz_shade *shade, const fz_m if (alpha < 1) { - dest = fz_new_pixmap_with_bbox(ctx, state->dest->colorspace, &bbox, state->dest->seps, state->dest->alpha); + dest = fz_new_pixmap_with_bbox(ctx, state->dest->colorspace, bbox, state->dest->seps, state->dest->alpha); if (state->dest->alpha) fz_clear_pixmap(ctx, dest); else - fz_copy_pixmap_rect(ctx, dest, state[0].dest, &bbox, dev->default_cs); + fz_copy_pixmap_rect(ctx, dest, state[0].dest, bbox, dev->default_cs); if (shape) { - shape = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + shape = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, shape); } if (group_alpha) { - group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, group_alpha); } } @@ -1563,9 +1544,9 @@ fz_draw_fill_shade(fz_context *ctx, fz_device *devp, fz_shade *shade, const fz_m fz_paint_shade(ctx, shade, colorspace, &ctm, dest, color_params, &bbox, eop); if (shape) - fz_clear_pixmap_rect_with_value(ctx, shape, 255, &bbox); + fz_clear_pixmap_rect_with_value(ctx, shape, 255, bbox); if (group_alpha) - fz_clear_pixmap_rect_with_value(ctx, group_alpha, 255, &bbox); + fz_clear_pixmap_rect_with_value(ctx, group_alpha, 255, bbox); #ifdef DUMP_GROUP_BLENDS dump_spaces(dev->top, ""); @@ -1609,7 +1590,7 @@ fz_transform_pixmap(fz_context *ctx, fz_draw_device *dev, const fz_pixmap *image fz_matrix m = *ctm; if (gridfit) { - fz_gridfit_matrix(dev->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, &m); + m = fz_gridfit_matrix(dev->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, m); } scaled = fz_scale_pixmap_cached(ctx, image, m.e, m.f, m.a, m.d, clip, dev->cache_x, dev->cache_y); if (!scaled) @@ -1627,7 +1608,7 @@ fz_transform_pixmap(fz_context *ctx, fz_draw_device *dev, const fz_pixmap *image fz_matrix m = *ctm; fz_irect rclip; if (gridfit) - fz_gridfit_matrix(dev->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, &m); + m = fz_gridfit_matrix(dev->flags & FZ_DEVFLAG_GRIDFIT_AS_TILED, m); if (clip) { rclip.x0 = clip->y0; @@ -1704,7 +1685,7 @@ 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_device *dev = (fz_draw_device*)devp; - fz_matrix local_ctm = concat(in_ctm, &dev->transform); + fz_matrix local_ctm = fz_concat(*in_ctm, dev->transform); fz_pixmap *pixmap; int after; int dx, dy; @@ -1724,7 +1705,7 @@ fz_draw_fill_image(fz_context *ctx, fz_device *devp, fz_image *image, const fz_m state = push_group_for_separations(ctx, dev, color_params, dev->default_cs); model = state->dest->colorspace; - fz_intersect_irect(fz_pixmap_bbox(ctx, state->dest, &clip), &state->scissor); + clip = fz_intersect_irect(fz_pixmap_bbox(ctx, state->dest), state->scissor); if (image->w == 0 || image->h == 0) return; @@ -1735,7 +1716,7 @@ fz_draw_fill_image(fz_context *ctx, fz_device *devp, fz_image *image, const fz_m /* ctm maps the image (expressed as the unit square) onto the * destination device. Reverse that to get a mapping from * the destination device to the source pixels. */ - if (fz_try_invert_matrix(&inverse, &local_ctm)) + if (fz_try_invert_matrix(&inverse, local_ctm)) { /* Not invertible. Could just bail? Use the whole image * for now. */ @@ -1750,20 +1731,20 @@ fz_draw_fill_image(fz_context *ctx, fz_device *devp, fz_image *image, const fz_m fz_rect rect; fz_irect sane; /* We want to scale from image coords, not from unit square */ - fz_post_scale(&inverse, image->w, image->h); + inverse = fz_post_scale(inverse, image->w, image->h); /* Are we scaling up or down? exp < 1 means scaling down. */ - exp = fz_matrix_max_expansion(&inverse); - fz_rect_from_irect(&rect, &clip); - fz_transform_rect(&rect, &inverse); + exp = fz_matrix_max_expansion(inverse); + rect = fz_rect_from_irect(clip); + rect = fz_transform_rect(rect, inverse); /* Allow for support requirements for scalers. */ - fz_expand_rect(&rect, fz_max(exp, 1) * 4); - fz_irect_from_rect(&src_area, &rect); + rect = fz_expand_rect(rect, fz_max(exp, 1) * 4); + src_area = fz_irect_from_rect(rect); sane.x0 = 0; sane.y0 = 0; sane.x1 = image->w; sane.y1 = image->h; - fz_intersect_irect(&src_area, &sane); - if (fz_is_empty_irect(&src_area)) + src_area = fz_intersect_irect(src_area, sane); + if (fz_is_empty_irect(src_area)) return; } @@ -1852,7 +1833,7 @@ fz_draw_fill_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const 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 = 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; @@ -1874,8 +1855,8 @@ fz_draw_fill_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const if (colorspace_in) colorspace = fz_default_colorspace(ctx, dev->default_cs, colorspace_in); - fz_pixmap_bbox(ctx, state->dest, &clip); - fz_intersect_irect(&clip, &state->scissor); + clip = fz_pixmap_bbox(ctx, state->dest); + clip = fz_intersect_irect(clip, state->scissor); if (image->w == 0 || image->h == 0) return; @@ -1883,7 +1864,7 @@ fz_draw_fill_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const /* ctm maps the image (expressed as the unit square) onto the * destination device. Reverse that to get a mapping from * the destination device to the source pixels. */ - if (fz_try_invert_matrix(&inverse, &local_ctm)) + if (fz_try_invert_matrix(&inverse, local_ctm)) { /* Not invertible. Could just bail? Use the whole image * for now. */ @@ -1898,20 +1879,20 @@ fz_draw_fill_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const fz_rect rect; fz_irect sane; /* We want to scale from image coords, not from unit square */ - fz_post_scale(&inverse, image->w, image->h); + inverse = fz_post_scale(inverse, image->w, image->h); /* Are we scaling up or down? exp < 1 means scaling down. */ - exp = fz_matrix_max_expansion(&inverse); - fz_rect_from_irect(&rect, &clip); - fz_transform_rect(&rect, &inverse); + exp = fz_matrix_max_expansion(inverse); + rect = fz_rect_from_irect(clip); + rect = fz_transform_rect(rect, inverse); /* Allow for support requirements for scalers. */ - fz_expand_rect(&rect, fz_max(exp, 1) * 4); - fz_irect_from_rect(&src_area, &rect); + rect = fz_expand_rect(rect, fz_max(exp, 1) * 4); + src_area = fz_irect_from_rect(rect); sane.x0 = 0; sane.y0 = 0; sane.x1 = image->w; sane.y1 = image->h; - fz_intersect_irect(&src_area, &sane); - if (fz_is_empty_irect(&src_area)) + src_area = fz_intersect_irect(src_area, sane); + if (fz_is_empty_irect(src_area)) return; } @@ -1960,7 +1941,7 @@ 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_device *dev = (fz_draw_device*)devp; - fz_matrix local_ctm = 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; @@ -1968,14 +1949,13 @@ fz_draw_clip_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const fz_draw_state *state = push_stack(ctx, dev); fz_colorspace *model = state->dest->colorspace; fz_irect clip; - fz_rect urect; if (dev->top == 0 && dev->resolve_spots) state = push_group_for_separations(ctx, dev, fz_default_color_params(ctx)/* FIXME */, dev->default_cs); STACK_PUSHED("clip image mask"); - fz_pixmap_bbox(ctx, state->dest, &clip); - fz_intersect_irect(&clip, &state->scissor); + clip = fz_pixmap_bbox(ctx, state->dest); + clip = fz_intersect_irect(clip, state->scissor); if (image->w == 0 || image->h == 0) { @@ -1991,34 +1971,31 @@ fz_draw_clip_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const dump_spaces(dev->top-1, "Clip (image mask) begin\n"); #endif - urect = fz_unit_rect; - fz_irect_from_rect(&bbox, fz_transform_rect(&urect, &local_ctm)); - fz_intersect_irect(&bbox, &state->scissor); + bbox = fz_irect_from_rect(fz_transform_rect(fz_unit_rect, local_ctm)); + bbox = fz_intersect_irect(bbox, state->scissor); if (scissor) { - fz_irect bbox2; - fz_rect tscissor = *scissor; - fz_transform_rect(&tscissor, &dev->transform); - fz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, &tscissor)); + fz_rect tscissor = fz_transform_rect(*scissor, dev->transform); + bbox = fz_intersect_irect(bbox, fz_irect_from_rect(tscissor)); } pixmap = fz_get_pixmap_from_image(ctx, image, NULL, &local_ctm, &dx, &dy); fz_try(ctx) { - state[1].mask = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].mask = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, state[1].mask); - state[1].dest = fz_new_pixmap_with_bbox(ctx, model, &bbox, state[0].dest->seps, state[0].dest->alpha); - fz_copy_pixmap_rect(ctx, state[1].dest, state[0].dest, &bbox, dev->default_cs); + state[1].dest = fz_new_pixmap_with_bbox(ctx, model, bbox, state[0].dest->seps, state[0].dest->alpha); + fz_copy_pixmap_rect(ctx, state[1].dest, state[0].dest, bbox, dev->default_cs); if (state[0].shape) { - state[1].shape = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].shape = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, state[1].shape); } if (state[0].group_alpha) { - state[1].group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, state[1].group_alpha); } @@ -2145,7 +2122,7 @@ fz_draw_begin_mask(fz_context *ctx, fz_device *devp, const fz_rect *rect, int lu fz_draw_state *state = push_stack(ctx, dev); fz_pixmap *shape = state->shape; fz_pixmap *group_alpha = state->group_alpha; - fz_rect trect = *rect; + fz_rect trect; fz_colorspace *colorspace = NULL; if (dev->top == 0 && dev->resolve_spots) @@ -2158,8 +2135,8 @@ fz_draw_begin_mask(fz_context *ctx, fz_device *devp, const fz_rect *rect, int lu color_params = fz_default_color_params(ctx); STACK_PUSHED("mask"); - fz_transform_rect(&trect, &dev->transform); - fz_intersect_irect(fz_irect_from_rect(&bbox, &trect), &state->scissor); + trect = fz_transform_rect(*rect, dev->transform); + bbox = fz_intersect_irect(fz_irect_from_rect(trect), state->scissor); /* Reset the blendmode for the mask rendering. In particular, * don't carry forward knockout or isolated. */ @@ -2171,9 +2148,9 @@ fz_draw_begin_mask(fz_context *ctx, fz_device *devp, const fz_rect *rect, int lu * If !luminosity, then we generate a mask from the alpha value of the shapes. */ if (luminosity) - state[1].dest = dest = fz_new_pixmap_with_bbox(ctx, fz_device_gray(ctx), &bbox, NULL, 0); + state[1].dest = dest = fz_new_pixmap_with_bbox(ctx, fz_device_gray(ctx), bbox, NULL, 0); else - state[1].dest = dest = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].dest = dest = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); if (state->shape) { /* FIXME: If we ever want to support AIS true, then @@ -2268,9 +2245,9 @@ fz_draw_end_mask(fz_context *ctx, fz_device *devp) #endif /* create new dest scratch buffer */ - fz_pixmap_bbox(ctx, temp, &bbox); - dest = fz_new_pixmap_with_bbox(ctx, state->dest->colorspace, &bbox, state->dest->seps, state->dest->alpha); - fz_copy_pixmap_rect(ctx, dest, state->dest, &bbox, dev->default_cs); + bbox = fz_pixmap_bbox(ctx, temp); + dest = fz_new_pixmap_with_bbox(ctx, state->dest->colorspace, bbox, state->dest->seps, state->dest->alpha); + fz_copy_pixmap_rect(ctx, dest, state->dest, bbox, dev->default_cs); /* push soft mask as clip mask */ state[1].dest = dest; @@ -2279,12 +2256,12 @@ fz_draw_end_mask(fz_context *ctx, fz_device *devp) * clip mask when we pop. So create a new shape now. */ if (state[0].shape) { - state[1].shape = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].shape = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, state[1].shape); } if (state[0].group_alpha) { - state[1].group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, state[1].group_alpha); } state[1].scissor = bbox; @@ -2303,7 +2280,7 @@ fz_draw_begin_group(fz_context *ctx, fz_device *devp, const fz_rect *rect, fz_co fz_pixmap *dest; fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *model = state->dest->colorspace; - fz_rect trect = *rect; + fz_rect trect; if (dev->top == 0 && dev->resolve_spots) state = push_group_for_separations(ctx, dev, fz_default_color_params(ctx)/* FIXME */, dev->default_cs); @@ -2316,8 +2293,8 @@ fz_draw_begin_group(fz_context *ctx, fz_device *devp, const fz_rect *rect, fz_co state = push_stack(ctx, dev); STACK_PUSHED("group"); - fz_transform_rect(&trect, &dev->transform); - fz_intersect_irect(fz_irect_from_rect(&bbox, &trect), &state->scissor); + trect = fz_transform_rect(*rect, dev->transform); + bbox = fz_intersect_irect(fz_irect_from_rect(trect), state->scissor); fz_try(ctx) { @@ -2326,7 +2303,7 @@ fz_draw_begin_group(fz_context *ctx, fz_device *devp, const fz_rect *rect, fz_co isolated = 1; #endif - state[1].dest = dest = fz_new_pixmap_with_bbox(ctx, model, &bbox, state[0].dest->seps, state[0].dest->alpha || isolated); + state[1].dest = dest = fz_new_pixmap_with_bbox(ctx, model, bbox, state[0].dest->seps, state[0].dest->alpha || isolated); if (isolated) { @@ -2335,8 +2312,8 @@ fz_draw_begin_group(fz_context *ctx, fz_device *devp, const fz_rect *rect, fz_co } else { - fz_copy_pixmap_rect(ctx, dest, state[0].dest, &bbox, dev->default_cs); - state[1].group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + fz_copy_pixmap_rect(ctx, dest, state[0].dest, bbox, dev->default_cs); + state[1].group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, state[1].group_alpha); } @@ -2607,13 +2584,13 @@ 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_device *dev = (fz_draw_device*)devp; - fz_matrix ctm = 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; fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *model = state->dest->colorspace; - fz_rect local_view = *view; + fz_rect local_view; if (dev->top == 0 && dev->resolve_spots) state = push_group_for_separations(ctx, dev, fz_default_color_params(ctx)/* FIXME */, dev->default_cs); @@ -2626,7 +2603,8 @@ fz_draw_begin_tile(fz_context *ctx, fz_device *devp, const fz_rect *area, const state = push_stack(ctx, dev); STACK_PUSHED("tile"); - fz_irect_from_rect(&bbox, fz_transform_rect(&local_view, &ctm)); + local_view = fz_transform_rect(*view, ctm); + bbox = fz_irect_from_rect(local_view); /* We should never have a bbox that entirely covers our destination. * If we do, then the check for only 1 tile being visible above has * failed. Actually, this *can* fail due to the round_rect, at extreme @@ -2658,7 +2636,7 @@ fz_draw_begin_tile(fz_context *ctx, fz_device *devp, const fz_rect *area, const state[1].ystep = ystep; state[1].id = id; state[1].encache = 0; - fz_irect_from_rect(&state[1].area, area); + state[1].area = fz_irect_from_rect(*area); state[1].ctm = ctm; #ifdef DUMP_GROUP_BLENDS dump_spaces(dev->top-1, "Tile begin (cached)\n"); @@ -2673,18 +2651,18 @@ fz_draw_begin_tile(fz_context *ctx, fz_device *devp, const fz_rect *area, const fz_try(ctx) { /* Patterns can be transparent, so we need to have an alpha here. */ - state[1].dest = dest = fz_new_pixmap_with_bbox(ctx, model, &bbox, state[0].dest->seps, 1); + state[1].dest = dest = fz_new_pixmap_with_bbox(ctx, model, bbox, state[0].dest->seps, 1); fz_clear_pixmap(ctx, dest); shape = state[0].shape; if (shape) { - state[1].shape = shape = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].shape = shape = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, shape); } group_alpha = state[0].group_alpha; if (group_alpha) { - state[1].group_alpha = group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, &bbox, NULL, 1); + state[1].group_alpha = group_alpha = fz_new_pixmap_with_bbox(ctx, NULL, bbox, NULL, 1); fz_clear_pixmap(ctx, group_alpha); } state[1].blendmode |= FZ_BLEND_ISOLATED; @@ -2692,7 +2670,7 @@ fz_draw_begin_tile(fz_context *ctx, fz_device *devp, const fz_rect *area, const state[1].ystep = ystep; state[1].id = id; state[1].encache = 1; - fz_irect_from_rect(&state[1].area, area); + state[1].area = fz_irect_from_rect(*area); state[1].ctm = ctm; #ifdef DUMP_GROUP_BLENDS dump_spaces(dev->top-1, "Tile begin\n"); @@ -2737,16 +2715,20 @@ fz_draw_end_tile(fz_context *ctx, fz_device *devp) /* Fudge the scissor bbox a little to allow for inaccuracies in the * matrix inversion. */ - fz_rect_from_irect(&scissor_tmp, &state[0].scissor); - fz_transform_rect(fz_expand_rect(&scissor_tmp, 1), fz_invert_matrix(&ttm, &ctm)); - fz_intersect_irect(&area, fz_irect_from_rect(&scissor, &scissor_tmp)); + ttm = fz_invert_matrix(ctm); + scissor_tmp = fz_rect_from_irect(state[0].scissor); + scissor_tmp = fz_expand_rect(scissor_tmp, 1); + scissor_tmp = fz_transform_rect(scissor_tmp, ttm); + scissor = fz_irect_from_rect(scissor_tmp); + area = fz_intersect_irect(area, scissor); tile_bbox.x0 = state[1].dest->x; tile_bbox.y0 = state[1].dest->y; tile_bbox.x1 = state[1].dest->w + tile_bbox.x0; tile_bbox.y1 = state[1].dest->h + tile_bbox.y0; - fz_rect_from_irect(&tile_tmp, &tile_bbox); - fz_transform_rect(fz_expand_rect(&tile_tmp, 1), &ttm); + tile_tmp = fz_rect_from_irect(tile_bbox); + tile_tmp = fz_expand_rect(tile_tmp, 1); + tile_tmp = fz_transform_rect(tile_tmp, ttm); /* FIXME: area is a bbox, so FP not appropriate here */ /* In PDF files xstep/ystep can be smaller than view (the area of a @@ -2807,8 +2789,7 @@ fz_draw_end_tile(fz_context *ctx, fz_device *devp) { for (x = x0; x < x1; x++) { - ttm = ctm; - fz_pre_translate(&ttm, x * xstep, y * ystep); + ttm = fz_pre_translate(ctm, x * xstep, y * ystep); dest->x = ttm.e; dest->y = ttm.f; /* Check for overflow due to float -> int conversions */ @@ -2819,16 +2800,14 @@ fz_draw_end_tile(fz_context *ctx, fz_device *devp) fz_paint_pixmap_with_bbox(state[0].dest, dest, 255, state[0].scissor); if (shape) { - ttm = shapectm; - fz_pre_translate(&ttm, x * xstep, y * ystep); + ttm = fz_pre_translate(shapectm, x * xstep, y * ystep); shape->x = ttm.e; shape->y = ttm.f; fz_paint_pixmap_with_bbox(state[0].shape, shape, 255, state[0].scissor); } if (group_alpha) { - ttm = gactm; - fz_pre_translate(&ttm, x * xstep, y * ystep); + ttm = fz_pre_translate(gactm, x * xstep, y * ystep); group_alpha->x = ttm.e; group_alpha->y = ttm.f; fz_paint_pixmap_with_bbox(state[0].group_alpha, group_alpha, 255, state[0].scissor); @@ -3251,9 +3230,9 @@ fz_new_draw_device_with_options(fz_context *ctx, const fz_draw_options *opts, co fz_set_rasterizer_graphics_aa_level(ctx, &aa, opts->graphics); fz_set_rasterizer_text_aa_level(ctx, &aa, opts->text); - fz_pre_rotate(fz_scale(&transform, x_zoom, y_zoom), opts->rotate); + transform = fz_pre_rotate(fz_scale(x_zoom, y_zoom), opts->rotate); bounds = *mediabox; - fz_round_rect(&ibounds, fz_transform_rect(&bounds, &transform)); + ibounds = fz_round_rect(fz_transform_rect(bounds, transform)); /* If width or height are set, we may need to adjust the transform */ if (w || h) @@ -3277,13 +3256,13 @@ fz_new_draw_device_with_options(fz_context *ctx, const fz_draw_options *opts, co } if (scalex != 1 || scaley != 1) { - fz_pre_scale(&transform, scalex, scaley); + transform = fz_pre_scale(transform, scalex, scaley); bounds = *mediabox; - fz_round_rect(&ibounds, fz_transform_rect(&bounds, &transform)); + ibounds = fz_round_rect(fz_transform_rect(bounds, transform)); } } - *pixmap = fz_new_pixmap_with_bbox(ctx, opts->colorspace, &ibounds, NULL/* FIXME */, opts->alpha); + *pixmap = fz_new_pixmap_with_bbox(ctx, opts->colorspace, ibounds, NULL/* FIXME */, opts->alpha); fz_try(ctx) { fz_set_pixmap_resolution(ctx, *pixmap, opts->x_resolution, opts->y_resolution); |