• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#     http://www.apache.org/licenses/LICENSE-2.0
6# Unless required by applicable law or agreed to in writing, software
7# distributed under the License is distributed on an "AS IS" BASIS,
8# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9# See the License for the specific language governing permissions and
10# limitations under the License.
11
12if (os_level != "standard") {
13    import("//build/lite/config/component/lite_component.gni")
14    import("//build/lite/config/subsystem/graphic/config.gni")
15    import("//build/lite/ndk/ndk.gni")
16
17    defines = []
18
19    declare_args() {
20        graphic_utils_lite_enable_ohos_product_config = false
21    }
22
23    if (graphic_utils_lite_enable_ohos_product_config) {
24        defines += [ "ENABLE_OHOS_GRAPHIC_UTILS_PRODUCT_CONFIG=1" ]
25    }
26
27    lite_component("utils_lite") {
28        features = [ ":graphic_utils_lite" ]
29    public_deps = features
30    }
31
32    ndk_lib("graphic_utils_lite_ndk") {
33        lib_extension = ".so"
34        deps = [ ":graphic_utils_lite" ]
35        head_files = [ "interfaces/kits" ]
36    }
37
38    lite_library("graphic_utils_lite") {
39        if (ohos_kernel_type == "liteos_m") {
40            target_type = "static_library"
41        } else {
42            target_type = "shared_library"
43        }
44        include_dirs = [ "frameworks" ]
45        if (defined(board_toolchain_type) && board_toolchain_type == "iccarm") {
46            include_dirs +=
47                [ "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite" ]
48            cflags = [
49            "--diag_suppress",
50            "Pe068,Pa089,Pa093,Pe161,Pe181,Pa205,Pe223",
51            ]
52            cflags_cc = cflags
53        }
54        if (enable_graphic_dualcore == true) {
55            defines += [ "HAL_CPU_NUM=2" ]
56        }
57
58        sources = [
59            "frameworks/color.cpp",
60            "frameworks/diagram/common/paint.cpp",
61            "frameworks/diagram/depiction/depict_curve.cpp",
62            "frameworks/diagram/rasterizer/rasterizer_cells_antialias.cpp",
63            "frameworks/diagram/rasterizer/rasterizer_scanline_antialias.cpp",
64            "frameworks/diagram/rasterizer/rasterizer_scanline_clip.cpp",
65            "frameworks/diagram/vertexgenerate/vertex_generate_dash.cpp",
66            "frameworks/diagram/vertexgenerate/vertex_generate_stroke.cpp",
67            "frameworks/diagram/vertexprimitive/geometry_arc.cpp",
68            "frameworks/diagram/vertexprimitive/geometry_bezier_arc.cpp",
69            "frameworks/diagram/vertexprimitive/geometry_curves.cpp",
70            "frameworks/diagram/vertexprimitive/geometry_shorten_path.cpp",
71            "frameworks/geometry2d.cpp",
72            "frameworks/graphic_math.cpp",
73            "frameworks/graphic_performance.cpp",
74            "frameworks/graphic_timer.cpp",
75            "frameworks/hal_cpu.cpp",
76            "frameworks/hal_tick.cpp",
77            "frameworks/mem_api.cpp",
78            "frameworks/pixel_format_utils.cpp",
79            "frameworks/style.cpp",
80            "frameworks/trans_affine.cpp",
81            "frameworks/transform.cpp",
82            "frameworks/version.cpp",
83        ]
84        public_configs = [ ":graphic_utils_public_config" ]
85        if (ohos_kernel_type == "liteos_m") {
86            deps = [ "//third_party/bounds_checking_function:libsec_static" ]
87            public_deps =
88                [ "//base/hiviewdfx/hilog_lite/frameworks/mini:hilog_lite" ]
89        } else {
90            deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
91            public_deps =
92                [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ]
93        }
94    }
95
96    config("graphic_utils_public_config") {
97        include_dirs = [
98            "interfaces/innerkits",
99            "interfaces/kits",
100            "$product_path/graphic_config",
101        ]
102
103        defines += [
104            "GRAPHIC_ENABLE_LINECAP_FLAG=1",
105            "GRAPHIC_ENABLE_LINEJOIN_FLAG=1",
106            "GRAPHIC_ENABLE_ELLIPSE_FLAG=1",
107            "GRAPHIC_ENABLE_BEZIER_ARC_FLAG=1",
108            "GRAPHIC_ENABLE_ARC_FLAG=1",
109            "GRAPHIC_ENABLE_ROUNDEDRECT_FLAG=1",
110            "GRAPHIC_ENABLE_DASH_GENERATE_FLAG=1",
111            "GRAPHIC_ENABLE_BLUR_EFFECT_FLAG=1",
112            "GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG=1",
113            "GRAPHIC_ENABLE_GRADIENT_FILL_FLAG=1",
114            "GRAPHIC_ENABLE_PATTERN_FILL_FLAG=1",
115            "GRAPHIC_ENABLE_DRAW_IMAGE_FLAG=1",
116            "GRAPHIC_ENABLE_DRAW_TEXT_FLAG=1",
117        ]
118    }
119
120    if (ohos_kernel_type != "liteos_m") {
121        lite_component("lite_graphic_hals") {
122            features = [ ":graphic_hals" ]
123            public_deps = features
124        }
125
126        ndk_lib("lite_graphic_hals_ndk") {
127            lib_extension = ".so"
128            deps = [ ":graphic_hals" ]
129            head_files = []
130        }
131
132        shared_library("graphic_hals") {
133            sources = [
134            "frameworks/hals/gfx_engines.cpp",
135            "frameworks/hals/hi_fbdev.cpp",
136            ]
137            include_dirs =
138                [ "//foundation/window/window_manager_lite/interfaces/innerkits" ]
139            deps = [
140            ":utils_lite",
141            "//drivers/peripheral/display/hal:hdi_display",
142            ]
143            public_configs = [ ":graphic_hals_public_config" ]
144            ldflags = [
145            "-ldisplay_gfx",
146            "-ldisplay_gralloc",
147            "-ldisplay_layer",
148            ]
149        }
150    }
151
152    config("graphic_hals_public_config") {
153        include_dirs = [
154            "interfaces/innerkits",
155            "//drivers/peripheral/base",
156            "//drivers/peripheral/display/interfaces/include",
157            "$product_path/graphic_config",
158        ]
159    }
160} else {
161  import("//build/ohos.gni")
162  import("//foundation/graphic/graphic_utils_lite/utils.gni")
163
164  config("graphic_utils_config") {
165    include_dirs = graphic_utils_include_dirs
166    include_dirs += [ "$GRAPHIC_GRAPHIC_UTILS_LITE_PATH/frameworks" ]
167  }
168
169  ohos_static_library("utils_lite") {
170    sources = graphic_utils_sources
171    public_configs = [":graphic_utils_config"]
172
173    external_deps = [
174      "bounds_checking_function:libsec_static",
175    ]
176    part_name = "graphic_utils_lite"
177    subsystem_name = "graphic"
178  }
179}