Android UI Internal : UI Composition with SurfaceFlinger

Pragati Singh 🇮🇳🇸🇦
mobidroid
Published in
1 min readAug 24, 2017

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

Figure 1. How surfaces are rendered

following diagram for a depiction of the Android graphics pipeline:

Figure 2. Graphic data flow through Android

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.

Figure 3. BufferQueue communication process

--

--

Pragati Singh 🇮🇳🇸🇦
mobidroid
Editor for

CISM | PMP | CISA | CHFI | GenAI | Program Director | Digital Transformation & Cybersecurity Leader | Chief Transformation Officer | ITO Head