Surface flinger boot flow in Android system

Source: Internet
Author: User

Surface flinger Boot


Flow


In Android


System
  • A executableSurfaceflinger


    In Framework/base/cmds/surfaceflinger

Main ()->
Surfaceflinger: instantiate ();->
Defaservicservicemanager () → 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:

Required itengine = NULL;
If (hw_get_module (copybit_hardware_module_id, & module) = 0)
{Copybit_open (module, & inititengine );}
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 CILS
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
    Underlying Surface object, an object that gets placed on
    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) CILS. 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.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.