st-scroll-view-fade: Don't use return in the shader

Returing from main() makes llvmpipe unhappy (produces black output color),
so rework the logic to avoid the return.

https://bugzilla.gnome.org/show_bug.cgi?id=695607
This commit is contained in:
Adel Gadllah 2013-03-14 17:55:08 +01:00
parent dc54472ca5
commit 45fc7ec01f

View File

@ -50,10 +50,12 @@ void main ()
float y = height * cogl_tex_coord_in[0].y;
float x = width * cogl_tex_coord_in[0].x;
if (x < fade_area[0][0] || x > fade_area[1][0] ||
y < fade_area[0][1] || y > fade_area[1][1])
return;
/*
* We cannot just return here due to a bug in llvmpipe see:
* https://bugzilla.freedesktop.org/show_bug.cgi?id=62357
*/
if (x > fade_area[0][0] && x < fade_area[1][0] &&
y > fade_area[0][1] && y < fade_area[1][1]) {
float ratio = 1.0;
float fade_bottom_start = fade_area[1][1] - vfade_offset;
float fade_right_start = fade_area[1][0] - hfade_offset;
@ -81,4 +83,5 @@ void main ()
}
cogl_color_out *= ratio;
}
}