未验证 提交 309ed952 编写于 作者: O openharmony_ci 提交者: Gitee

!3464 Done! 3206:update graphic readme

Merge pull request !3464 from wusongqing/TR3206
# Graphics<a name="EN-US_TOPIC_0000001115588688"></a>
# Graphics Subsystem
The Graphics subsystem mainly consists of user interface \(UI\) components, layout, animator, font, input event, window management, and rendering and drawing modules. It is an application framework that can be built on the LiteOS to develop OpenHarmony applications for Internet of Things \(IoT\) devices with limited hardware resources or on the standard OS to develop OpenHarmony applications for standard- and large-system devices \(for example, tablet and lite smart devices\).
## 1.1 Mini System<a name="section1346303311377"></a>
The Graphics subsystem mainly consists of user interface (UI) components, layout, animator, font, input event, window management, and rendering and drawing modules. It is an application framework that can be built on the LiteOS to develop OpenHarmony applications for Internet of Things (IoT) devices with limited hardware resources or on the standard OS to develop OpenHarmony applications for standard- and large-system devices.
### Introduction<a name="section1165992615384"></a>
## Mini System
The Graphics subsystem mainly consists of user interface \(UI\) components, layout, animator, font, input event, window management, and rendering and drawing modules. It is an application framework that can be built on the LiteOS to develop OpenHarmony applications for Internet of Things \(IoT\) devices with limited hardware resources.
### Introduction
**Figure 1** Graphics subsystem architecture<a name="fig16488143010409"></a>
![](figures/graphics-subsystem-architecture.png "graphics-subsystem-architecture")
The Graphics subsystem mainly consists of UI components, layout, animator, font, input event, window management, and rendering and drawing modules. It is an application framework that can be built on the LiteOS to develop OpenHarmony applications for IoT devices with limited hardware resources.
**Figure 1** Graphics subsystem architecture
![](figures/graphics-subsystem-architecture.png "graphics subsystem architecture")
The related modules are described as follows:
- View: provides application components, including UIView, UIViewGroup, UIButton, UILabel, UILabelButton, UIList, and UISlider.
- Animator: defines functions for customizing animators.
- Layout: lays out components, including Flexlayout, GridLayout, and ListLayout.
- View: provides application components, including **UIView**, **UIViewGroup**, **UIButton**, **UILabel**, **UILabelButton**, **UIList**, and **UISlider**.
- Animator: defines functions for customizing animations.
- Layout: lays out components, including **Flexlayout**, **GridLayout**, and **ListLayout**.
- Transform: rotates, translates, or scales images.
- Event: processes basic events, including click, press, drag, and long press events.
- Rendering engine: performs rendering and drawing operations.
- 2D graphics library: draws 2D graphical elements including lines, rectangles, circles, arcs, images, and texts. Functions of this module include software drawing and hardware acceleration capability interconnection.
- 2D graphics library: draws 2D graphical elements including lines, rectangles, circles, arcs, images, and texts. Functions of this module include interconnection with the software drawing and hardware acceleration capabilities.
- Multi-language: processes the line feed and shaping of texts in different languages.
- Image library: parses and operates images of different types and formats, such as PNG, JPEG, ARGB8888, and ARGB565.
- WindowManager: manages windows, including creating, showing, hiding a window, and combining windows.
- WindowManager: manages windows, including creating, showing, hiding, and combining windows.
- InputManager: processes input events.
### Directory Structure<a name="section141331948134020"></a>
### Directory Structure
```
/foundation/graphic
├── surface # Shared memory
├── ui # UI module, including UI components, animations, and fonts.
├── ui # UI module, including UI components, animations, and fonts
├── utils # Basic graphics library and hardware adaptation layer
└── wms # Window and input event management
```
### Constraints<a name="section15729113104112"></a>
### Constraints
- The Graphics subsystem does not support multi-thread concurrent operations. You are advised to perform related operations in UI threads.
- The **utils/interfaces/innerkits/graphic\_config.h** file provides the configuration information about macro switches that can be used to enable or disable graphics features. You need to configure these switches before compilation. Note that some switches are configured depending on the platform.
- The **utils/interfaces/innerkits/graphic\_config.h** file provides the configuration information about macro switches that can be used to enable or disable graphics features. You need to configure these switches before compilation. Note that some switches are configured depending on the platform.
### Usage<a name="section812962919413"></a>
### Usage
For details, see the README and **test** directory of each repository.
For details, see the README and **test** directory of each repository.
### Repositories Involved<a name="section12651205434115"></a>
### Repositories Involved
**Graphics subsystem**
......@@ -56,95 +57,75 @@ graphic\_wms
graphic\_utils
## 1.2 Standard System<a name="section1249610812538"></a>
## Standard System
### Introduction<a name="section1374615251510"></a>
### Introduction
The Graphics subsystem provides graphics APIs and window management capabilities, which can be invoked by using Java or JS APIs. It is applicable to all devices that run the standard system.
The Graphics subsystem provides graphics APIs.
The following figure shows the architecture of the Graphics subsystem.
![](figures/en-us_image_0000001115748590.png)
- Surface
Provides APIs for managing the graphics buffer and the efficient and convenient rotation buffer.
- Vsync
Provides APIs for managing registration and response of all vertical sync signals.
- WindowManager
Provides APIs for creating and managing windows.
- WaylandProtocols
Provides the communication protocols between the window manager and synthesizer.
- Compositor
Implements synthesis of layers.
![Graphics subsystem architecture](figures/graphic_rosen_architecture.jpg)
- Renderer
The OpenHarmony graphics stack is divided into the following layers:
Functions as the back-end rendering module of the synthesizer.
Interface layer: provides the native development kit (NDK) for the Graphics subsystem, including WebGL, native drawing, and OpenGL command-level drawing.
- Wayland protocols
Framework layer: consists of the Render Service, Drawing, Animation, Effect, and Display and Memory Management modules.
| Module | Description |
|------------------------|--------------------------------------------------------------------------------------------|
| Render Service| Performs UI framework drawing. This module converts the ArkUI component description into drawing tree information and renders the optimal path based on the corresponding rendering policy. It also provides the core underlying mechanism for multi-window smoothness and spatial UI sharing. |
| Drawing | Provides standard internal interfaces in the Graphics subsystem to implement 2D rendering, 3D rendering, and rendering engine management. |
| Animation | Provides capabilities related to the animation engine. |
| Effect | Processes image effects and rendering effects, including cascading and parallel processing of multiple effects, and adding rendering effects and component interaction effects during layout. |
| Display and Memory Management | Decouples the graphics stack from hardware and provides OpenHarmony display and memory management. OEMs need to adapt the HDIs defined by this module.|
Provides Wayland inter-process communication protocols.
Engine layer: consists of the 2D graphics library and 3D graphics engine. The 2D graphics library provides bottom-layer APIs for 2D graphics drawing (including text drawing). The 3D graphics engine capability is being developed.
- Shell
Provides multi-window capabilities.
- Input Manager
Functions as the multimodal input module that receives input events.
### Directory Structure<a name="section16751364713"></a>
### Directory Structure
```
foundation/graphic/standard/
├── figures # Images referenced by Markdown
├── frameworks # Framework code
│ ├── bootanimation # BootAnimation code
│ ├── animation_server # Animation server code
│ ├── bootanimation # Boot animation
│ ├── dumper # Graphic dumper code
│ ├── fence # Fence code
│ ├── surface # Surface code
│ ├── vsync # Vsync code
│ └── wm # WindowManager code
├── interfaces # External APIs
├── rosen # Framework code
│ ├── build # Build description
│ ├── doc # doc
│ ├── include # Code of external header files
│ ├── lib # lib
│ ├── modules # Graphic subsystem code, organized by module
│ ├── samples # Sample code
│ ├── test # Development and test code
│ ├── tools # Tool code
├── interfaces # Graphics APIs
│ ├── innerkits # Native APIs
│ └── kits # JS APIs and NAPIs
│ └── kits # JS APIs and native APIs
└── utils # Utilities
```
### Constraints<a name="section126494189715"></a>
Language version: C++ 11 or later
### Compilation and Building<a name="section883114292070"></a>
### Constraints
The dependent APIs include the following:
Programming language version: C++ 11 or later
- graphic\_standard:libwms\_client
- graphic\_standard:libsurface
- graphic\_standard:libvsync\_client
### Compilation and Building
### Usage<a name="section1351214227564"></a>
### Usage
For details, see the README and **test** directory of each repository.
For details, see the README and **test** directory of each repository.
### Repositories Involved<a name="section11578621131119"></a>
### Repositories Involved
**Graphics subsystem**
graphic\_standard
ace\_ace\_engine
aafwk\_standard
multimedia\_media\_standard
multimedia\_camera\_standard
- ace_ace_engine
- aafwk_standard
- multimedia_media_standard
- multimedia_camera_standard
- Window Manager
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册