The Android system provides a series of drawing rendering APIs that support 2D drawings and 3D drawings, so it's important to understand how these APIs work. The most common use for app developers is that canvas and Opengl,canvas focus on 2D, while OpenGL is all-rounder. The canvas's drawing operations are eventually converted through Openglrender, converted to OpenGL-supported actions, and rendered by the GPU, meaning that the canvas is also working through the OpenGL library.
Regardless of which API you use, these actions will eventually render to your surface. Surface represents the producer, responsible for the production of Bufferqueue, and it is opposite to the Surfaceflinger as a consumer.
The following diagram describes the workflow of the main parts.
Image Stream Producers images producer: Any component that generates graphics buffer, including but not limited to CANVAS,OPENGL, multimedia services, video decoders. Image stream Consumers images consumer: This image stream consumer generally refers to surfaceflinger system services, Surfaceflinger is responsible for organizing visual surface, and modifying display, Only Surfaceflinger can modify display. OpenGL ES apps such as camera programs, Carmera can also consume image streams. Window Manager is responsible for Window,window manager in the management system, implemented by surface support, and window manager launches metadata to Surfaceflinger. Hardware Composer is used to showcase the hardware abstraction layer of the subsystem, Surfaceflinger can help OpenGL and the GPU do the work of having a clear, combined data, so that the work of GPU and OpenGL can be reduced, which will save resources and power. Surfaceflinger work or use OpenGL ES, which is equivalent to the OpenGL ES client. Gralloc graphics memory allocator to draw the ram generator
Android Interface Display Process analysis