summaryrefslogtreecommitdiff
path: root/fitz/dev_list.c
diff options
context:
space:
mode:
Diffstat (limited to 'fitz/dev_list.c')
-rw-r--r--fitz/dev_list.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/fitz/dev_list.c b/fitz/dev_list.c
index 376cdac8..c6a71ec9 100644
--- a/fitz/dev_list.c
+++ b/fitz/dev_list.c
@@ -591,7 +591,7 @@ fz_free_display_list(fz_context *ctx, fz_display_list *list)
}
void
-fz_execute_display_list(fz_display_list *list, fz_device *dev, fz_matrix top_ctm, fz_bbox scissor)
+fz_execute_display_list(fz_display_list *list, fz_device *dev, fz_matrix top_ctm, fz_bbox scissor, fz_cookie *cookie)
{
fz_display_node *node;
fz_matrix ctm;
@@ -600,6 +600,7 @@ fz_execute_display_list(fz_display_list *list, fz_device *dev, fz_matrix top_ctm
int clipped = 0;
int tiled = 0;
int empty;
+ int progress = 0;
if (!fz_is_infinite_bbox(scissor))
{
@@ -609,8 +610,22 @@ fz_execute_display_list(fz_display_list *list, fz_device *dev, fz_matrix top_ctm
scissor.x1 += 20; scissor.y1 += 20;
}
+ if (cookie)
+ {
+ cookie->progress_max = list->last - list->first;
+ cookie->progress = 0;
+ }
+
for (node = list->first; node; node = node->next)
{
+ /* Check the cookie for aborting */
+ if (cookie)
+ {
+ if (cookie->abort)
+ break;
+ cookie->progress = progress++;
+ }
+
/* cull objects to draw using a quick visibility test */
if (tiled || node->cmd == FZ_CMD_BEGIN_TILE || node->cmd == FZ_CMD_END_TILE)