• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2022 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#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos_var.gni")
15
16# source code for Windows.
17use_mingw_win = "${current_os}_${current_cpu}" == "mingw_x86_64"
18use_clang_mac = "${current_os}_${current_cpu}" == "mac_x64"
19use_clang_ios = current_os == "ios" || current_os == "tvos"
20use_clang_android = current_os == "android"
21
22# Toolchain
23windows_buildtool = "//build/toolchain/mingw:mingw_x86_64"
24mac_buildtool = "//build/toolchain/mac:clang_x64"
25
26# Defines
27image_decode_windows_defines = [ "_WIN32" ]
28image_decode_mac_defines = [ "_APPLE" ]
29image_decode_ios_defines = [ "IOS_PLATFORM" ]
30image_decode_android_defines = [ "A_PLATFORM" ]
31image_sep_f = "/f"
32image_sep_p = "/p"
33image_oundation = "oundation"
34image_lugins = "lugins"
35image_multimedia = "multimedia"
36image_dir = "image_framework"
37image_subsystem = "/$image_sep_f$image_oundation/$image_multimedia/$image_dir"
38ipc_subsystem = "/$image_sep_f$image_oundation"
39graphic_multimedia = "graphic"
40graphic_dir = "graphic_2d"
41graphic_subsystem =
42    "/$image_sep_f$image_oundation/$graphic_multimedia/$graphic_dir"
43plugins_lib_root = "/$image_sep_p$image_lugins/libs"
44comlib_sep_c = "/c"
45comlib_ommonlibrary = "ommonlibrary"
46commonlibrary_c_utils = "c_utils"
47commonlibrary_subsystem =
48    "/$comlib_sep_c$comlib_ommonlibrary/$commonlibrary_c_utils"
49commonlibrary_memory_utils = "memory_utils"
50comlibmemory_subsystem =
51    "/$comlib_sep_c$comlib_ommonlibrary/$commonlibrary_memory_utils"
52base_sep_b = "/b"
53base_ase = "ase"
54resource_management_subsystem =
55    "/$base_sep_b$base_ase/global/resource_management"
56graphic_surface_root = "//foundation/graphic/graphic_surface"
57
58# skia
59image_use_new_skia = defined(use_new_skia) && use_new_skia
60
61skia_root = "//third_party"
62skia_deps_root = skia_root
63skia_core = [ "$skia_deps_root/skia:skia_core" ]
64skia_skcms = [ "$skia_deps_root/skia:skcms" ]
65
66if (use_clang_android) {
67  if (image_use_new_skia) {
68    skia_platform = [ "$skia_deps_root/skia:skia_android" ]
69  } else {
70    skia_platform = [ "$skia_deps_root/skia:ace_skia_android" ]
71  }
72} else if (use_clang_ios) {
73  if (image_use_new_skia) {
74    skia_platform = [ "$skia_deps_root/skia:skia_ios" ]
75  } else {
76    skia_platform = [ "$skia_deps_root/skia:ace_skia_ios" ]
77  }
78} else if (use_mingw_win) {
79  if (image_use_new_skia) {
80    skia_platform = [ "$skia_deps_root/skia:skia_windows" ]
81  } else {
82    skia_platform = [ "$skia_deps_root/skia:ace_skia_windows" ]
83  }
84} else if (use_clang_mac) {
85  if (image_use_new_skia) {
86    skia_platform = [ "$skia_deps_root/skia:skia_mac" ]
87  } else {
88    skia_platform = [ "$skia_deps_root/skia:ace_skia_mac" ]
89  }
90} else {
91  if (image_use_new_skia) {
92    skia_platform = [ "$skia_deps_root/skia:skia_ohos" ]
93  } else {
94    skia_platform = [ "$skia_deps_root/skia:ace_skia_ohos" ]
95  }
96}
97
98# hw_decoder
99declare_args() {
100  enable_jpeg_hw_decode = true
101
102  if (defined(global_parts_info) &&
103      !defined(global_parts_info.hdf_drivers_interface_display)) {
104    enable_jpeg_hw_decode = false
105  }
106}
107