First understand the function call of the EGL of Android, get display (corresponding display), then select a supported config (which is supported by the graphics card), then create the Windowsurface, and create the context (context equivalent to OpenGL this state machine), and then you can call GL's drawing function to paint on surface, after the work is done, you need to release the Context, windowsurace these resources
The Android 3D graphics architecture is as follows
When the user uses Glsurfaceview, the EGL function is called, the Glsurfaceview dependent Windowsurace,context are created, and then the Java GL Call is converted to the native call to Libgl.so. Libgl.so will be called to the graphics driver
If no hardware is the GL function of software simulation, it is worth noting that Andoid has optimized the copybit.
Rendering
Previously Android was using Skia to generate 2D graphics, and later (4.1 Jellybean) to improve performance by using OpenGL instead (because it can be GPU), but the previous Skia soft architecture remains
Hardware acceleration is turned on when Use_opengl_render:=true is turned on at compile time (by default), which is the implementation of libhwui.so hardware acceleration
Create surface like 3D, create context, call GL function to draw ...
The above two architectures render surface (whether GPU-rendered or CPU-rendered), and Surfaceflinger calls OpenGL's function at the last screen. is also divided into GPU hardware on screen, or CPU simulation
Understanding Android 2d/3d Graphics Architecture