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.
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.
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.
- 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.
- 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.
### Usage<a name="section812962919413"></a>
### Usage
For details, see the README and **test** directory of each repository.
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.
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.
| 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.