[gs-cvs] gs/src

Leonardo leonardo at ghostscript.com
Wed Oct 12 10:59:58 PDT 2005


Update of /cvs/ghostscript/gs/src
In directory casper2:/tmp/cvs-serv11056/gs/src

Modified Files:
	gsdevice.c gspaint.c gxdevcli.h 
Log Message:
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.


Index: gsdevice.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gsdevice.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- gsdevice.c	19 Nov 2004 01:44:52 -0000	1.24
+++ gsdevice.c	12 Oct 2005 17:59:55 -0000	1.25
@@ -457,6 +457,13 @@
     }
 }
 
+/* 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)

Index: gspaint.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gspaint.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- gspaint.c	13 Mar 2004 18:28:52 -0000	1.9
+++ gspaint.c	12 Oct 2005 17:59:55 -0000	1.10
@@ -261,7 +261,11 @@
     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 @@
 	}
 	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;
 

Index: gxdevcli.h
===================================================================
RCS file: /cvs/ghostscript/gs/src/gxdevcli.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- gxdevcli.h	21 Jul 2005 18:19:50 -0000	1.40
+++ gxdevcli.h	12 Oct 2005 17:59:55 -0000	1.41
@@ -1544,6 +1544,8 @@
 /* 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);



More information about the gs-cvs mailing list