From e0b9e65a09ebaa0d94b80b1504a2d285186125e3 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Thu, 31 Jan 2013 17:36:16 +0000 Subject: Add some 'restrict' qualifiers to hopefully speed matrix ops. Also, move fz_is_infinite_rect and fz_is_empty_rect to be a static inline rather than a macro. (Static inlines are preferred over macros by at least one customers). We appear to be calling them with bboxes too, so add fz_is_infinite_bbox and fz_is_empty_bbox to solve this. --- draw/draw_device.c | 14 +++++++------- draw/draw_edge.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'draw') diff --git a/draw/draw_device.c b/draw/draw_device.c index 21fe71db..79c3d02a 100644 --- a/draw/draw_device.c +++ b/draw/draw_device.c @@ -260,7 +260,7 @@ fz_draw_fill_path(fz_device *devp, fz_path *path, int even_odd, const fz_matrix fz_intersect_bbox(fz_bound_gel(dev->gel, &bbox), &state->scissor); - if (fz_is_empty_rect(&bbox)) + if (fz_is_empty_bbox(&bbox)) return; if (state->blendmode & FZ_BLEND_KNOCKOUT) @@ -316,7 +316,7 @@ fz_draw_stroke_path(fz_device *devp, fz_path *path, fz_stroke_state *stroke, con fz_intersect_bbox(fz_bound_gel(dev->gel, &bbox), &state->scissor); - if (fz_is_empty_rect(&bbox)) + if (fz_is_empty_bbox(&bbox)) return; if (state->blendmode & FZ_BLEND_KNOCKOUT) @@ -370,7 +370,7 @@ fz_draw_clip_path(fz_device *devp, fz_path *path, const fz_rect *rect, int even_ fz_intersect_bbox(&bbox, fz_bbox_from_rect(&bbox2, rect)); } - if (fz_is_empty_rect(&bbox) || fz_is_rect_gel(dev->gel)) + if (fz_is_empty_bbox(&bbox) || fz_is_rect_gel(dev->gel)) { state[1].scissor = bbox; state[1].mask = NULL; @@ -450,7 +450,7 @@ fz_draw_clip_stroke_path(fz_device *devp, fz_path *path, const fz_rect *rect, fz fz_clear_pixmap(dev->ctx, state[1].shape); } - if (!fz_is_empty_rect(&bbox)) + if (!fz_is_empty_bbox(&bbox)) fz_scan_convert(dev->gel, 0, &bbox, state[1].mask, NULL); state[1].blendmode |= FZ_BLEND_ISOLATED; @@ -713,7 +713,7 @@ fz_draw_clip_text(fz_device *devp, fz_text *text, const fz_matrix *ctm, int accu dev->top--; } - if (!fz_is_empty_rect(&bbox) && mask) + if (!fz_is_empty_bbox(&bbox) && mask) { tm = text->trm; @@ -822,7 +822,7 @@ fz_draw_clip_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke dump_spaces(dev->top-1, "Clip (stroke text) begin\n"); #endif - if (!fz_is_empty_rect(&bbox)) + if (!fz_is_empty_bbox(&bbox)) { tm = text->trm; @@ -912,7 +912,7 @@ fz_draw_fill_shade(fz_device *devp, fz_shade *shade, const fz_matrix *ctm, float scissor = state->scissor; fz_intersect_bbox(fz_bbox_from_rect(&bbox, &bounds), &scissor); - if (fz_is_empty_rect(&bbox)) + if (fz_is_empty_bbox(&bbox)) return; if (!model) diff --git a/draw/draw_edge.c b/draw/draw_edge.c index dca6a648..4f9994d1 100644 --- a/draw/draw_edge.c +++ b/draw/draw_edge.c @@ -207,7 +207,7 @@ fz_reset_gel(fz_gel *gel, const fz_bbox *clip) { fz_aa_context *ctxaa = gel->ctx->aa; - if (fz_is_infinite_rect(clip)) + if (fz_is_infinite_bbox(clip)) { gel->clip.x0 = gel->clip.y0 = BBOX_MAX; gel->clip.x1 = gel->clip.y1 = BBOX_MIN; -- cgit v1.2.3