[cairo-commit] cairo/src cairo-glitz-surface.c,1.70,1.71

David Reveman commit at pdx.freedesktop.org
Thu Jan 5 05:14:17 PST 2006


Committed by: davidr

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv32135/src

Modified Files:
	cairo-glitz-surface.c 
Log Message:
Update gradient code in glitz backend

Index: cairo-glitz-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-glitz-surface.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- cairo-glitz-surface.c	3 Jan 2006 17:23:48 -0000	1.70
+++ cairo-glitz-surface.c	5 Jan 2006 13:14:14 -0000	1.71
@@ -624,12 +624,12 @@
 	for (i = 0; i < gradient->n_stops; i++)
 	{
 	    pixels[i] =
-		(((int) (gradient->stops[i].color.alpha * 0xff)) << 24) |
-		(((int) (gradient->stops[i].color.red   * 0xff)) << 16) |
-		(((int) (gradient->stops[i].color.green * 0xff)) << 8)  |
-		(((int) (gradient->stops[i].color.blue  * 0xff)));
+		(((int) (gradient->stops[i].color.alpha >> 8)) << 24) |
+		(((int) (gradient->stops[i].color.red   >> 8)) << 16) |
+		(((int) (gradient->stops[i].color.green >> 8)) << 8)  |
+		(((int) (gradient->stops[i].color.blue  >> 8)));
 
-	    params[n_base_params + 3 * i + 0] = gradient->stops[i].offset;
+	    params[n_base_params + 3 * i + 0] = gradient->stops[i].x;
 	    params[n_base_params + 3 * i + 1] = i << 16;
 	    params[n_base_params + 3 * i + 2] = 0;
 	}
@@ -643,22 +643,22 @@
 	{
 	    cairo_linear_pattern_t *grad = (cairo_linear_pattern_t *) pattern;
 
-	    params[0] = _cairo_fixed_from_double (grad->point0.x);
-	    params[1] = _cairo_fixed_from_double (grad->point0.y);
-	    params[2] = _cairo_fixed_from_double (grad->point1.x);
-	    params[3] = _cairo_fixed_from_double (grad->point1.y);
+	    params[0] = grad->gradient.p1.x;
+	    params[1] = grad->gradient.p1.y;
+	    params[2] = grad->gradient.p2.x;
+	    params[3] = grad->gradient.p2.y;
 	    attr->filter = GLITZ_FILTER_LINEAR_GRADIENT;
 	}
 	else
 	{
 	    cairo_radial_pattern_t *grad = (cairo_radial_pattern_t *) pattern;
 
-	    params[0] = _cairo_fixed_from_double (grad->center0.x);
-	    params[1] = _cairo_fixed_from_double (grad->center0.y);
-	    params[2] = _cairo_fixed_from_double (grad->radius0);
-	    params[3] = _cairo_fixed_from_double (grad->center1.x);
-	    params[4] = _cairo_fixed_from_double (grad->center1.y);
-	    params[5] = _cairo_fixed_from_double (grad->radius1);
+	    params[0] = grad->gradient.inner.x;
+	    params[1] = grad->gradient.inner.y;
+	    params[2] = grad->gradient.inner.radius;
+	    params[3] = grad->gradient.outer.x;
+	    params[4] = grad->gradient.outer.y;
+	    params[5] = grad->gradient.outer.radius;
 	    attr->filter = GLITZ_FILTER_RADIAL_GRADIENT;
 	}
 



More information about the cairo-commit mailing list