• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Utils<a name="EN-US_TOPIC_0000001123083525"></a>
2
3-   [Introduction](#section11660541593)
4-   [Directory Structure](#section161941989596)
5-   [Compilation and Building](#section137768191623)
6-   [Description](#section1312121216216)
7    -   [Usage](#section129654513264)
8
9-   [Repositories Involved](#section1371113476307)
10
11## Introduction<a name="section11660541593"></a>
12
13The Utils module defines the common data structure in the graphics subsystem and provides a lite OS adaptation layer, which includes the lock, thread, and file system.
14
15**Figure  1**  Dependency between modules of the graphics subsystem<a name="fig717664212591"></a>
16![](figures/dependency-between-modules-of-the-graphics-subsystem.png "dependency-between-modules-of-the-graphics-subsystem")
17
18## Directory Structure<a name="section161941989596"></a>
19
20```
21/foundation/graphic/utils
22├── frameworks      # Framework code
23│   ├── hals        # Hardware adaptation layer
24│   ├── linux       # Linux platform adaptation layer
25│   ├── liteos      # LiteOS platform adaptation layer
26│   └── windows     # Windows platform adaptation layer
27├── interfaces      # APIs
28│   ├── innerkits   # APIs between modules
29│   │   └── hals    # APIs of the hardware adaptation layer
30│   └── kits        # External APIs
31└── test            # Unit testing
32```
33
34## Compilation and Building<a name="section137768191623"></a>
35
36```
37# Generate the libgraphic_utils.so file in the out directory of the product folder through GN compilation.
38hb build lite_graphic_utils
39```
40
41## Description<a name="section1312121216216"></a>
42
43### Usage<a name="section129654513264"></a>
44
45-   Utils is used in UI, surface, and WMS modules. For details, see the related source code.
46-   The  **test**  folder provides unit testing for each utils API. Refer to it for the usage of utils.
47
48## Repositories Involved<a name="section1371113476307"></a>
49
50[Graphic subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/graphics-subsystem.md)
51
52[graphic_wms](https://gitee.com/openharmony/graphic_wms/blob/master/README.md)
53
54[graphic_surface](https://gitee.com/openharmony/graphic_surface/blob/master/README.md)
55
56[graphic_ui](https://gitee.com/openharmony/graphic_ui/blob/master/README.md)
57
58# Hals<a name="EN-US_TOPIC_0000001124625243"></a>
59
60-   [Introduction](#section11660541593)
61-   [Directory Structure](#section161941989596)
62-   [Compilation and Building](#section137768191623)
63-   [Description](#section1312121216216)
64    -   [Usage](#section129654513264)
65
66-   [Repositories Involved](#section1371113476307)
67
68## Introduction<a name="section11660541593"></a>
69
70The Hals module adapts and encapsulates the functions related to the driver subsystem and platform, including FrameBuffer, graphics \(GFX\), and single instruction, multiple data \(SIMD\).
71
72**Figure  1**  Dependency between modules of the graphics subsystem and that between graphics modules and the driver subsystem<a name="fig717664212591"></a>
73![](figures/dependency-between-modules-of-the-graphics-subsystem-and-that-between-graphics-modules-and-the-drive.png "dependency-between-modules-of-the-graphics-subsystem-and-that-between-graphics-modules-and-the-drive")
74
75## Directory Structure<a name="section161941989596"></a>
76
77```
78/foundation/graphic/utils
79├── frameworks      # Framework code
80│   ├── hals        # Hardware adaptation layer
81│   ├── linux       # Linux platform adaptation layer
82│   ├── liteos      # LiteOS platform adaptation layer
83│   └── windows     # Windows platform adaptation layer
84├── interfaces      # APIs
85│   ├── innerkits   # APIs between modules
86│   │   └── hals    # APIs of the hardware adaptation layer
87│   └── kits        # External APIs
88└── test            # Unit testing
89```
90
91## Compilation and Building<a name="section137768191623"></a>
92
93```
94# Generate the libgraphic_hals.so file in the out directory of the product folder through GN compilation.
95hb build lite_graphic_utils
96```
97
98## Description<a name="section1312121216216"></a>
99
100### Usage<a name="section129654513264"></a>
101
102-   Hals is used in UI, surface, and WMS modules. For details, see the related source code.
103
104## Repositories Involved<a name="section1371113476307"></a>
105
106[Graphic subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/graphics-subsystem.md)
107
108[graphic_wms](https://gitee.com/openharmony/graphic_wms/blob/master/README.md)
109
110[graphic_surface](https://gitee.com/openharmony/graphic_surface/blob/master/README.md)
111
112[graphic_ui](https://gitee.com/openharmony/graphic_ui/blob/master/README.md)
113
114**graphic_utils**