kernel logo到开机动画之间闪现黑屏

来源:互联网 发布:ubuntu安装apache2.4 编辑:程序博客网 时间:2024/05/17 22:43

1. 这个现象是因为,在BootAnimation开始绘图之前,会先做一次clear screen的动作,避免出现前面的图干扰到BootAnimation的显示。这是Google default design,虽然不可避免,但是可以优化。
 
优化方法:
通过check main_log先确认播放开机动画是哪个function,在对应function删除clear screen的动作的对应代码。
/frameworks/base/cmds/bootanimation/BootAnimation.cpp

bool BootAnimation::android(){ initTexture(&mAndroid[0], mAssets, "images/android-logo-mask.png"); initTexture(&mAndroid[1], mAssets, "images/android-logo-shine.png");/*----------------------------删除clear screen对应code-------------------------*/// clear screen glShadeModel(GL_FLAT); glDisable(GL_DITHER); glDisable(GL_SCISSOR_TEST); glClearColor(0,0,0,1); glClear(GL_COLOR_BUFFER_BIT); eglSwapBuffers(mDisplay, mSurface);/*----------------------------删除clear screen对应code-------------------------*/ glEnable(GL_TEXTURE_2D); glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
bool BootAnimation::movie()/*----------------------------删除clear screen对应code-------------------------*/ // clear screen glShadeModel(GL_FLAT); glDisable(GL_DITHER); glDisable(GL_SCISSOR_TEST); glDisable(GL_BLEND); glClearColor(0,0,0,1); glClear(GL_COLOR_BUFFER_BIT); eglSwapBuffers(mDisplay, mSurface);/*----------------------------删除clear screen对应code-------------------------*/
bool BootAnimation::MTKmovie()/*----------------------------删除clear screen对应code-------------------------*/ // clear screen glDisable(GL_DITHER); glDisable(GL_SCISSOR_TEST); glDisable(GL_BLEND); glClear(GL_COLOR_BUFFER_BIT); eglSwapBuffers(mDisplay, mSurface);/*----------------------------删除clear screen对应code-------------------------*/


0 0
原创粉丝点击