summaryrefslogtreecommitdiff
path: root/gs/src/zshade.c
diff options
context:
space:
mode:
authorIgor Melichev <igor.melichev@artifex.com>2006-10-24 15:13:03 +0000
committerIgor Melichev <igor.melichev@artifex.com>2006-10-24 15:13:03 +0000
commit7d3054b1110c72e57ca8fb7abd167128a5ed0e55 (patch)
treedbbe3e62854f67f0d0d93a6d75014b7531df12f8 /gs/src/zshade.c
parent6bc7fb6cebc8479fc1ca5594eb8eca799d03ed82 (diff)
downloadghostpdl-7d3054b1110c72e57ca8fb7abd167128a5ed0e55.tar.gz
Fix (imagemask) : An optimization for imagemask with a shading color.
DETAILS : This is a partial performance fix for 09-47L.PS . It fixes the biggest performance flaw, but a further optimization is still wanted. The patch converts the image into a clipping path and then renders entire shading at once through the clipping path. The old code rendered entire shading color many times for each rectangle of the mask. 1. The clip list accumulator device is made publicly accessible. 2. Provided a garbager descriptor for clip list accumulator device structure. 3. When an imagemask needs to render with a shading color, gs_image_begin_typed replaces the target device with the clip list accumulator device. 4. To provide a correct work of (3), inserted a hook into gx_dc_pattern2_fill_rectangle, which forwards the operation back to the device method. It is done because normally that function calls copy_mono with imagemak. Instead that, we need to accumulate rectangles for the clipping path. 5. Introduced a new signal pattern_manage__is_cpath_accum, which is used to detect the clip path accumulator device under a forwarding device. Such case happens in (4) when it renders a cached character with a shading color. 6. gs_image_cleanup performs the main work for rendering the shading color through the clipping path. Note that we need to pass the device color to it, therefore it gets a new gs_state argument. (Well, one may think that it can be passed in a new field of gs_image_enum. Actually that's not safe because an erroneus Postscript program can change the current graphic state and release the old one. After that the pointer will point to the released structure and cause a heap inconsistency). EXPECTED DIFFERENCES : None. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@7120 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/zshade.c')
0 files changed, 0 insertions, 0 deletions