[cairo-commit] cairo/src cairo-pattern.c,1.37,1.38

Keith Packard commit at pdx.freedesktop.org
Mon May 16 22:31:39 PDT 2005


Committed by: keithp

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

Modified Files:
	cairo-pattern.c 
Log Message:
2005-05-16  Keith Packard  <keithp at keithp.com>

	* src/cairo-pattern.c: (_cairo_pattern_shader_init):
	Initialize op->stops[0].scale = 0.  
	
	This scale value is used only when computing gradient values
	before the defined range, in which case stop 0 is used for both
	ends of the interpolation, making the value of 'scale' not
	actually matter, except that valgrind notices we're using
	an undefined value.


Index: cairo-pattern.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pattern.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- cairo-pattern.c	9 May 2005 16:12:52 -0000	1.37
+++ cairo-pattern.c	17 May 2005 05:31:36 -0000	1.38
@@ -512,6 +512,13 @@
     qsort (op->stops, pattern->n_stops, sizeof (cairo_shader_color_stop_t),
 	   _cairo_shader_color_stop_compare);
 
+    /* this scale value is used only when computing gradient values
+     * before the defined range, in which case stop 0 is used for both
+     * ends of the interpolation, making the value of 'scale' not
+     * actually matter, except that valgrind notices we're using
+     * an undefined value.
+     */
+    op->stops[0].scale = 0;
     for (i = 0; i < pattern->n_stops - 1; i++)
     {
 	op->stops[i + 1].scale = op->stops[i + 1].offset - op->stops[i].offset;




More information about the cairo-commit mailing list