[cairo-commit] src/cairo-gl-gradient.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Jul 26 10:32:28 PDT 2012


 src/cairo-gl-gradient.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 1e9abd6e4e5d857c5e7a117d4e960b222a5f5578
Author: Henry Song <henry.song at samsung.com>
Date:   Thu Jul 26 18:31:20 2012 +0100

    gl: use absolute value for color difference between gradient stops

diff --git a/src/cairo-gl-gradient.c b/src/cairo-gl-gradient.c
index ffb5468..76920da 100644
--- a/src/cairo-gl-gradient.c
+++ b/src/cairo-gl-gradient.c
@@ -61,17 +61,17 @@ _cairo_gl_gradient_sample_width (unsigned int                 n_stops,
 	if (dx == 0)
 	    continue;
 
-	max = stops[n].color.red - stops[n-1].color.red;
+	max = fabs (stops[n].color.red - stops[n-1].color.red);
 
-	delta = stops[n].color.green - stops[n-1].color.green;
+	delta = fabs (stops[n].color.green - stops[n-1].color.green);
 	if (delta > max)
 	    max = delta;
 
-	delta = stops[n].color.blue - stops[n-1].color.blue;
+	delta = fabs (stops[n].color.blue - stops[n-1].color.blue);
 	if (delta > max)
 	    max = delta;
 
-	delta = stops[n].color.alpha - stops[n-1].color.alpha;
+	delta = fabs (stops[n].color.alpha - stops[n-1].color.alpha);
 	if (delta > max)
 	    max = delta;
 


More information about the cairo-commit mailing list