[cairo-commit] 2 commits - src/cairo-quartz-surface.c src/cairo-win32-font.c

Vladimir Vukicevic vladimir at kemper.freedesktop.org
Thu Nov 15 11:57:43 PST 2007


 src/cairo-quartz-surface.c |   24 ++++++++++++------------
 src/cairo-win32-font.c     |    1 -
 2 files changed, 12 insertions(+), 13 deletions(-)

New commits:
commit 39b8ddf07994747c039ee74c64a0cc97a4c7776a
Author: Vladimir Vukicevic <vladimir at pobox.com>
Date:   Thu Nov 15 11:57:40 2007 -0800

    [win32] Remove double-free in win32 font code in init_glyph_path
    
    Fixes bug #13243.

diff --git a/src/cairo-win32-font.c b/src/cairo-win32-font.c
index 992f675..358d61c 100644
--- a/src/cairo-win32-font.c
+++ b/src/cairo-win32-font.c
@@ -1497,7 +1497,6 @@ _cairo_win32_scaled_font_init_glyph_path (cairo_win32_scaled_font_t *scaled_font
 	if (status)
 	    goto CLEANUP_BUFFER;
     }
-    free(buffer);
 
     _cairo_scaled_glyph_set_path (scaled_glyph,
 				  &scaled_font->base,
commit 50d5f5a4e6d7424694b0b27fc0c3a00c9eb203bb
Author: Vladimir Vukicevic <vladimir at pobox.com>
Date:   Thu Nov 15 11:56:56 2007 -0800

    [quartz] Fix gradients; the wrong color field was being used
    
    The wrong color field was being used, effectively making gradients always
    have transparent black as their color stops.

diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index 9c3014c..37053a4 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -325,10 +325,10 @@ ComputeGradientValue (void *info, const float *in, float *out)
     if (i == 0 || i == grad->n_stops) {
 	if (i == grad->n_stops)
 	    --i;
-	out[0] = grad->stops[i].color.red / 65535.;
-	out[1] = grad->stops[i].color.green / 65535.;
-	out[2] = grad->stops[i].color.blue / 65535.;
-	out[3] = grad->stops[i].color.alpha / 65535.;
+	out[0] = grad->stops[i].color.red;
+	out[1] = grad->stops[i].color.green;
+	out[2] = grad->stops[i].color.blue;
+	out[3] = grad->stops[i].color.alpha;
     } else {
 	float ax = _cairo_fixed_to_double(grad->stops[i-1].x);
 	float bx = _cairo_fixed_to_double(grad->stops[i].x) - ax;
@@ -336,17 +336,17 @@ ComputeGradientValue (void *info, const float *in, float *out)
 	float ap = 1.0 - bp;
 
 	out[0] =
-	    (grad->stops[i-1].color.red / 65535.) * ap +
-	    (grad->stops[i].color.red / 65535.) * bp;
+	    grad->stops[i-1].color.red * ap +
+	    grad->stops[i].color.red * bp;
 	out[1] =
-	    (grad->stops[i-1].color.green / 65535.) * ap +
-	    (grad->stops[i].color.green / 65535.) * bp;
+	    grad->stops[i-1].color.green * ap +
+	    grad->stops[i].color.green * bp;
 	out[2] =
-	    (grad->stops[i-1].color.blue / 65535.) * ap +
-	    (grad->stops[i].color.blue / 65535.) * bp;
+	    grad->stops[i-1].color.blue * ap +
+	    grad->stops[i].color.blue * bp;
 	out[3] =
-	    (grad->stops[i-1].color.alpha / 65535.) * ap +
-	    (grad->stops[i].color.alpha / 65535.) * bp;
+	    grad->stops[i-1].color.alpha * ap +
+	    grad->stops[i].color.alpha * bp;
     }
 }
 


More information about the cairo-commit mailing list