Android UI Internal : UI Composition with SurfaceFlinger
SurfaceFlinger is an Android system service, responsible for compositing all the application and system surfaces into a single buffer that is finally to be displayed by display controller.
Android graphics components
following diagram for a depiction of the Android graphics pipeline:
BufferQueue
BufferQueues provide the glue between the Android graphics components. These are a pair of queues that mediate the constant cycle of buffers from the producer to the consumer. Once the producers hand off their buffers, SurfaceFlinger is responsible for compositing everything onto the display.
See the following diagram for the BufferQueue communication process.