From 79edec2f5800d97e05efac0cc6f61803854b53d8 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 24 Jan 2012 16:36:38 +0000 Subject: 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. --- draw/draw_device.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'draw') 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 { -- cgit v1.2.3