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 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 );}
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.