diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-01-24 16:36:38 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-01-24 16:36:38 +0000 |
commit | 79edec2f5800d97e05efac0cc6f61803854b53d8 (patch) | |
tree | f1bd49960ff7fb337fd746b2b059a13d2707a588 /draw/draw_device.c | |
parent | 9f5b5881b55492b14e55cffa3ac962f454721639 (diff) | |
download | mupdf-79edec2f5800d97e05efac0cc6f61803854b53d8.tar.xz |
Correct SEGV/assert in cluster tests.
fz_draw_fill_image_mask was improperly nesting group start/ends, by
calling fz_knockout_start at the top, and then fz_knockout_start
again at the end. Changing this latter one to fz_knockout_end
solves the problem.
Also tweak the debugging code slightly to give more readable results.
Diffstat (limited to 'draw/draw_device.c')
-rw-r--r-- | draw/draw_device.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/draw/draw_device.c b/draw/draw_device.c index 181a0000..63c2bc32 100644 --- a/draw/draw_device.c +++ b/draw/draw_device.c @@ -188,7 +188,7 @@ static void fz_knockout_end(fz_draw_device *dev) #ifdef DUMP_GROUP_BLENDS dump_spaces(dev->top, ""); - fz_dump_blend(dev->ctx, state[1].dest, "Blending "); + fz_dump_blend(dev->ctx, state[1].dest, "Knockout end: blending "); if (state[1].shape) fz_dump_blend(dev->ctx, state[1].shape, "/"); fz_dump_blend(dev->ctx, state[0].dest, " onto "); @@ -1024,7 +1024,7 @@ fz_draw_fill_image_mask(fz_device *devp, fz_pixmap *image, fz_matrix ctm, fz_drop_pixmap(dev->ctx, scaled); if (state->blendmode & FZ_BLEND_KNOCKOUT) - fz_knockout_begin(dev); + fz_knockout_end(dev); } static void @@ -1164,7 +1164,7 @@ fz_draw_pop_clip(fz_device *devp) else { #ifdef DUMP_GROUP_BLENDS - dump_spaces(dev->top, "Clip End\n"); + dump_spaces(dev->top, "Clip end\n"); #endif } } @@ -1325,7 +1325,7 @@ fz_draw_begin_group(fz_device *devp, fz_rect rect, int isolated, int knockout, i state[1].alpha = alpha; #ifdef DUMP_GROUP_BLENDS - dump_spaces(dev->top-1, "Group Begin\n"); + dump_spaces(dev->top-1, "Group begin\n"); #endif state[1].scissor = bbox; @@ -1356,7 +1356,7 @@ fz_draw_end_group(fz_device *devp) isolated = state[1].blendmode & FZ_BLEND_ISOLATED; #ifdef DUMP_GROUP_BLENDS dump_spaces(dev->top, ""); - fz_dump_blend(dev->ctx, state[1].dest, "Blending "); + fz_dump_blend(dev->ctx, state[1].dest, "Group end: blending "); if (state[1].shape) fz_dump_blend(dev->ctx, state[1].shape, "/"); fz_dump_blend(dev->ctx, state[0].dest, " onto "); @@ -1538,7 +1538,7 @@ fz_draw_free_user(fz_device *devp) if (dev->top > 0) { fz_draw_state *state = &dev->stack[--dev->top]; - fz_warn(ctx, "items left on stack in draw device: %d", dev->top); + fz_warn(ctx, "items left on stack in draw device: %d", dev->top+1); do { |