summaryrefslogtreecommitdiff
path: root/fitz/fitz.h
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2011-07-06 16:32:33 +0100
committerRobin Watts <Robin.Watts@artifex.com>2011-07-08 19:26:34 +0100
commit2c4bbbfdc7413a68cad395c3c61ff8e62dceb18b (patch)
treec2299029fa26028103e533c2dce15aa18d9a8d76 /fitz/fitz.h
parent2f8acb0010c469c46682a298d66b108cc4c6cdd0 (diff)
downloadmupdf-2c4bbbfdc7413a68cad395c3c61ff8e62dceb18b.tar.xz
Clip area optimisations for displaylist case:
First, we add clipping rects to clipping functions. Various functions (the ones that handle clipping) are now additionally passed a rectangle that represents an additional bound for this clip in device space (i.e. it has already been mapped through the current ctm). Next, when constructing the displaylist, keep track of the bounding box for the contents of each clip. While writing the list, on every node we add, we add the bbox for that node to the enclosing clips content bbox (if there is an enclosing clip). When we pop a clip, write back to the corresponding push to update the bbox. This means if we get large clip regions, with only small areas used within them, we will only do the slow blending for those small areas. Finally, we fix a calculation in fz_bound_path which was incorrectly accounting for mitrelimits. This was showing up in testing on page 630 of the PDF reference v1.7.
Diffstat (limited to 'fitz/fitz.h')
-rw-r--r--fitz/fitz.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h
index 381ae919..5bc22f4e 100644
--- a/fitz/fitz.h
+++ b/fitz/fitz.h
@@ -264,7 +264,9 @@ float fz_matrix_expansion(fz_matrix m);
fz_bbox fz_round_rect(fz_rect r);
fz_bbox fz_intersect_bbox(fz_bbox a, fz_bbox b);
+fz_rect fz_intersect_rect(fz_rect a, fz_rect b);
fz_bbox fz_union_bbox(fz_bbox a, fz_bbox b);
+fz_rect fz_union_rect(fz_rect a, fz_rect b);
fz_point fz_transform_point(fz_matrix m, fz_point p);
fz_point fz_transform_vector(fz_matrix m, fz_point p);
@@ -954,8 +956,8 @@ struct fz_device_s
void (*fill_path)(void *, fz_path *, int even_odd, fz_matrix, fz_colorspace *, float *color, float alpha);
void (*stroke_path)(void *, fz_path *, fz_stroke_state *, fz_matrix, fz_colorspace *, float *color, float alpha);
- void (*clip_path)(void *, fz_path *, int even_odd, fz_matrix);
- void (*clip_stroke_path)(void *, fz_path *, fz_stroke_state *, fz_matrix);
+ void (*clip_path)(void *, fz_path *, fz_rect *rect, int even_odd, fz_matrix);
+ void (*clip_stroke_path)(void *, fz_path *, fz_rect *rect, fz_stroke_state *, fz_matrix);
void (*fill_text)(void *, fz_text *, fz_matrix, fz_colorspace *, float *color, float alpha);
void (*stroke_text)(void *, fz_text *, fz_stroke_state *, fz_matrix, fz_colorspace *, float *color, float alpha);
@@ -966,7 +968,7 @@ struct fz_device_s
void (*fill_shade)(void *, fz_shade *shd, fz_matrix ctm, float alpha);
void (*fill_image)(void *, fz_pixmap *img, fz_matrix ctm, float alpha);
void (*fill_image_mask)(void *, fz_pixmap *img, fz_matrix ctm, fz_colorspace *, float *color, float alpha);
- void (*clip_image_mask)(void *, fz_pixmap *img, fz_matrix ctm);
+ void (*clip_image_mask)(void *, fz_pixmap *img, fz_rect *rect, fz_matrix ctm);
void (*pop_clip)(void *);
@@ -981,8 +983,8 @@ struct fz_device_s
void fz_fill_path(fz_device *dev, fz_path *path, int even_odd, fz_matrix ctm, fz_colorspace *colorspace, float *color, float alpha);
void fz_stroke_path(fz_device *dev, fz_path *path, fz_stroke_state *stroke, fz_matrix ctm, fz_colorspace *colorspace, float *color, float alpha);
-void fz_clip_path(fz_device *dev, fz_path *path, int even_odd, fz_matrix ctm);
-void fz_clip_stroke_path(fz_device *dev, fz_path *path, fz_stroke_state *stroke, fz_matrix ctm);
+void fz_clip_path(fz_device *dev, fz_path *path, fz_rect *rect, int even_odd, fz_matrix ctm);
+void fz_clip_stroke_path(fz_device *dev, fz_path *path, fz_rect *rect, fz_stroke_state *stroke, fz_matrix ctm);
void fz_fill_text(fz_device *dev, fz_text *text, fz_matrix ctm, fz_colorspace *colorspace, float *color, float alpha);
void fz_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, fz_matrix ctm, fz_colorspace *colorspace, float *color, float alpha);
void fz_clip_text(fz_device *dev, fz_text *text, fz_matrix ctm, int accumulate);
@@ -992,7 +994,7 @@ void fz_pop_clip(fz_device *dev);
void fz_fill_shade(fz_device *dev, fz_shade *shade, fz_matrix ctm, float alpha);
void fz_fill_image(fz_device *dev, fz_pixmap *image, fz_matrix ctm, float alpha);
void fz_fill_image_mask(fz_device *dev, fz_pixmap *image, fz_matrix ctm, fz_colorspace *colorspace, float *color, float alpha);
-void fz_clip_image_mask(fz_device *dev, fz_pixmap *image, fz_matrix ctm);
+void fz_clip_image_mask(fz_device *dev, fz_pixmap *image, fz_rect *rect, fz_matrix ctm);
void fz_begin_mask(fz_device *dev, fz_rect area, int luminosity, fz_colorspace *colorspace, float *bc);
void fz_end_mask(fz_device *dev);
void fz_begin_group(fz_device *dev, fz_rect area, int isolated, int knockout, int blendmode, float alpha);