[cairo-commit] src/cairo-glitz-surface.c

Jinghua Luo jinghua at kemper.freedesktop.org
Tue Nov 25 07:00:28 PST 2008


 src/cairo-glitz-surface.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 449e7518bee5d0238138176b3b71d137c6fc01e7
Author: Luo Jinghua <sunmoon1997 at gmail.com>
Date:   Tue Nov 25 22:55:24 2008 +0800

    glitz: set correct parameters for linear and radial pattern.
    
    Glitz expects 16.16 fixed point, but we use 24.8 fixed point by default.

diff --git a/src/cairo-glitz-surface.c b/src/cairo-glitz-surface.c
index b08fc52..146bcb0 100644
--- a/src/cairo-glitz-surface.c
+++ b/src/cairo-glitz-surface.c
@@ -779,22 +779,22 @@ _cairo_glitz_pattern_acquire_surface (const cairo_pattern_t	       *pattern,
 	{
 	    cairo_linear_pattern_t *grad = (cairo_linear_pattern_t *) pattern;
 
-	    params[0] = grad->p1.x;
-	    params[1] = grad->p1.y;
-	    params[2] = grad->p2.x;
-	    params[3] = grad->p2.y;
+	    params[0] = _cairo_fixed_to_16_16 (grad->p1.x);
+	    params[1] = _cairo_fixed_to_16_16 (grad->p1.y);
+	    params[2] = _cairo_fixed_to_16_16 (grad->p2.x);
+	    params[3] = _cairo_fixed_to_16_16 (grad->p2.y);
 	    attr->filter = GLITZ_FILTER_LINEAR_GRADIENT;
 	}
 	else
 	{
 	    cairo_radial_pattern_t *grad = (cairo_radial_pattern_t *) pattern;
 
-	    params[0] = grad->c1.x;
-	    params[1] = grad->c1.y;
-	    params[2] = grad->r1;
-	    params[3] = grad->c2.x;
-	    params[4] = grad->c2.y;
-	    params[5] = grad->r2;
+	    params[0] = _cairo_fixed_to_16_16 (grad->c1.x);
+	    params[1] = _cairo_fixed_to_16_16 (grad->c1.y);
+	    params[2] = _cairo_fixed_to_16_16 (grad->r1);
+	    params[3] = _cairo_fixed_to_16_16 (grad->c2.x);
+	    params[4] = _cairo_fixed_to_16_16 (grad->c2.y);
+	    params[5] = _cairo_fixed_to_16_16 (grad->r2);
 	    attr->filter = GLITZ_FILTER_RADIAL_GRADIENT;
 	}
 


More information about the cairo-commit mailing list