summaryrefslogtreecommitdiff
path: root/draw
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-01-30 13:54:39 +0100
committerTor Andersson <tor.andersson@artifex.com>2013-01-30 14:13:01 +0100
commit594c64f744862b993bcad12e05217f3d43e7d547 (patch)
tree5328ba05eb7c360c25bdc1849604839ce8d99762 /draw
parent29f09279714f4f9b81d9b5488072860142f86f24 (diff)
downloadmupdf-594c64f744862b993bcad12e05217f3d43e7d547.tar.xz
Introduce fz_irect where the old fz_bbox was useful.
Inside the renderer we often deal with integer sized areas, for pixmaps and scissoring regions. Use a new fz_irect type in these places.
Diffstat (limited to 'draw')
-rw-r--r--draw/draw_affine.c13
-rw-r--r--draw/draw_blend.c4
-rw-r--r--draw/draw_device.c108
-rw-r--r--draw/draw_edge.c20
-rw-r--r--draw/draw_glyph.c6
-rw-r--r--draw/draw_mesh.c6
-rw-r--r--draw/draw_paint.c16
-rw-r--r--draw/draw_scale.c4
-rw-r--r--draw/draw_simple_scale.c4
9 files changed, 89 insertions, 92 deletions
diff --git a/draw/draw_affine.c b/draw/draw_affine.c
index 347346b9..a824c874 100644
--- a/draw/draw_affine.c
+++ b/draw/draw_affine.c
@@ -597,14 +597,14 @@ fz_gridfit_matrix(fz_matrix *m)
/* Draw an image with an affine transform on destination */
static void
-fz_paint_image_imp(fz_pixmap *dst, fz_rect scissor, fz_pixmap *shape, fz_pixmap *img, fz_matrix ctm, byte *color, int alpha)
+fz_paint_image_imp(fz_pixmap *dst, fz_irect scissor, fz_pixmap *shape, fz_pixmap *img, fz_matrix ctm, byte *color, int alpha)
{
byte *dp, *sp, *hp;
int u, v, fa, fb, fc, fd;
int x, y, w, h;
int sw, sh, n, hw;
fz_matrix inv;
- fz_rect bbox;
+ fz_irect bbox;
int dolerp;
void (*paintfn)(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, int alpha, byte *color, byte *hp);
@@ -629,9 +629,8 @@ fz_paint_image_imp(fz_pixmap *dst, fz_rect scissor, fz_pixmap *shape, fz_pixmap
dolerp = 0;
}
- bbox = fz_transform_rect(ctm, fz_unit_rect);
- bbox = fz_intersect_rect(bbox, scissor);
- bbox = fz_rect_covering_rect(bbox);
+ bbox = fz_rect_covering_rect(fz_transform_rect(ctm, fz_unit_rect));
+ bbox = fz_intersect_irect(bbox, scissor);
x = bbox.x0;
if (shape && shape->x > x)
@@ -731,14 +730,14 @@ fz_paint_image_imp(fz_pixmap *dst, fz_rect scissor, fz_pixmap *shape, fz_pixmap
}
void
-fz_paint_image_with_color(fz_pixmap *dst, fz_rect scissor, fz_pixmap *shape, fz_pixmap *img, fz_matrix ctm, byte *color)
+fz_paint_image_with_color(fz_pixmap *dst, fz_irect scissor, fz_pixmap *shape, fz_pixmap *img, fz_matrix ctm, byte *color)
{
assert(img->n == 1);
fz_paint_image_imp(dst, scissor, shape, img, ctm, color, 255);
}
void
-fz_paint_image(fz_pixmap *dst, fz_rect scissor, fz_pixmap *shape, fz_pixmap *img, fz_matrix ctm, int alpha)
+fz_paint_image(fz_pixmap *dst, fz_irect scissor, fz_pixmap *shape, fz_pixmap *img, fz_matrix ctm, int alpha)
{
assert(dst->n == img->n || (dst->n == 4 && img->n == 2));
fz_paint_image_imp(dst, scissor, shape, img, ctm, NULL, alpha);
diff --git a/draw/draw_blend.c b/draw/draw_blend.c
index 3e5dd932..27888cfe 100644
--- a/draw/draw_blend.c
+++ b/draw/draw_blend.c
@@ -574,7 +574,7 @@ void
fz_blend_pixmap(fz_pixmap *dst, fz_pixmap *src, int alpha, int blendmode, int isolated, fz_pixmap *shape)
{
unsigned char *sp, *dp;
- fz_rect bbox;
+ fz_irect bbox;
int x, y, w, h, n;
/* TODO: fix this hack! */
@@ -590,7 +590,7 @@ fz_blend_pixmap(fz_pixmap *dst, fz_pixmap *src, int alpha, int blendmode, int is
}
bbox = fz_pixmap_bbox_no_ctx(dst);
- bbox = fz_intersect_rect(bbox, fz_pixmap_bbox_no_ctx(src));
+ bbox = fz_intersect_irect(bbox, fz_pixmap_bbox_no_ctx(src));
x = bbox.x0;
y = bbox.y0;
diff --git a/draw/draw_device.c b/draw/draw_device.c
index 196e9bdb..0e2697e4 100644
--- a/draw/draw_device.c
+++ b/draw/draw_device.c
@@ -22,7 +22,7 @@ enum {
typedef struct fz_draw_state_s fz_draw_state;
struct fz_draw_state_s {
- fz_rect scissor;
+ fz_irect scissor;
fz_pixmap *dest;
fz_pixmap *mask;
fz_pixmap *shape;
@@ -31,7 +31,7 @@ struct fz_draw_state_s {
float alpha;
fz_matrix ctm;
float xstep, ystep;
- fz_rect area;
+ fz_irect area;
};
struct fz_draw_device_s
@@ -127,7 +127,7 @@ static fz_draw_state *
fz_knockout_begin(fz_draw_device *dev)
{
fz_context *ctx = dev->ctx;
- fz_rect bbox;
+ fz_irect bbox;
fz_pixmap *dest, *shape;
fz_draw_state *state = &dev->stack[dev->top];
int isolated = state->blendmode & FZ_BLEND_ISOLATED;
@@ -138,7 +138,7 @@ fz_knockout_begin(fz_draw_device *dev)
state = push_stack(dev);
bbox = fz_pixmap_bbox(dev->ctx, state->dest);
- bbox = fz_intersect_rect(bbox, state->scissor);
+ bbox = fz_intersect_irect(bbox, state->scissor);
dest = fz_new_pixmap_with_bbox(dev->ctx, state->dest->colorspace, bbox);
if (isolated)
@@ -246,7 +246,7 @@ fz_draw_fill_path(fz_device *devp, fz_path *path, int even_odd, fz_matrix ctm,
float flatness = 0.3f / expansion;
unsigned char colorbv[FZ_MAX_COLORS + 1];
float colorfv[FZ_MAX_COLORS];
- fz_rect bbox;
+ fz_irect bbox;
int i;
fz_draw_state *state = &dev->stack[dev->top];
fz_colorspace *model = state->dest->colorspace;
@@ -259,7 +259,7 @@ fz_draw_fill_path(fz_device *devp, fz_path *path, int even_odd, fz_matrix ctm,
fz_sort_gel(dev->gel);
bbox = fz_bound_gel(dev->gel);
- bbox = fz_intersect_rect(bbox, state->scissor);
+ bbox = fz_intersect_irect(bbox, state->scissor);
if (fz_is_empty_rect(bbox))
return;
@@ -297,7 +297,7 @@ fz_draw_stroke_path(fz_device *devp, fz_path *path, fz_stroke_state *stroke, fz_
float linewidth = stroke->linewidth;
unsigned char colorbv[FZ_MAX_COLORS + 1];
float colorfv[FZ_MAX_COLORS];
- fz_rect bbox;
+ fz_irect bbox;
int i;
fz_draw_state *state = &dev->stack[dev->top];
fz_colorspace *model = state->dest->colorspace;
@@ -316,7 +316,7 @@ fz_draw_stroke_path(fz_device *devp, fz_path *path, fz_stroke_state *stroke, fz_
fz_sort_gel(dev->gel);
bbox = fz_bound_gel(dev->gel);
- bbox = fz_intersect_rect(bbox, state->scissor);
+ bbox = fz_intersect_irect(bbox, state->scissor);
if (fz_is_empty_rect(bbox))
return;
@@ -353,7 +353,7 @@ fz_draw_clip_path(fz_device *devp, fz_path *path, fz_rect rect, int even_odd, fz
fz_draw_device *dev = devp->user;
float expansion = fz_matrix_expansion(ctm);
float flatness = 0.3f / expansion;
- fz_rect bbox;
+ fz_irect bbox;
fz_draw_state *state = &dev->stack[dev->top];
fz_colorspace *model;
fz_context *ctx = dev->ctx;
@@ -366,8 +366,8 @@ fz_draw_clip_path(fz_device *devp, fz_path *path, fz_rect rect, int even_odd, fz
model = state->dest->colorspace;
bbox = fz_bound_gel(dev->gel);
- bbox = fz_intersect_rect(bbox, state->scissor);
- bbox = fz_intersect_rect(bbox, fz_rect_covering_rect(rect));
+ bbox = fz_intersect_irect(bbox, state->scissor);
+ bbox = fz_intersect_irect(bbox, fz_rect_covering_rect(rect));
if (fz_is_empty_rect(bbox) || fz_is_rect_gel(dev->gel))
{
@@ -412,7 +412,7 @@ fz_draw_clip_stroke_path(fz_device *devp, fz_path *path, fz_rect rect, fz_stroke
float expansion = fz_matrix_expansion(ctm);
float flatness = 0.3f / expansion;
float linewidth = stroke->linewidth;
- fz_rect bbox;
+ fz_irect bbox;
fz_draw_state *state = &dev->stack[dev->top];
fz_colorspace *model;
fz_context *ctx = dev->ctx;
@@ -431,8 +431,8 @@ fz_draw_clip_stroke_path(fz_device *devp, fz_path *path, fz_rect rect, fz_stroke
model = state->dest->colorspace;
bbox = fz_bound_gel(dev->gel);
- bbox = fz_intersect_rect(bbox, state->scissor);
- bbox = fz_intersect_rect(bbox, fz_rect_covering_rect(rect));
+ bbox = fz_intersect_irect(bbox, state->scissor);
+ bbox = fz_intersect_irect(bbox, fz_rect_covering_rect(rect));
fz_try(ctx)
{
@@ -463,15 +463,15 @@ fz_draw_clip_stroke_path(fz_device *devp, fz_path *path, fz_rect rect, fz_stroke
static void
draw_glyph(unsigned char *colorbv, fz_pixmap *dst, fz_pixmap *msk,
- int xorig, int yorig, fz_rect scissor)
+ int xorig, int yorig, fz_irect scissor)
{
unsigned char *dp, *mp;
- fz_rect bbox;
+ fz_irect bbox;
int x, y, w, h;
bbox = fz_pixmap_bbox_no_ctx(msk);
- bbox = fz_translate_rect(bbox, xorig, yorig);
- bbox = fz_intersect_rect(bbox, scissor); /* scissor < dst */
+ bbox = fz_translate_irect(bbox, xorig, yorig);
+ bbox = fz_intersect_irect(bbox, scissor); /* scissor < dst */
x = bbox.x0;
y = bbox.y0;
w = bbox.x1 - bbox.x0;
@@ -506,7 +506,7 @@ fz_draw_fill_text(fz_device *devp, fz_text *text, fz_matrix ctm,
int i, x, y, gid;
fz_draw_state *state = &dev->stack[dev->top];
fz_colorspace *model = state->dest->colorspace;
- fz_rect scissor = state->scissor;
+ fz_irect scissor = state->scissor;
if (state->blendmode & FZ_BLEND_KNOCKOUT)
state = fz_knockout_begin(dev);
@@ -585,7 +585,7 @@ fz_draw_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke, fz_
int i, x, y, gid;
fz_draw_state *state = &dev->stack[dev->top];
fz_colorspace *model = state->dest->colorspace;
- fz_rect scissor = state->scissor;
+ fz_irect scissor = state->scissor;
if (state->blendmode & FZ_BLEND_KNOCKOUT)
state = fz_knockout_begin(dev);
@@ -648,7 +648,7 @@ fz_draw_clip_text(fz_device *devp, fz_text *text, fz_matrix ctm, int accumulate)
{
fz_draw_device *dev = devp->user;
fz_context *ctx = dev->ctx;
- fz_rect bbox;
+ fz_irect bbox;
fz_pixmap *mask, *dest, *shape;
fz_matrix tm, trm, trunc_trm;
fz_pixmap *glyph;
@@ -667,7 +667,7 @@ fz_draw_clip_text(fz_device *devp, fz_text *text, fz_matrix ctm, int accumulate)
{
/* make the mask the exact size needed */
bbox = fz_rect_covering_rect(fz_bound_text(dev->ctx, text, ctm));
- bbox = fz_intersect_rect(bbox, state->scissor);
+ bbox = fz_intersect_irect(bbox, state->scissor);
}
else
{
@@ -782,7 +782,7 @@ fz_draw_clip_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke
{
fz_draw_device *dev = devp->user;
fz_context *ctx = dev->ctx;
- fz_rect bbox;
+ fz_irect bbox;
fz_pixmap *mask, *dest, *shape;
fz_matrix tm, trm, trunc_trm;
fz_pixmap *glyph;
@@ -792,7 +792,7 @@ fz_draw_clip_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke
/* make the mask the exact size needed */
bbox = fz_rect_covering_rect(fz_bound_text(dev->ctx, text, ctm));
- bbox = fz_intersect_rect(bbox, state->scissor);
+ bbox = fz_intersect_irect(bbox, state->scissor);
fz_try(ctx)
{
@@ -893,7 +893,7 @@ fz_draw_fill_shade(fz_device *devp, fz_shade *shade, fz_matrix ctm, float alpha)
{
fz_draw_device *dev = devp->user;
fz_rect bounds;
- fz_rect bbox, scissor;
+ fz_irect bbox, scissor;
fz_pixmap *dest, *shape;
float colorfv[FZ_MAX_COLORS];
unsigned char colorbv[FZ_MAX_COLORS + 1];
@@ -902,7 +902,7 @@ fz_draw_fill_shade(fz_device *devp, fz_shade *shade, fz_matrix ctm, float alpha)
bounds = fz_bound_shade(dev->ctx, shade, ctm);
scissor = state->scissor;
- bbox = fz_intersect_rect(fz_rect_covering_rect(bounds), scissor);
+ bbox = fz_intersect_irect(fz_rect_covering_rect(bounds), scissor);
if (fz_is_empty_rect(bbox))
return;
@@ -982,7 +982,7 @@ fz_draw_fill_shade(fz_device *devp, fz_shade *shade, fz_matrix ctm, float alpha)
}
static fz_pixmap *
-fz_transform_pixmap(fz_draw_device *dev, fz_pixmap *image, fz_matrix *ctm, int x, int y, int dx, int dy, int gridfit, fz_rect *clip)
+fz_transform_pixmap(fz_draw_device *dev, fz_pixmap *image, fz_matrix *ctm, int x, int y, int dx, int dy, int gridfit, fz_irect *clip)
{
fz_pixmap *scaled;
fz_context *ctx = dev->ctx;
@@ -1007,7 +1007,7 @@ fz_transform_pixmap(fz_draw_device *dev, fz_pixmap *image, fz_matrix *ctm, int x
{
/* Other orthogonal flip/rotation cases */
fz_matrix m = *ctm;
- fz_rect rclip;
+ fz_irect rclip;
if (gridfit)
fz_gridfit_matrix(&m);
if (clip)
@@ -1050,9 +1050,9 @@ fz_draw_fill_image(fz_device *devp, fz_image *image, fz_matrix ctm, float alpha)
fz_context *ctx = dev->ctx;
fz_draw_state *state = &dev->stack[dev->top];
fz_colorspace *model = state->dest->colorspace;
- fz_rect clip = fz_pixmap_bbox(ctx, state->dest);
+ fz_irect clip = fz_pixmap_bbox(ctx, state->dest);
- clip = fz_intersect_rect(clip, state->scissor);
+ clip = fz_intersect_irect(clip, state->scissor);
fz_var(scaled);
@@ -1154,9 +1154,9 @@ fz_draw_fill_image_mask(fz_device *devp, fz_image *image, fz_matrix ctm,
fz_context *ctx = dev->ctx;
fz_draw_state *state = &dev->stack[dev->top];
fz_colorspace *model = state->dest->colorspace;
- fz_rect clip = fz_pixmap_bbox(ctx, state->dest);
+ fz_irect clip = fz_pixmap_bbox(ctx, state->dest);
- clip = fz_intersect_rect(clip, state->scissor);
+ clip = fz_intersect_irect(clip, state->scissor);
if (image->w == 0 || image->h == 0)
return;
@@ -1215,7 +1215,7 @@ fz_draw_clip_image_mask(fz_device *devp, fz_image *image, fz_rect rect, fz_matri
{
fz_draw_device *dev = devp->user;
fz_context *ctx = dev->ctx;
- fz_rect bbox;
+ fz_irect bbox;
fz_pixmap *mask = NULL;
fz_pixmap *dest = NULL;
fz_pixmap *shape = NULL;
@@ -1225,9 +1225,9 @@ fz_draw_clip_image_mask(fz_device *devp, fz_image *image, fz_rect rect, fz_matri
int dx, dy;
fz_draw_state *state = push_stack(dev);
fz_colorspace *model = state->dest->colorspace;
- fz_rect clip = fz_pixmap_bbox(ctx, state->dest);
+ fz_irect clip = fz_pixmap_bbox(ctx, state->dest);
- clip = fz_intersect_rect(clip, state->scissor);
+ clip = fz_intersect_irect(clip, state->scissor);
fz_var(mask);
fz_var(dest);
@@ -1240,7 +1240,7 @@ fz_draw_clip_image_mask(fz_device *devp, fz_image *image, fz_rect rect, fz_matri
#ifdef DUMP_GROUP_BLENDS
dump_spaces(dev->top-1, "Clip (image mask) (empty) begin\n");
#endif
- state[1].scissor = fz_empty_rect;
+ state[1].scissor = fz_empty_irect;
state[1].mask = NULL;
return;
}
@@ -1250,8 +1250,8 @@ fz_draw_clip_image_mask(fz_device *devp, fz_image *image, fz_rect rect, fz_matri
#endif
bbox = fz_rect_covering_rect(fz_transform_rect(ctm, fz_unit_rect));
- bbox = fz_intersect_rect(bbox, state->scissor);
- bbox = fz_intersect_rect(bbox, fz_rect_covering_rect(rect));
+ bbox = fz_intersect_irect(bbox, state->scissor);
+ bbox = fz_intersect_irect(bbox, fz_rect_covering_rect(rect));
dx = sqrtf(ctm.a * ctm.a + ctm.b * ctm.b);
dy = sqrtf(ctm.c * ctm.c + ctm.d * ctm.d);
@@ -1360,13 +1360,13 @@ fz_draw_begin_mask(fz_device *devp, fz_rect rect, int luminosity, fz_colorspace
{
fz_draw_device *dev = devp->user;
fz_pixmap *dest;
- fz_rect bbox;
+ fz_irect bbox;
fz_draw_state *state = push_stack(dev);
fz_pixmap *shape = state->shape;
fz_context *ctx = dev->ctx;
bbox = fz_rect_covering_rect(rect);
- bbox = fz_intersect_rect(bbox, state->scissor);
+ bbox = fz_intersect_irect(bbox, state->scissor);
fz_try(ctx)
{
@@ -1416,7 +1416,7 @@ fz_draw_end_mask(fz_device *devp)
{
fz_draw_device *dev = devp->user;
fz_pixmap *temp, *dest;
- fz_rect bbox;
+ fz_irect bbox;
int luminosity;
fz_context *ctx = dev->ctx;
fz_draw_state *state;
@@ -1468,7 +1468,7 @@ static void
fz_draw_begin_group(fz_device *devp, fz_rect rect, int isolated, int knockout, int blendmode, float alpha)
{
fz_draw_device *dev = devp->user;
- fz_rect bbox;
+ fz_irect bbox;
fz_pixmap *dest, *shape;
fz_context *ctx = dev->ctx;
fz_draw_state *state = &dev->stack[dev->top];
@@ -1479,7 +1479,7 @@ fz_draw_begin_group(fz_device *devp, fz_rect rect, int isolated, int knockout, i
state = push_stack(dev);
bbox = fz_rect_covering_rect(rect);
- bbox = fz_intersect_rect(bbox, state->scissor);
+ bbox = fz_intersect_irect(bbox, state->scissor);
fz_try(ctx)
{
@@ -1591,7 +1591,7 @@ fz_draw_begin_tile(fz_device *devp, fz_rect area, fz_rect view, float xstep, flo
fz_draw_device *dev = devp->user;
fz_pixmap *dest = NULL;
fz_pixmap *shape;
- fz_rect bbox;
+ fz_irect bbox;
fz_context *ctx = dev->ctx;
fz_draw_state *state = &dev->stack[dev->top];
fz_colorspace *model = state->dest->colorspace;
@@ -1624,7 +1624,7 @@ fz_draw_begin_tile(fz_device *devp, fz_rect area, fz_rect view, float xstep, flo
state[1].blendmode |= FZ_BLEND_ISOLATED;
state[1].xstep = xstep;
state[1].ystep = ystep;
- state[1].area = area;
+ state[1].area = fz_rect_covering_rect(area);
state[1].ctm = ctm;
#ifdef DUMP_GROUP_BLENDS
dump_spaces(dev->top-1, "Tile begin\n");
@@ -1645,8 +1645,8 @@ fz_draw_end_tile(fz_device *devp)
fz_draw_device *dev = devp->user;
float xstep, ystep;
fz_matrix ttm, ctm, shapectm;
- fz_rect area, scissor;
- fz_rect scissor_box;
+ fz_irect area, scissor;
+ fz_rect scissor_tmp;
int x0, y0, x1, y1, x, y;
fz_context *ctx = dev->ctx;
fz_draw_state *state;
@@ -1665,13 +1665,11 @@ fz_draw_end_tile(fz_device *devp)
/* Fudge the scissor bbox a little to allow for inaccuracies in the
* matrix inversion. */
- scissor_box = fz_expand_rect(state[0].scissor, 1);
- scissor.x0 = (float)scissor_box.x0;
- scissor.y0 = (float)scissor_box.y0;
- scissor.x1 = (float)scissor_box.x1;
- scissor.y1 = (float)scissor_box.y1;
- scissor = fz_transform_rect(fz_invert_matrix(ctm), scissor);
- area = fz_intersect_rect(area, scissor);
+ scissor_tmp = fz_rect_from_irect(state[0].scissor);
+ scissor_tmp = fz_expand_rect(scissor_tmp, 1);
+ scissor_tmp = fz_transform_rect(fz_invert_matrix(ctm), scissor_tmp);
+ scissor = fz_rect_covering_rect(scissor_tmp);
+ area = fz_intersect_irect(area, scissor);
x0 = floorf(area.x0 / xstep);
y0 = floorf(area.y0 / ystep);
@@ -1831,7 +1829,7 @@ fz_new_draw_device(fz_context *ctx, fz_pixmap *dest)
}
fz_device *
-fz_new_draw_device_with_bbox(fz_context *ctx, fz_pixmap *dest, fz_rect clip)
+fz_new_draw_device_with_bbox(fz_context *ctx, fz_pixmap *dest, fz_irect clip)
{
fz_device *dev = fz_new_draw_device(ctx, dest);
fz_draw_device *ddev = dev->user;
diff --git a/draw/draw_edge.c b/draw/draw_edge.c
index df59ba14..c5438ffe 100644
--- a/draw/draw_edge.c
+++ b/draw/draw_edge.c
@@ -203,7 +203,7 @@ fz_new_gel(fz_context *ctx)
}
void
-fz_reset_gel(fz_gel *gel, fz_rect clip)
+fz_reset_gel(fz_gel *gel, fz_irect clip)
{
fz_aa_context *ctxaa = gel->ctx->aa;
@@ -235,13 +235,13 @@ fz_free_gel(fz_gel *gel)
fz_free(gel->ctx, gel);
}
-fz_rect
+fz_irect
fz_bound_gel(fz_gel *gel)
{
- fz_rect bbox;
+ fz_irect bbox;
fz_aa_context *ctxaa = gel->ctx->aa;
if (gel->len == 0)
- return fz_empty_rect;
+ return fz_empty_irect;
bbox.x0 = fz_idiv(gel->bbox.x0, fz_aa_hscale);
bbox.y0 = fz_idiv(gel->bbox.y0, fz_aa_vscale);
bbox.x1 = fz_idiv(gel->bbox.x1, fz_aa_hscale) + 1;
@@ -666,7 +666,7 @@ static inline void blit_aa(fz_pixmap *dst, int x, int y,
}
static void
-fz_scan_convert_aa(fz_gel *gel, int eofill, fz_rect clip,
+fz_scan_convert_aa(fz_gel *gel, int eofill, fz_irect clip,
fz_pixmap *dst, unsigned char *color)
{
unsigned char *alphas;
@@ -851,7 +851,7 @@ clip_ended:
*/
static inline void blit_sharp(int x0, int x1, int y,
- fz_rect clip, fz_pixmap *dst, unsigned char *color)
+ fz_irect clip, fz_pixmap *dst, unsigned char *color)
{
unsigned char *dp;
x0 = fz_clampi(x0, dst->x, dst->x + dst->w);
@@ -867,7 +867,7 @@ static inline void blit_sharp(int x0, int x1, int y,
}
static inline void non_zero_winding_sharp(fz_gel *gel, int y,
- fz_rect clip, fz_pixmap *dst, unsigned char *color)
+ fz_irect clip, fz_pixmap *dst, unsigned char *color)
{
int winding = 0;
int x = 0;
@@ -883,7 +883,7 @@ static inline void non_zero_winding_sharp(fz_gel *gel, int y,
}
static inline void even_odd_sharp(fz_gel *gel, int y,
- fz_rect clip, fz_pixmap *dst, unsigned char *color)
+ fz_irect clip, fz_pixmap *dst, unsigned char *color)
{
int even = 0;
int x = 0;
@@ -899,7 +899,7 @@ static inline void even_odd_sharp(fz_gel *gel, int y,
}
static void
-fz_scan_convert_sharp(fz_gel *gel, int eofill, fz_rect clip,
+fz_scan_convert_sharp(fz_gel *gel, int eofill, fz_irect clip,
fz_pixmap *dst, unsigned char *color)
{
int e = 0;
@@ -955,7 +955,7 @@ fz_scan_convert_sharp(fz_gel *gel, int eofill, fz_rect clip,
}
void
-fz_scan_convert(fz_gel *gel, int eofill, fz_rect clip,
+fz_scan_convert(fz_gel *gel, int eofill, fz_irect clip,
fz_pixmap *dst, unsigned char *color)
{
fz_aa_context *ctxaa = gel->ctx->aa;
diff --git a/draw/draw_glyph.c b/draw/draw_glyph.c
index 40c71241..93caf478 100644
--- a/draw/draw_glyph.c
+++ b/draw/draw_glyph.c
@@ -95,7 +95,7 @@ fz_keep_glyph_cache(fz_context *ctx)
}
fz_pixmap *
-fz_render_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_matrix ctm, fz_stroke_state *stroke, fz_rect scissor)
+fz_render_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_matrix ctm, fz_stroke_state *stroke, fz_irect scissor)
{
if (font->ft_face)
{
@@ -116,7 +116,7 @@ fz_render_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm,
This must not be inserted into the cache.
*/
fz_pixmap *
-fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm, fz_colorspace *model, fz_rect scissor)
+fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm, fz_colorspace *model, fz_irect scissor)
{
fz_glyph_cache *cache;
fz_glyph_key key;
@@ -126,7 +126,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm, fz_color
if (size <= MAX_GLYPH_SIZE)
{
- scissor = fz_infinite_rect;
+ scissor = fz_infinite_irect;
do_cache = 1;
}
else
diff --git a/draw/draw_mesh.c b/draw/draw_mesh.c
index 98669e17..bbd3dc02 100644
--- a/draw/draw_mesh.c
+++ b/draw/draw_mesh.c
@@ -213,7 +213,7 @@ static inline void step_edge(int *ael, int *del, int n)
}
static void
-fz_paint_triangle(fz_pixmap *pix, float *av, float *bv, float *cv, int n, fz_rect bbox)
+fz_paint_triangle(fz_pixmap *pix, float *av, float *bv, float *cv, int n, fz_irect bbox)
{
float poly[MAXV][MAXN];
float temp[MAXV][MAXN];
@@ -307,7 +307,7 @@ struct paint_tri_data
fz_context *ctx;
fz_shade *shade;
fz_pixmap *dest;
- fz_rect bbox;
+ fz_irect bbox;
};
static void
@@ -349,7 +349,7 @@ do_paint_tri(void *arg, fz_vertex *av, fz_vertex *bv, fz_vertex *cv)
}
void
-fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_pixmap *dest, fz_rect bbox)
+fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_pixmap *dest, fz_irect bbox)
{
unsigned char clut[256][FZ_MAX_COLORS];
fz_pixmap *temp = NULL;
diff --git a/draw/draw_paint.c b/draw/draw_paint.c
index 2f6ef368..de0f1d34 100644
--- a/draw/draw_paint.c
+++ b/draw/draw_paint.c
@@ -375,15 +375,15 @@ fz_paint_span(byte * restrict dp, byte * restrict sp, int n, int w, int alpha)
*/
void
-fz_paint_pixmap_with_bbox(fz_pixmap *dst, fz_pixmap *src, int alpha, fz_rect bbox)
+fz_paint_pixmap_with_bbox(fz_pixmap *dst, fz_pixmap *src, int alpha, fz_irect bbox)
{
unsigned char *sp, *dp;
int x, y, w, h, n;
assert(dst->n == src->n);
- bbox = fz_intersect_rect(bbox, fz_pixmap_bbox_no_ctx(dst));
- bbox = fz_intersect_rect(bbox, fz_pixmap_bbox_no_ctx(src));
+ bbox = fz_intersect_irect(bbox, fz_pixmap_bbox_no_ctx(dst));
+ bbox = fz_intersect_irect(bbox, fz_pixmap_bbox_no_ctx(src));
x = bbox.x0;
y = bbox.y0;
@@ -408,13 +408,13 @@ void
fz_paint_pixmap(fz_pixmap *dst, fz_pixmap *src, int alpha)
{
unsigned char *sp, *dp;
- fz_rect bbox;
+ fz_irect bbox;
int x, y, w, h, n;
assert(dst->n == src->n);
bbox = fz_pixmap_bbox_no_ctx(dst);
- bbox = fz_intersect_rect(bbox, fz_pixmap_bbox_no_ctx(src));
+ bbox = fz_intersect_irect(bbox, fz_pixmap_bbox_no_ctx(src));
x = bbox.x0;
y = bbox.y0;
@@ -439,15 +439,15 @@ void
fz_paint_pixmap_with_mask(fz_pixmap *dst, fz_pixmap *src, fz_pixmap *msk)
{
unsigned char *sp, *dp, *mp;
- fz_rect bbox;
+ fz_irect bbox;
int x, y, w, h, n;
assert(dst->n == src->n);
assert(msk->n == 1);
bbox = fz_pixmap_bbox_no_ctx(dst);
- bbox = fz_intersect_rect(bbox, fz_pixmap_bbox_no_ctx(src));
- bbox = fz_intersect_rect(bbox, fz_pixmap_bbox_no_ctx(msk));
+ bbox = fz_intersect_irect(bbox, fz_pixmap_bbox_no_ctx(src));
+ bbox = fz_intersect_irect(bbox, fz_pixmap_bbox_no_ctx(msk));
x = bbox.x0;
y = bbox.y0;
diff --git a/draw/draw_scale.c b/draw/draw_scale.c
index a2439216..8cb99166 100644
--- a/draw/draw_scale.c
+++ b/draw/draw_scale.c
@@ -1238,13 +1238,13 @@ scale_single_col(unsigned char *dst, unsigned char *src, fz_weights *weights, in
#endif /* SINGLE_PIXEL_SPECIALS */
fz_pixmap *
-fz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_rect *clip)
+fz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_irect *clip)
{
return fz_scale_pixmap_cached(ctx, src, x, y, w, h, clip, NULL, NULL);
}
fz_pixmap *
-fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_rect *clip, fz_scale_cache *cache_x, fz_scale_cache *cache_y)
+fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_irect *clip, fz_scale_cache *cache_x, fz_scale_cache *cache_y)
{
fz_scale_filter *filter = &fz_scale_filter_simple;
fz_weights *contrib_rows = NULL;
diff --git a/draw/draw_simple_scale.c b/draw/draw_simple_scale.c
index d2b69cf9..60914e52 100644
--- a/draw/draw_simple_scale.c
+++ b/draw/draw_simple_scale.c
@@ -1214,13 +1214,13 @@ scale_single_col(unsigned char *dst, unsigned char *src, fz_weights *weights, in
#endif /* SINGLE_PIXEL_SPECIALS */
fz_pixmap *
-fz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_rect *clip)
+fz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_irect *clip)
{
return fz_scale_pixmap_cached(ctx, src, x, y, w, h, clip, NULL, NULL);
}
fz_pixmap *
-fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_rect *clip, fz_scale_cache *cache_x, fz_scale_cache *cache_y)
+fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_irect *clip, fz_scale_cache *cache_x, fz_scale_cache *cache_y)
{
fz_scale_filter *filter = &fz_scale_filter_simple;
fz_weights *contrib_rows = NULL;