1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/openharmony-graphic_surface_lite

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
Внести вклад в разработку кода
Синхронизировать код
Отмена
Подсказка: Поскольку Git не поддерживает пустые директории, создание директории приведёт к созданию пустого файла .keep.
Loading...
README.md

Surface

Introduction

A surface is used to manage and transfer the shared memory of graphics and media. Specific use cases include graphics display and composition, and media playback and recording.

A surface transfers data across processes through control structures such as Inter-Process Communication (IPC) handles (with copies), and transfers graphics and media data (zero-copy) through shared memory. The following figure shows the position where a surface works in the system architecture. The elements in green blocks are surface buffers.

Figure 1 Position of a surface (known as Screen buffer in the following figure) in the system architecture

Directory Structure

/foundation/graphic/surface_lite
├── frameworks       # Framework code
├── interfaces       # APIs
│   ├── innerkits    # APIs between modules
│   └── kits         # External APIs
└── test             # Test code
    ├── fuzztest     # Fuzzing
    └── unittest     # Unit testing

Compilation and Building

# Generate the libsurface.so file in the out directory of the product folder through GN compilation.
hb build surface_lite

Description

Process Description

Take the interaction between Window Manager Service (WMS) and UI as an example. UI works as a producer, and WMS works as a consumer.

The producer obtains a buffer from the free queue, draws the UI content into the buffer, and places the buffer in the dirty queue.

The consumer obtains the buffer from the dirty queue, synthesizes graphics data, and places the buffer in the free queue again.

Figure 2 Surface rotation process

NOTICE:

  1. A shared memory is used for data transfer, and the process of creating a surface of the first time should be responsible for task of managing the shared memory. If the process is abnormal and is not recycled, severe memory leakage occurs. Therefore, pay special attention to the process.
  2. Surfaces are generally used for cross-process transfers of large memory blocks (such as display data) in graphics or media. Especially, when continuous physical memory is used, the transfer rate can be greatly improved. It is not recommended that surfaces be used in small-memory transfer scenarios. Otherwise, memory fragmentation may occur, which affects the performance in typical scenarios.

Usage

For details, see lite WMS.

Repositories Involved

Graphic subsystem

window_window_manager_lite

graphic_surface_lite

arkui_ui_lite

graphic_graphic_utils_lite

Комментарии ( 0 )

Вы можете оставить комментарий после Вход в систему

Введение

Графическая общая память | графическая разделяемая память Развернуть Свернуть
Apache-2.0
Отмена

Обновления (1)

все

Участники

все

Недавние действия

Загрузить больше
Больше нет результатов для загрузки
1
https://api.gitlife.ru/oschina-mirror/openharmony-graphic_surface_lite.git
git@api.gitlife.ru:oschina-mirror/openharmony-graphic_surface_lite.git
oschina-mirror
openharmony-graphic_surface_lite
openharmony-graphic_surface_lite
master