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-11-22 07:26:36 +00:00
|
|
|
graphic_2d_feature_product = "default"
|
2023-11-23 06:29:39 +00:00
|
|
|
graphic_2d_feature_enable_pgo = false
|
|
|
|
graphic_2d_feature_pgo_path = ""
|
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
|
2023-09-25 13:28:58 +00:00
|
|
|
graphic_2d_feature_use_texgine = false
|
2023-07-11 13:55:33 +00:00
|
|
|
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-12-05 05:15:05 +00:00
|
|
|
graphic_2d_feature_enable_flutter_vulkan = false
|
2023-12-09 05:45:28 +00:00
|
|
|
graphic_2d_feature_enable_opengl = true
|
2023-08-12 09:44:44 +00:00
|
|
|
graphic_2d_feature_enable_filter_cache = true
|
2023-12-25 12:44:45 +00:00
|
|
|
graphic_2d_feature_parallel_upload_enable = true
|
2023-08-12 09:44:55 +00:00
|
|
|
enable_text_gine = true
|
2023-10-26 08:18:46 +00:00
|
|
|
use_texgine = true
|
2024-01-18 10:35:00 +00:00
|
|
|
use_skia_txt = false
|
2023-11-24 14:10:50 +00:00
|
|
|
use_video_processing_engine = false
|
2023-10-26 08:18:46 +00:00
|
|
|
logger_enable_scope = false
|
|
|
|
texgine_enable_debug_log = false
|
2023-09-14 08:56:46 +00:00
|
|
|
player_framework_enable = true
|
2023-09-02 10:20:47 +00:00
|
|
|
graphic_2d_feature_drivers_interface_display_enable = true
|
2023-09-21 02:34:39 +00:00
|
|
|
graphic_2d_feature_tp_switch_enbale = false
|
2023-12-19 07:40:47 +00:00
|
|
|
graphic_2d_feature_enable_recording_dcl = true
|
2023-08-12 09:44:44 +00:00
|
|
|
|
2023-11-03 03:15:58 +00:00
|
|
|
if (defined(is_arkui_x) && is_arkui_x) {
|
2023-06-15 03:34:39 +00:00
|
|
|
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-12-09 05:45:28 +00:00
|
|
|
if (graphic_2d_feature_product == "phone") {
|
2023-12-13 09:25:43 +00:00
|
|
|
graphic_2d_feature_enable_vulkan = true
|
2023-12-09 05:45:28 +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) {
|
2023-12-05 05:15:05 +00:00
|
|
|
if (graphic_2d_feature_enable_flutter_vulkan) {
|
|
|
|
gpu_defines += [ "RS_ENABLE_OLD_VK" ]
|
|
|
|
}
|
2023-07-11 13:55:33 +00:00
|
|
|
if (graphic_2d_feature_enable_vulkan) {
|
2023-02-16 12:58:19 +00:00
|
|
|
gpu_defines += [
|
|
|
|
"ACE_ENABLE_VK",
|
|
|
|
"RS_ENABLE_VK",
|
|
|
|
]
|
2023-12-09 05:45:28 +00:00
|
|
|
}
|
|
|
|
if (graphic_2d_feature_enable_opengl) {
|
2023-02-16 12:58:19 +00:00
|
|
|
gpu_defines += [
|
|
|
|
"ACE_ENABLE_GL",
|
|
|
|
"RS_ENABLE_GL",
|
|
|
|
]
|
|
|
|
}
|
2023-11-25 11:37:33 +00:00
|
|
|
if (graphic_2d_feature_enable_recording_dcl) {
|
|
|
|
rs_enable_recording_dcl = true
|
|
|
|
gpu_defines += [ "ENABLE_RECORDING_DCL" ]
|
|
|
|
} else {
|
|
|
|
rs_enable_recording_dcl = false
|
|
|
|
}
|
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-12-05 05:15:05 +00:00
|
|
|
libvulkan += [ "//third_party/vulkan-loader/openharmony:vulkan_loader" ]
|
|
|
|
}
|
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-12-25 12:44:45 +00:00
|
|
|
if (graphic_2d_feature_parallel_upload_enable &&
|
|
|
|
graphic_2d_feature_rs_enable_uni_render) {
|
|
|
|
rs_enable_parallel_upload = true
|
|
|
|
gpu_defines += [ "RS_ENABLE_PARALLEL_UPLOAD" ]
|
|
|
|
} else {
|
|
|
|
rs_enable_parallel_upload = false
|
|
|
|
}
|
|
|
|
|
2023-11-15 11:51:31 +00:00
|
|
|
if (graphic_2d_feature_rs_enable_eglimage || 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-10-26 08:18:46 +00:00
|
|
|
# use_texgine = graphic_2d_feature_use_texgine
|
2023-09-25 13:28:58 +00:00
|
|
|
|
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-11-29 02:24:48 +00:00
|
|
|
if (graphic_2d_feature_enable_afbc) {
|
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" ]
|
|
|
|
}
|
2023-09-16 09:14:31 +00:00
|
|
|
|
|
|
|
tp_defines = []
|
|
|
|
tp_feature_enable = false
|
2023-09-21 02:34:39 +00:00
|
|
|
if (graphic_2d_feature_tp_switch_enbale) {
|
2023-09-16 09:14:31 +00:00
|
|
|
tp_feature_enable = true
|
2023-09-16 09:21:45 +00:00
|
|
|
tp_defines = [ "TP_FEATURE_ENABLE" ]
|
2023-09-16 09:14:31 +00:00
|
|
|
}
|
|
|
|
|
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-12-09 05:45:28 +00:00
|
|
|
|
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"),
|
|
|
|
]
|
2024-01-08 09:18:38 +00:00
|
|
|
check_delegator_ext_file_args = [
|
|
|
|
"--filename",
|
|
|
|
rebase_path("//foundation/graphic/graphic_2d_ext/delegator/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")
|
|
|
|
}
|
|
|
|
}
|
2024-01-08 09:18:38 +00:00
|
|
|
|
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
|
|
|
|
2024-01-08 09:18:38 +00:00
|
|
|
graphic_2d_delegator_configs = {
|
|
|
|
}
|
|
|
|
if (exec_script(check_graphic_ext_file_script,
|
|
|
|
check_delegator_ext_file_args,
|
|
|
|
"string") == "True") {
|
|
|
|
graphic_2d_delegator_configs = {
|
|
|
|
import("//foundation/graphic/graphic_2d_ext/delegator/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-10-24 08:50:49 +00:00
|
|
|
memmgr_root = "//foundation/resourceschedule/memmgr"
|
|
|
|
memmgr_plugin_root = "//foundation/resourceschedule/memmgr_plugin"
|
2023-11-02 10:26:42 +00:00
|
|
|
fuzz_test_output_path = "graphic_2d/graphic_2d"
|
2023-11-23 01:39:39 +00:00
|
|
|
video_processing_engine_root = "//foundation/multimedia/video_processing_engine"
|
2023-12-01 07:47:12 +00:00
|
|
|
arkui_root = "//foundation/arkui"
|
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" ]
|
|
|
|
}
|
2023-08-24 06:18:59 +00:00
|
|
|
|
|
|
|
if (defined(global_parts_info) &&
|
2023-09-14 08:56:46 +00:00
|
|
|
!defined(global_parts_info.multimedia_player_framework)) {
|
|
|
|
player_framework_enable = false
|
2023-08-24 06:18:59 +00:00
|
|
|
}
|
2023-09-02 10:20:47 +00:00
|
|
|
|
2024-01-05 07:47:13 +00:00
|
|
|
if (defined(global_parts_info) &&
|
|
|
|
defined(global_parts_info.multimedia_video_processing_engine)) {
|
|
|
|
use_video_processing_engine = true
|
|
|
|
}
|
|
|
|
|
2023-09-02 10:20:47 +00:00
|
|
|
if (defined(global_parts_info) &&
|
|
|
|
!defined(global_parts_info.hdf_drivers_interface_display)) {
|
|
|
|
graphic_2d_feature_drivers_interface_display_enable = false
|
|
|
|
}
|
2023-10-24 08:50:49 +00:00
|
|
|
|
|
|
|
use_memmgr_plugin = false
|
|
|
|
if (defined(global_parts_info.resourceschedule_memmgr_plugin)) {
|
|
|
|
use_memmgr_plugin = true
|
|
|
|
}
|
|
|
|
use_memmgr = false
|
|
|
|
if (defined(global_parts_info.resourceschedule_memmgr)) {
|
|
|
|
use_memmgr = true
|
|
|
|
}
|