在BootAnimation开始绘图之前,会先做一次clear screen的动作,避免出现前面的图干扰到BootAnimation的显示。
通过check main_log先确认播放开机动画是哪个function,在对应function删除clear screen的动作的对应代码。
/frameworks/base/cmds/bootanimation/BootAnimation.cpp标签:kernel,code,glDisable,screen,logo,GL,clear,黑屏,BootAnimation From: https://blog.51cto.com/u_15170706/6114545
450bool BootAnimation::android()
451{
452 initTexture(&mAndroid[0], mAssets, "images/android-logo-mask.png");
453 initTexture(&mAndroid[1], mAssets, "images/android-logo-shine.png");
454
/*-删除clear screen对应code-*/
455 // clear screen
456 glShadeModel(GL_FLAT);
457 glDisable(GL_DITHER);
458 glDisable(GL_SCISSOR_TEST);
459 glClearColor(0,0,0,1);
460 glClear(GL_COLOR_BUFFER_BIT);
461 eglSwapBuffers(mDisplay, mSurface);
/*-删除clear screen对应code-*/
462
463 glEnable(GL_TEXTURE_2D);
464 glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
465
......
594bool BootAnimation::movie()
......
/*-删除clear screen对应code-*/
700 // clear screen
701 glShadeModel(GL_FLAT);
702 glDisable(GL_DITHER);
703 glDisable(GL_SCISSOR_TEST);
704 glDisable(GL_BLEND);
705 glClearColor(0,0,0,1);
706 glClear(GL_COLOR_BUFFER_BIT);
707
708 eglSwapBuffers(mDisplay, mSurface);
/*-删除clear screen对应code-*/
709
......
1128bool BootAnimation::MTKmovie()
......
/*-删除clear screen对应code-*/
1222 // clear screen
1223 glDisable(GL_DITHER);
1224 glDisable(GL_SCISSOR_TEST);
1225 glDisable(GL_BLEND);
1226 glClear(GL_COLOR_BUFFER_BIT);
1227
1228 eglSwapBuffers(mDisplay, mSurface);
/*-删除clear screen对应code-*/
1229