From 81846bad1a5de1920f74ffe7c58d1207aa998e47 Mon Sep 17 00:00:00 2001 From: Shan Huang Date: Tue, 7 Sep 2021 19:07:47 +0000 Subject: Fixes boot animation not appearing issue on Oriole. Test: Flash the updated animation to device. Reboot and check if the animation shows up. Bug:199179989 Fixes:199179989 Change-Id: Ic2a2496efcaca4b6ae90c167498b8cd794b46bea --- cmds/bootanimation/BootAnimation.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cmds/bootanimation/BootAnimation.cpp') diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index 7ed0bed43833..c074029ab553 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -127,7 +127,7 @@ static const char VERTEX_SHADER_SOURCE[] = R"( })"; static const char IMAGE_FRAG_DYNAMIC_COLORING_SHADER_SOURCE[] = R"( precision mediump float; - const float cWhiteMaskThreshold = 0.05f; + const float cWhiteMaskThreshold = 0.05; uniform sampler2D uTexture; uniform float uFade; uniform float uColorProgress; @@ -155,7 +155,7 @@ static const char IMAGE_FRAG_DYNAMIC_COLORING_SHADER_SOURCE[] = R"( + g * mix(uStartColor1, uEndColor1, uColorProgress) + b * mix(uStartColor2, uEndColor2, uColorProgress) + a * mix(uStartColor3, uEndColor3, uColorProgress); - color = mix(color, vec4(vec3((r + g + b + a) * 0.25f), 1.0), useWhiteMask); + color = mix(color, vec4(vec3((r + g + b + a) * 0.25), 1.0), useWhiteMask); gl_FragColor = vec4(color.x, color.y, color.z, (1.0 - uFade)) * color.a; })"; static const char IMAGE_FRAG_SHADER_SOURCE[] = R"( @@ -699,6 +699,11 @@ GLuint compileShader(GLenum shaderType, const GLchar *source) { glGetShaderiv(shader, GL_COMPILE_STATUS, &isCompiled); if (isCompiled == GL_FALSE) { SLOGE("Compile shader failed. Shader type: %d", shaderType); + GLint maxLength = 0; + glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &maxLength); + std::vector errorLog(maxLength); + glGetShaderInfoLog(shader, maxLength, &maxLength, &errorLog[0]); + SLOGE("Shader compilation error: %s", &errorLog[0]); return 0; } return shader; -- cgit v1.2.3-59-g8ed1b