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

leonardo at ghostscript.com leonardo at ghostscript.com
Mon Jul 16 10:06:59 PDT 2007


Author: leonardo
Date: 2007-07-16 10:06:58 -0700 (Mon, 16 Jul 2007)
New Revision: 8129

Modified:
   trunk/gs/src/gxshade4.h
   trunk/gs/src/gxshade6.c
Log:
Banding : Extend clist language with trapezoids, linear color trapezoids and linear color triangles (continued 5).

DETAILS :

This change is algorithmically equivalent.
It provides methods for decomposition of triangles written to clist.
The purpose is to fix possible gs_error_unregistered in gxclrast.c ln 1498.
The fix itself will be done separately.
  
EXPECTED DIFFERENCES :

None.


Modified: trunk/gs/src/gxshade4.h
===================================================================
--- trunk/gs/src/gxshade4.h	2007-07-16 16:58:11 UTC (rev 8128)
+++ trunk/gs/src/gxshade4.h	2007-07-16 17:06:58 UTC (rev 8129)
@@ -177,6 +177,9 @@
 int mesh_triangle(patch_fill_state_t *pfs, 
     const shading_vertex_t *p0, const shading_vertex_t *p1, const shading_vertex_t *p2);
 
+int small_mesh_triangle(patch_fill_state_t *pfs, 
+	const shading_vertex_t *p0, const shading_vertex_t *p1, const shading_vertex_t *p2);
+
 int mesh_padding(patch_fill_state_t *pfs, const gs_fixed_point *p0, const gs_fixed_point *p1, 
 	    const patch_color_t *c0, const patch_color_t *c1);
 

Modified: trunk/gs/src/gxshade6.c
===================================================================
--- trunk/gs/src/gxshade6.c	2007-07-16 16:58:11 UTC (rev 8128)
+++ trunk/gs/src/gxshade6.c	2007-07-16 17:06:58 UTC (rev 8129)
@@ -928,23 +928,37 @@
 	gs_client_color fcc;
 	const gs_color_space *pcs = pfs->direct_space;
 
-	if (pdevc == NULL)
-	    pdevc = &devc;
-	memcpy(fcc.paint.values, c->cc.paint.values, 
-		    sizeof(fcc.paint.values[0]) * pfs->num_components);
-	code = pcs->type->remap_color(&fcc, pcs, pdevc, pfs->pis,
-				  pfs->dev, gs_color_select_texture);
-	if (code < 0)
-	    return code;
-	if (frac_values != NULL) {
-	    dc2fc(pfs, pdevc->colors.pure, frac_values);
-	    if (pdevc->type != &gx_dc_type_data_pure)
-		return 2;
+	if (pcs != NULL) {
+
+	    if (pdevc == NULL)
+		pdevc = &devc;
+	    memcpy(fcc.paint.values, c->cc.paint.values, 
+			sizeof(fcc.paint.values[0]) * pfs->num_components);
+	    code = pcs->type->remap_color(&fcc, pcs, pdevc, pfs->pis,
+				      pfs->dev, gs_color_select_texture);
+	    if (code < 0)
+		return code;
+	    if (frac_values != NULL) {
+		dc2fc(pfs, pdevc->colors.pure, frac_values);
+		if (pdevc->type != &gx_dc_type_data_pure)
+		    return 2;
+	    }
+#	    if DEBUG_COLOR_INDEX_CACHE
+	    if (cindex != pdevc->colors.pure)
+		return_error(gs_error_unregistered);
+#	    endif
+	} else {
+	    /* This is reserved for future extension,
+	    when a linear color triangle with frac31 colors is being decomposed
+	    during a clist rasterization. In this case frac31 colors are written into 
+	    the patch color, and pcs==NULL means an identity color mapping. 
+	    For a while we assume here pfs->pcic is also NULL. */
+	    int j;
+	    const gx_device_color_info *cinfo = &pfs->dev->color_info;
+
+	    for (j = 0; j < cinfo->num_components; j++)
+		frac_values[j] = (frac31)c->cc.paint.values[j];
 	}
-#	if DEBUG_COLOR_INDEX_CACHE
-	if (cindex != pdevc->colors.pure)
-	    return_error(gs_error_unregistered);
-#	endif
     }
     return 0;
 }
@@ -2589,7 +2603,7 @@
     return triangle_by_4(pfs, p0, p1, p2, l01, l12, l20, cd, sd);
 }
 
-private int 
+int 
 small_mesh_triangle(patch_fill_state_t *pfs, 
 	const shading_vertex_t *p0, const shading_vertex_t *p1, const shading_vertex_t *p2)
 {



More information about the gs-cvs mailing list