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.
This commit is contained in:
Keith Packard 2005-05-16 22:31:36 +00:00
parent e5b31bca7c
commit 200bcda188
2 changed files with 18 additions and 0 deletions

View file

@ -1,3 +1,14 @@
2005-05-16 Keith Packard <keithp@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.
2005-05-16 Carl Worth <cworth@cworth.org>
* test/.cvsignore:

View file

@ -512,6 +512,13 @@ _cairo_pattern_shader_init (cairo_gradient_pattern_t *pattern,
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;