Surface Flinger boot flow in Android system
  • a executable surfaceflinger in framework/base/cmds/surfaceflinger

                      main() –>
                      SurfaceFlinger::instantiate(); –>
                      defaultServiceManager()→addService(String16(“SurfaceFlinger”), new SurfaceFlinger());

  • a executable system_server framework/base/cmds/system_server

                       start system_server when system boot in init.rc
                       main() –> system_init(); –>
                       SurfaceFlinger::instantiate();

  • surface flinger flow:

                       surface flinger extend a threads (framework/base/libs/utils/threads.cpp ) –SurfaceFlinger.cpp
                       start SurfaceFlinger::readyToRun in Thread::_threadLoop(); –SurfaceFlinger.cpp
                       DisplayHardware* const hw = new DisplayHardware(this, dpy); –SurfaceFlinger.cpp
                       DisplayHardware::init() –DisplayHardware.cpp
                       EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY) (implement in ligagl.so or libhgl.so)
                       mDisplaySurface = new EGLDisplaySurface();
                       surface = eglCreateWindowSurface(display, config, mDisplaySurface.get(), NULL);
                      context = eglCreateContext(display, config, NULL, NULL); ( Create our OpenGL ES context in libagl.so or libhgl.so)
                      open copybit & overlay modules:

                      mBlitEngine = NULL;     
                      if (hw_get_module(COPYBIT_HARDWARE_MODULE_ID, &module) == 0)
                      {           copybit_open(module, &mBlitEngine);        }      
                      mOverlayEngine = NULL;     
                       if (hw_get_module(OVERLAY_HARDWARE_MODULE_ID, &module) == 0)
                       {           overlay_control_open(module, &mOverlayEngine);        }

  • agl / hgl exchange:

                     framework/base/opengl/libs/egl.cpp (libGLESv1_CM.so)
                     eglGetDisplay() in egl.cpp, dynamically load all our EGL implementations( agl/hgl ) for that display and call into the real eglGetGisplay()
                      provide base egl APIs wappers in egl.cpp and implementaton in libagl.so or libhgl.so

  • Surface Flinger SystemSurface flinger provides system-wide surface “composer”, handling all surface rendering to frame. buffer device

                       Can combine 2D and 3D surfaces and surfaces from multiple applications
                       Surfaces passed as buffers via Binder IPC calls
                       Can use OpenGL ES and 2D hardware accelerator for its compositions
                       Double-buffering using page-flip

  • Surface Flinger flowIn Android, every window gets implemented with an underlying Surface object, an object that gets placed on the framebuffer by SurfaceFlinger, the system-wide screen composer. Each Surface is double-buffered using page-flips. The back buffer is where drawing takes place and the front buffer is used for composition.
  • Surface flinger handling all surface rendering to frame. buffer device. It can combine 2d and 3d surfaces and surfaces from multiple applications. Surfaces are passed as buffers via binder interprocess (IPC) calls. It can use OpenGL ES and 2d hardware acceleration for its compositions. System integrators can plug in hardware acceleration using a plug-in standard from Khronos.

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. 聊聊如何从程序员晋升为管理者(我的肺腑之
  2. 「什么值得买」网站挂了,疑程序员删库跑路
  3. MySQL也要删“blacklist”,万万没想到技术
  4. JAVA程序一次句柄泄露问题分析
  5. 微信转账后被拉黑该如何追回?官方这些隐藏
  6. 一大波开发者福利!谷歌宣布在中国正式推出
  7. 那条被微博撤下的热搜#17万人脸数据遭公
  8. 工商银行 MySQL 数据库架构解密
  9. 值得收藏的免费P图工具:用Ai一键替换照片
  10. 破解助手、资源下载,2019年九月最新实用油