[gs-cvs] rev 8378 - trunk/gs/src

leonardo at ghostscript.com leonardo at ghostscript.com
Sun Nov 18 08:48:41 PST 2007


Author: leonardo
Date: 2007-11-18 08:48:41 -0800 (Sun, 18 Nov 2007)
New Revision: 8378

Modified:
   trunk/gs/src/gxclrast.c
Log:
Fix (clist interpreter) : Transparency caused a wrong color depth.

DETAILS :

Bug 689520 Regression: 1bpp and grayscale output broken.

The clist interpreter clist_playback_band maintains 2 devices :
the clist reader and target. The clist reader device stores
private interpreter's data. However using a device structure
for this purpose is pretty confusing, because the target 
device may have same device fields with different values.
Particularly while processing a transparency, the target device
chage to a transparency buffer device, 
which may have a different number of color components.

The problem happens due to the clist interpreter used
a wrong device to obtain the number of color components.
This patch changes the code with taking color components 
from the target device. 

Now we don't try to analyze all other access to the clist device -
it should be a subject of a separate job. 
Therefore the code may need further improvements.
The right way would be to define a special structure for the clist interpreter, 
and to drop the clist reader device at all.

EXPECTED DIFFERENCES :

None (comparefiles don't include a test for it; to be added after closing the bug).


Modified: trunk/gs/src/gxclrast.c
===================================================================
--- trunk/gs/src/gxclrast.c	2007-11-18 09:30:55 UTC (rev 8377)
+++ trunk/gs/src/gxclrast.c	2007-11-18 16:48:41 UTC (rev 8378)
@@ -593,7 +593,7 @@
 			    gx_color_index delta = 0;
 			    uint data;
 
-			    dev_depth = cdev->color_info.depth;
+			    dev_depth = tdev->color_info.depth;
 			    dev_depth_bytes = (dev_depth + 7) >> 3;
 		            switch (dev_depth_bytes) {
 				/* For cases with an even number of bytes */
@@ -672,7 +672,7 @@
 		else {
 		    gx_color_index color = 0;
 
-		    dev_depth = cdev->color_info.depth;
+		    dev_depth = tdev->color_info.depth;
 		    dev_depth_bytes = (dev_depth + 7) >> 3;
 		    switch (dev_depth_bytes - num_zero_bytes) {
 			case 8:
@@ -740,7 +740,7 @@
 		    if (!(op & 8))
 			depth = *cbp++;
 		} else 
-		    depth = cdev->color_info.depth;
+		    depth = tdev->color_info.depth;
 	      copy:cmd_getw(state.rect.x, cbp);
 		cmd_getw(state.rect.y, cbp);
 		if (op & 8) {	/* Use the current "tile". */



More information about the gs-cvs mailing list