OSDN Git Service

Avoid crashes with Suspendon Lollipop (ColorFade)
authorPaulo Sergio Travaglia <pstglia@gmail.com>
Sun, 21 Jun 2015 08:11:13 +0000 (05:11 -0300)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 22 Dec 2015 04:13:53 +0000 (12:13 +0800)
ColorFade (which is called on Suspend during STATE_OFF)
uses some GLSL commands to make some effects ( fade current screen
to black and white before blacking it out completelly)

However, it produces a crash on mesa. To avoid this crash,
Fragment Shader code was commented out, keeping just
gl_FragColor to set a single black color

core/res/res/raw/color_fade_frag.frag

index a66a5a7..df3d704 100644 (file)
@@ -7,6 +7,7 @@ uniform float saturation;
 uniform float gamma;
 varying vec2 UV;
 
+/*
 vec3 rgb2hsl(vec3 rgb)
 {
     float e = 1.0e-7;
@@ -32,11 +33,14 @@ vec3 hsl2rgb(vec3 hsl)
     float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;
     return (rgb - vec3(0.5)) * c + hsl.z;
 }
+*/
 
 void main()
 {
+/*
     vec4 color = texture2D(texUnit, UV);
     vec3 hsl = rgb2hsl(color.xyz);
     vec3 rgb = pow(hsl2rgb(vec3(hsl.x, hsl.y * saturation, hsl.z * opacity)), vec3(gamma));
-    gl_FragColor = vec4(rgb, 1.0);
+*/
+    gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
 }