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

leonardo at ghostscript.com leonardo at ghostscript.com
Fri Aug 31 10:22:22 PDT 2007


Author: leonardo
Date: 2007-08-31 10:22:21 -0700 (Fri, 31 Aug 2007)
New Revision: 8224

Modified:
   trunk/gs/src/gdevbbox.c
   trunk/gs/src/gdevdbit.c
   trunk/gs/src/gxccache.c
   trunk/gs/src/gxclip.c
   trunk/gs/src/gxclrast.c
   trunk/gs/src/gxcpath.h
   trunk/gs/src/gxfill.c
   trunk/gs/src/gximask.c
   trunk/gs/src/gxipixel.c
   trunk/gs/src/gxstroke.c
Log:
Fix (graphics library) : Expand gx_make_clip_path_device, gx_make_clip_device.

DETAILS :

This is a preparation for fixing the bug 689365 
"Clipper device may have a wrong HWResolution".

This change is algorithmically equivalent.

The old code defines a function gx_make_clip_path_device,
and a macro gx_make_clip_device similar as a small wrappers for 
gx_make_clip_translate_device. This patch expands
and removes them as FOR a standardization.

The 'list' argument of gx_make_clip_translate_device is replaced with
'pcpath' argument, because the old code always extract the list
from pcpath. The extraction is now done inside gx_make_clip_translate_device.

EXPECTED DIFFERENCES :

None.


Modified: trunk/gs/src/gdevbbox.c
===================================================================
--- trunk/gs/src/gdevbbox.c	2007-08-31 15:31:06 UTC (rev 8223)
+++ trunk/gs/src/gdevbbox.c	2007-08-31 17:22:21 UTC (rev 8224)
@@ -1076,7 +1076,7 @@
 	fixed x0 = float2fixed(corners[0].x), y0 = float2fixed(corners[0].y);
 	fixed bx2 = float2fixed(corners[2].x) - x0, by2 = float2fixed(corners[2].y) - y0;
 
-	gx_make_clip_path_device(&cdev, pcpath);
+	gx_make_clip_translate_device(&cdev, pcpath, 0, 0, NULL);
 	cdev.target = dev;
 	(*dev_proc(&cdev, open_device)) ((gx_device *) & cdev);
 	set_nonclient_dev_color(&devc, bdev->black);  /* any non-white color will do */

Modified: trunk/gs/src/gdevdbit.c
===================================================================
--- trunk/gs/src/gdevdbit.c	2007-08-31 15:31:06 UTC (rev 8223)
+++ trunk/gs/src/gdevdbit.c	2007-08-31 17:22:21 UTC (rev 8224)
@@ -319,7 +319,7 @@
     gx_device_clip cdev;
 
     if (pcpath != 0) {
-	gx_make_clip_path_device(&cdev, pcpath);
+	gx_make_clip_translate_device(&cdev, pcpath, 0, 0, NULL);
 	cdev.target = orig_dev;
 	dev = (gx_device *) & cdev;
 	(*dev_proc(dev, open_device)) (dev);

Modified: trunk/gs/src/gxccache.c
===================================================================
--- trunk/gs/src/gxccache.c	2007-08-31 15:31:06 UTC (rev 8223)
+++ trunk/gs/src/gxccache.c	2007-08-31 17:22:21 UTC (rev 8224)
@@ -315,7 +315,7 @@
 	code = gx_effective_clip_path(pgs, &pcpath);
 	if (code < 0)
 	    return code;
-	gx_make_clip_device(&cdev, gx_cpath_list(pcpath));
+	gx_make_clip_translate_device(&cdev, pcpath, 0, 0, NULL);
 	cdev.target = imaging_dev;
 	imaging_dev = (gx_device *) & cdev;
 	(*dev_proc(imaging_dev, open_device)) (imaging_dev);

Modified: trunk/gs/src/gxclip.c
===================================================================
--- trunk/gs/src/gxclip.c	2007-08-31 15:31:06 UTC (rev 8223)
+++ trunk/gs/src/gxclip.c	2007-08-31 17:22:21 UTC (rev 8224)
@@ -108,21 +108,15 @@
 
 /* Make a clipping device. */
 void
-gx_make_clip_translate_device(gx_device_clip * dev, const gx_clip_list * list,
+gx_make_clip_translate_device(gx_device_clip * dev, const gx_clip_path *pcpath,
 			      int tx, int ty, gs_memory_t *mem)
 {
     gx_device_init((gx_device *)dev, (const gx_device *)&gs_clip_device,
 		   mem, true);
-    dev->list = *list;
+    dev->list = *gx_cpath_list(pcpath);
     dev->translation.x = tx;
     dev->translation.y = ty;
 }
-void
-gx_make_clip_path_device(gx_device_clip * dev, const gx_clip_path * pcpath)
-{
-    gx_make_clip_device(dev, gx_cpath_list(pcpath));
-}
-
 /* Define debugging statistics for the clipping loops. */
 #ifdef DEBUG
 struct stats_clip_s {

Modified: trunk/gs/src/gxclrast.c
===================================================================
--- trunk/gs/src/gxclrast.c	2007-08-31 15:31:06 UTC (rev 8223)
+++ trunk/gs/src/gxclrast.c	2007-08-31 17:22:21 UTC (rev 8224)
@@ -1423,7 +1423,7 @@
 				gx_device *ttdev = tdev;
 
 				if (pcpath != NULL && !clipper_dev_open) {
-				    gx_make_clip_device(&clipper_dev, gx_cpath_list(pcpath)); /* fixme : create a global instance */
+				    gx_make_clip_translate_device(&clipper_dev, pcpath, 0, 0, NULL);
 				    clipper_dev.target = tdev;
 				    (*dev_proc(&clipper_dev, open_device))((gx_device *)&clipper_dev);
 				    clipper_dev_open = true;

Modified: trunk/gs/src/gxcpath.h
===================================================================
--- trunk/gs/src/gxcpath.h	2007-08-31 15:31:06 UTC (rev 8223)
+++ trunk/gs/src/gxcpath.h	2007-08-31 17:22:21 UTC (rev 8224)
@@ -108,14 +108,9 @@
   gs_public_st_composite_use_final(st_device_clip, gx_device_clip,\
     "gx_device_clip", device_clip_enum_ptrs, device_clip_reloc_ptrs,\
     gx_device_finalize)
-void gx_make_clip_translate_device(gx_device_clip * dev,
-				   const gx_clip_list * list,
-				   int tx, int ty, gs_memory_t *mem);
+void gx_make_clip_translate_device(gx_device_clip * dev, const gx_clip_path *pcpath,
+			      int tx, int ty, gs_memory_t *mem);
 
-#define gx_make_clip_device(dev, list)\
-  gx_make_clip_translate_device(dev, list, 0, 0, NULL)
-void gx_make_clip_path_device(gx_device_clip *, const gx_clip_path *);
-
 #define clip_rect_print(ch, str, ar)\
   if_debug7(ch, "[%c]%s 0x%lx: (%d,%d),(%d,%d)\n", ch, str, (ulong)ar,\
 	    (ar)->xmin, (ar)->ymin, (ar)->xmax, (ar)->ymax)

Modified: trunk/gs/src/gxfill.c
===================================================================
--- trunk/gs/src/gxfill.c	2007-08-31 15:31:06 UTC (rev 8223)
+++ trunk/gs/src/gxfill.c	2007-08-31 17:22:21 UTC (rev 8224)
@@ -383,7 +383,7 @@
 	 */
 	if (pcpath) {
 	    dev = (gx_device *) & cdev;
-	    gx_make_clip_device(&cdev, gx_cpath_list(pcpath));
+	    gx_make_clip_translate_device(&cdev, pcpath, 0, 0, NULL);
 	    cdev.target = save_dev;
 	    cdev.max_fill_band = save_dev->max_fill_band;
 	    (*dev_proc(dev, open_device)) (dev);
@@ -644,7 +644,7 @@
 		code = (*dev_proc(pdev, fill_path))(pdev, pis, ppath, params, NULL, pcpath1);
 		dev = pdev;
 	    } else {
-		gx_make_clip_path_device(&cdev, pcpath1);
+		gx_make_clip_translate_device(&cdev, pcpath1, 0, 0, NULL);
 		cdev.HWResolution[0] = pdev->HWResolution[0];
 		cdev.HWResolution[1] = pdev->HWResolution[1];
 		cdev.target = pdev;

Modified: trunk/gs/src/gximask.c
===================================================================
--- trunk/gs/src/gximask.c	2007-08-31 15:31:06 UTC (rev 8223)
+++ trunk/gs/src/gximask.c	2007-08-31 17:22:21 UTC (rev 8224)
@@ -70,7 +70,7 @@
     if (code >= 0)
 	code = gx_dc_pattern2_clip_with_bbox(pdevc, tdev, &cpath_with_shading_bbox, &pcpath1);
     if (code >= 0) {
-	gx_make_clip_path_device(&cdev, pcpath1);
+	gx_make_clip_translate_device(&cdev, pcpath1, 0, 0, NULL);
 	cdev.target = tdev;
 	(*dev_proc(&cdev, open_device)) ((gx_device *) & cdev);
 	code1 = gx_device_color_fill_rectangle(pdevc, 

Modified: trunk/gs/src/gxipixel.c
===================================================================
--- trunk/gs/src/gxipixel.c	2007-08-31 15:31:06 UTC (rev 8223)
+++ trunk/gs/src/gxipixel.c	2007-08-31 17:22:21 UTC (rev 8224)
@@ -589,7 +589,7 @@
 				 false);
 	    return_error(gs_error_VMerror);
 	}
-	gx_make_clip_translate_device(cdev, gx_cpath_list(pcpath), 0, 0, mem);
+	gx_make_clip_translate_device(cdev, pcpath, 0, 0, mem);
 	gx_device_retain((gx_device *)cdev, true); /* will free explicitly */
 	gx_device_set_target((gx_device_forward *)cdev, dev);
 	(*dev_proc(cdev, open_device)) ((gx_device *) cdev);

Modified: trunk/gs/src/gxstroke.c
===================================================================
--- trunk/gs/src/gxstroke.c	2007-08-31 15:31:06 UTC (rev 8223)
+++ trunk/gs/src/gxstroke.c	2007-08-31 17:22:21 UTC (rev 8224)
@@ -437,7 +437,7 @@
 	 * If there is a clipping path, set up a clipping device.
 	 */
 	if (pcpath) {
-	    gx_make_clip_device(&cdev, gx_cpath_list(pcpath));
+	    gx_make_clip_translate_device(&cdev, pcpath, 0, 0, NULL);
 	    cdev.target = dev;
 	    cdev.max_fill_band = dev->max_fill_band;
 	    dev = (gx_device *) & cdev;



More information about the gs-cvs mailing list