2023-05-19 07:04:33 +00:00
|
|
|
# Copyright (c) 2021 Huawei Device Co., Ltd.
|
2021-11-19 06:08:31 +00:00
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2022-04-16 06:25:07 +00:00
|
|
|
declare_args() {
|
2023-07-11 13:55:33 +00:00
|
|
|
graphic_2d_feature_bootanimation_enable = true
|
|
|
|
graphic_2d_feature_ace_enable_gpu = true
|
|
|
|
graphic_2d_feature_color_gamut_enable = false
|
|
|
|
graphic_2d_feature_rs_enable_eglimage = false
|
|
|
|
graphic_2d_feature_rs_enable_uni_render = false
|
|
|
|
graphic_2d_feature_wuji_enable = false
|
|
|
|
graphic_2d_feature_enable_afbc = false
|
|
|
|
graphic_2d_feature_freemem_enable = false
|
|
|
|
graphic_2d_feature_parallel_render_enable = true
|
|
|
|
graphic_2d_feature_enable_vulkan = false
|
2023-08-12 09:44:44 +00:00
|
|
|
graphic_2d_feature_enable_filter_cache = true
|
2023-08-12 09:44:55 +00:00
|
|
|
enable_text_gine = true
|
2023-08-12 09:44:44 +00:00
|
|
|
|
2023-06-15 03:34:39 +00:00
|
|
|
if (defined(build_cross_platform_version) && build_cross_platform_version) {
|
|
|
|
use_new_render_context = false
|
2023-08-11 10:32:29 +00:00
|
|
|
is_cross_platform = true
|
2023-06-15 03:34:39 +00:00
|
|
|
} else {
|
2023-08-11 10:32:29 +00:00
|
|
|
is_cross_platform = false
|
2023-06-15 03:34:39 +00:00
|
|
|
use_new_render_context = false
|
|
|
|
}
|
2022-04-16 06:25:07 +00:00
|
|
|
}
|
|
|
|
|
2023-02-16 12:58:19 +00:00
|
|
|
gpu_defines = []
|
2023-03-13 02:53:49 +00:00
|
|
|
accessibility_defines = []
|
2023-08-12 09:44:44 +00:00
|
|
|
if (enable_text_gine) {
|
|
|
|
gpu_defines += [ "USE_GRAPHIC_TEXT_GINE" ]
|
|
|
|
}
|
2023-07-11 13:55:33 +00:00
|
|
|
if (graphic_2d_feature_ace_enable_gpu) {
|
|
|
|
if (graphic_2d_feature_enable_vulkan) {
|
2023-02-16 12:58:19 +00:00
|
|
|
gpu_defines += [
|
|
|
|
"ACE_ENABLE_VK",
|
|
|
|
"RS_ENABLE_VK",
|
|
|
|
]
|
|
|
|
} else {
|
|
|
|
gpu_defines += [
|
|
|
|
"ACE_ENABLE_GL",
|
|
|
|
"RS_ENABLE_GL",
|
|
|
|
]
|
|
|
|
}
|
2022-02-12 07:14:04 +00:00
|
|
|
ace_enable_gpu = true
|
2022-04-16 10:11:35 +00:00
|
|
|
rs_enable_gpu = true
|
2022-08-04 09:26:06 +00:00
|
|
|
surface_enable_gpu = true
|
2022-04-16 06:25:07 +00:00
|
|
|
|
|
|
|
# libgl is a native stub for decoupling system.img and vendor.img
|
|
|
|
# real libgl installed in /vendor/lib/chipsetsdk
|
|
|
|
libgl = [
|
2022-05-30 10:38:27 +00:00
|
|
|
"//foundation/graphic/graphic_2d/frameworks/opengl_wrapper:EGL",
|
|
|
|
"//foundation/graphic/graphic_2d/frameworks/opengl_wrapper:GLESv3",
|
2022-04-16 06:25:07 +00:00
|
|
|
]
|
2023-02-16 12:58:19 +00:00
|
|
|
|
|
|
|
libvulkan = []
|
2023-07-11 13:55:33 +00:00
|
|
|
if (graphic_2d_feature_enable_vulkan) {
|
2023-02-16 12:58:19 +00:00
|
|
|
libvulkan += [
|
|
|
|
"//third_party/flutter/engine/flutter/vulkan:vulkan_flutter",
|
2023-05-17 03:12:19 +00:00
|
|
|
"//third_party/vulkan-loader/openharmony:vulkan_loader",
|
2023-02-16 12:58:19 +00:00
|
|
|
]
|
|
|
|
}
|
2021-11-19 06:08:31 +00:00
|
|
|
} else {
|
2022-04-16 06:25:07 +00:00
|
|
|
gpu_defines = [ "ACE_DISABLE_GL" ]
|
|
|
|
ace_enable_gpu = false
|
2022-04-16 10:11:35 +00:00
|
|
|
rs_enable_gpu = false
|
2022-08-04 09:26:06 +00:00
|
|
|
surface_enable_gpu = false
|
2022-04-16 06:25:07 +00:00
|
|
|
libgl = []
|
2023-02-16 12:58:19 +00:00
|
|
|
libvulkan = []
|
2021-11-19 06:08:31 +00:00
|
|
|
}
|
2022-05-11 08:10:11 +00:00
|
|
|
|
2023-07-11 13:55:33 +00:00
|
|
|
if ((graphic_2d_feature_rs_enable_eglimage &&
|
|
|
|
!graphic_2d_feature_enable_vulkan) || current_os == "android") {
|
2022-07-11 12:06:31 +00:00
|
|
|
gpu_defines += [
|
|
|
|
"RS_ENABLE_EGLIMAGE",
|
|
|
|
"RS_ENABLE_EGLQUERYSURFACE",
|
|
|
|
]
|
2022-06-08 08:41:33 +00:00
|
|
|
rs_enable_eglimage = true
|
|
|
|
} else {
|
|
|
|
gpu_defines += [ "RS_DISABLE_EGLIMAGE" ]
|
|
|
|
rs_enable_eglimage = false
|
|
|
|
}
|
|
|
|
|
2023-07-11 13:55:33 +00:00
|
|
|
if (graphic_2d_feature_rs_enable_uni_render) {
|
2023-01-17 10:04:46 +00:00
|
|
|
rs_enable_driven_render = true
|
|
|
|
gpu_defines += [
|
|
|
|
"RS_ENABLE_DRIVEN_RENDER",
|
|
|
|
"RS_ENABLE_UNI_RENDER",
|
|
|
|
]
|
|
|
|
} else {
|
|
|
|
rs_enable_driven_render = false
|
2022-08-16 04:43:05 +00:00
|
|
|
}
|
2022-10-09 08:46:11 +00:00
|
|
|
|
2023-07-11 13:55:33 +00:00
|
|
|
if (graphic_2d_feature_enable_afbc && !graphic_2d_feature_enable_vulkan) {
|
2022-10-09 08:46:11 +00:00
|
|
|
gpu_defines += [ "RS_ENABLE_AFBC" ]
|
|
|
|
}
|
2022-11-19 03:31:38 +00:00
|
|
|
|
2023-07-11 13:55:33 +00:00
|
|
|
if (graphic_2d_feature_parallel_render_enable) {
|
2022-12-20 14:45:49 +00:00
|
|
|
rs_enable_parallel_render = true
|
|
|
|
gpu_defines += [ "RS_ENABLE_PARALLEL_RENDER" ]
|
|
|
|
}
|
2023-06-15 03:34:39 +00:00
|
|
|
if (defined(use_new_render_context) && use_new_render_context) {
|
|
|
|
rs_enable_parallel_render = false
|
|
|
|
gpu_defines -= [ "RS_ENABLE_PARALLEL_RENDER" ]
|
|
|
|
}
|
2022-11-19 03:31:38 +00:00
|
|
|
graphic_2d_ext_configs = {
|
|
|
|
}
|
|
|
|
check_graphic_ext_file_script = "//build/ohos/file_exists.py"
|
|
|
|
check_graphic_ext_file_args = [
|
|
|
|
"--filename",
|
|
|
|
rebase_path("//foundation/graphic/graphic_2d_ext/ohcore/build/config.gni"),
|
|
|
|
]
|
2023-08-08 09:13:05 +00:00
|
|
|
check_ddgr_ext_file_args = [
|
|
|
|
"--filename",
|
|
|
|
rebase_path("//foundation/graphic/graphic_2d_ext/ddgr/ddgr_config.gni"),
|
|
|
|
]
|
2022-11-19 03:31:38 +00:00
|
|
|
if (exec_script(check_graphic_ext_file_script,
|
|
|
|
check_graphic_ext_file_args,
|
|
|
|
"string") == "True" && "${product_name}" == "ohcore") {
|
|
|
|
graphic_2d_ext_configs = {
|
|
|
|
import("//foundation/graphic/graphic_2d_ext/ohcore/build/config.gni")
|
|
|
|
}
|
|
|
|
}
|
2023-08-08 09:13:05 +00:00
|
|
|
if (exec_script(check_graphic_ext_file_script,
|
|
|
|
check_ddgr_ext_file_args,
|
|
|
|
"string") == "True") {
|
|
|
|
ddgr_ext_configs = {
|
|
|
|
import("//foundation/graphic/graphic_2d_ext/ddgr/ddgr_config.gni")
|
|
|
|
}
|
|
|
|
}
|
2023-08-12 09:44:44 +00:00
|
|
|
|
|
|
|
flutter_root = "//third_party/flutter"
|
|
|
|
ace_flutter_engine_root = "$flutter_root/build"
|
2023-02-14 02:09:44 +00:00
|
|
|
graphic_2d_root = "//foundation/graphic/graphic_2d"
|
2023-05-08 13:27:05 +00:00
|
|
|
hilog_root = "//base/hiviewdfx/hilog"
|
2023-06-01 04:00:29 +00:00
|
|
|
window_base_path = "//foundation/window/window_manager"
|
|
|
|
safwk_base = "//foundation/systemabilitymgr/safwk"
|
2023-08-12 09:44:44 +00:00
|
|
|
skia_root_new = "//third_party/skia"
|
2023-03-13 02:53:49 +00:00
|
|
|
|
|
|
|
accessibility_enable = false
|
|
|
|
if (defined(global_parts_info) &&
|
|
|
|
defined(global_parts_info.barrierfree_accessibility)) {
|
|
|
|
accessibility_enable = true
|
|
|
|
accessibility_defines = [ "ACCESSIBILITY_ENABLE" ]
|
|
|
|
}
|