Android display Architecture Analysis 6-surface manager Introduction

Source: Internet
Author: User

This section describes the architecture of the user space Display Section, which has no direct connection with the kernel, mainly the section below JNI to Hal.
1. Surface Manager (surface flinger) Introduction

Surface manager is a module in libraries under the framework in the user space. As follows:

When the system executes multiple applications at the same time, surface manager is responsible for managing the interaction between the display and access operations, and also for merging 2D and 3D drawings.

Surface manager can prepare a surface (which can be regarded as a layer) and transmit the FD of the surface (a piece of memory) to an app so that the app can paint on it. Typical applications are as follows:

2. Surface manager Architecture Analysis

The image system in Android adopts the client/server architecture as follows:

Client: Application-related parts. The code is divided into two parts: one is the supplied APIs provided by Java, and the other is the underlying implementation written by C ++.

Server: surfaceflinger, responsible for merging and sending it to the buffer for display. It is mainly written by C ++ code.

The client and server communicate with each other through the binder IPC. The overall structure is as follows:

As shown in, the client part of the surface is actually a bridge for various applications to perform drawing operations. This bridge leads to surfaceflinger on the server through the binder, and surfaceflinger is responsible for synthesizing various surfaces, then, the buffer is transmitted to the framebuffer end for underlying display. Each surface corresponds to two buffers, one front buffer and one back buffer. when the data is updated, the data is updated on the back buffer. When the data needs to be displayed, the back buffer and the front buffer are exchanged.

In the next section, we will focus on surfaceflinger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.