diff options
author | Igor Melichev <igor.melichev@artifex.com> | 2005-10-12 17:59:55 +0000 |
---|---|---|
committer | Igor Melichev <igor.melichev@artifex.com> | 2005-10-12 17:59:55 +0000 |
commit | dfaaa2bc48c71d38bf1db8c6763f8363056dcdb0 (patch) | |
tree | a66b758d46cee913bf750710945fd8cdcc60ffb6 | |
parent | b8f9e0ee20b53f5ba2d69228bdf9a60e3e353e52 (diff) | |
download | ghostpdl-dfaaa2bc48c71d38bf1db8c6763f8363056dcdb0.tar.gz |
Fix : Don't instantiate pattern when rendering to null device.
DETAILS :
Bug 688308 "Error: undefined; OffendingCommand: .type1execchar".
The test case executes cshow or kshow with intrevene changing
the current color space, causing a color load callout from fill_with_rule
_after_ the callout completes. After that the check
ctile->depth == dev->color_info.depth in gx_pattern_cache_lookup fails
(not sure why - probably due to gsave-grestore in the pattern procedure).
This patch skips entire character drawing when the device is null,
so that those cumbersome stuff isn't envolved.
EXPECTED DIFFERENCES :
None.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@6153 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r-- | gs/src/gsdevice.c | 7 | ||||
-rw-r--r-- | gs/src/gspaint.c | 10 | ||||
-rw-r--r-- | gs/src/gxdevcli.h | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/gs/src/gsdevice.c b/gs/src/gsdevice.c index e213c8667..2a67a0873 100644 --- a/gs/src/gsdevice.c +++ b/gs/src/gsdevice.c @@ -457,6 +457,13 @@ gs_make_null_device(gx_device_null *dev_null, gx_device *dev, } } +/* Is a null device ? */ +bool gs_is_null_device(gx_device *dev) +{ + /* Assuming null_fill_path isn't used elswhere. */ + return dev->procs.fill_path == gs_null_device.procs.fill_path; +} + /* Mark a device as retained or not retained. */ void gx_device_retain(gx_device *dev, bool retained) diff --git a/gs/src/gspaint.c b/gs/src/gspaint.c index 1bba1dab5..746dc45dc 100644 --- a/gs/src/gspaint.c +++ b/gs/src/gspaint.c @@ -261,7 +261,11 @@ fill_with_rule(gs_state * pgs, int rule) if (pgs->in_charpath) code = gx_path_add_char_path(pgs->show_gstate->path, pgs->path, pgs->in_charpath); - else { + else if (gs_is_null_device(pgs->device)) { + /* Handle separately to prevent gs_state_color_load - bug 688308. */ + gs_newpath(pgs); + code = 0; + } else { int abits, acode; gx_set_dev_color(pgs); @@ -321,6 +325,10 @@ gs_stroke(gs_state * pgs) } code = gx_path_add_char_path(pgs->show_gstate->path, pgs->path, pgs->in_charpath); + } else if (gs_is_null_device(pgs->device)) { + /* Handle separately to prevent gs_state_color_load. */ + gs_newpath(pgs); + code = 0; } else { int abits, acode; diff --git a/gs/src/gxdevcli.h b/gs/src/gxdevcli.h index 8f3ebd323..9989bd597 100644 --- a/gs/src/gxdevcli.h +++ b/gs/src/gxdevcli.h @@ -1544,6 +1544,8 @@ void gx_device_init(gx_device * dev, const gx_device * proto, /* or the allocator that was used to allocate it if it is a real object. */ void gs_make_null_device(gx_device_null *dev_null, gx_device *target, gs_memory_t *mem); +/* Is a null device ? */ +bool gs_is_null_device(gx_device *dev); /* Set the target of a (forwarding) device. */ void gx_device_set_target(gx_device_forward *fdev, gx_device *target); |