• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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#
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
14declare_args() {
15  graphic_standard_feature_bootanimation_enable = true
16  graphic_standard_feature_ace_enable_gpu = true
17  graphic_standard_feature_color_gamut_enable = false
18  graphic_standard_feature_rs_enable_eglimage = false
19  graphic_standard_feature_rs_enable_uni_render = false
20  graphic_standard_feature_wuji_enable = false
21  graphic_standard_feature_freemem_enable = false
22  graphic_standard_feature_enable_afbc = false
23}
24
25if (graphic_standard_feature_ace_enable_gpu) {
26  gpu_defines = [
27    "ACE_ENABLE_GL",
28    "RS_ENABLE_GL",
29  ]
30  ace_enable_gpu = true
31  rs_enable_gpu = true
32  surface_enable_gpu = true
33
34  # libgl is a native stub for decoupling system.img and vendor.img
35  # real libgl installed in /vendor/lib/chipsetsdk
36  libgl = [
37    "//foundation/graphic/graphic_2d/frameworks/opengl_wrapper:EGL",
38    "//foundation/graphic/graphic_2d/frameworks/opengl_wrapper:GLESv3",
39  ]
40} else {
41  gpu_defines = [ "ACE_DISABLE_GL" ]
42  ace_enable_gpu = false
43  rs_enable_gpu = false
44  surface_enable_gpu = false
45  libgl = []
46}
47
48if (graphic_standard_feature_rs_enable_eglimage) {
49  gpu_defines += [
50    "RS_ENABLE_EGLIMAGE",
51    "RS_ENABLE_EGLQUERYSURFACE",
52  ]
53  rs_enable_eglimage = true
54} else {
55  gpu_defines += [ "RS_DISABLE_EGLIMAGE" ]
56  rs_enable_eglimage = false
57}
58
59if (graphic_standard_feature_rs_enable_uni_render) {
60  gpu_defines += [ "RS_ENABLE_UNI_RENDER" ]
61}
62
63if (graphic_standard_feature_enable_afbc) {
64  gpu_defines += [ "RS_ENABLE_AFBC" ]
65}
66
67graphic_2d_ext_configs = {
68}
69check_graphic_ext_file_script = "//build/ohos/file_exists.py"
70check_graphic_ext_file_args = [
71  "--filename",
72  rebase_path("//foundation/graphic/graphic_2d_ext/ohcore/build/config.gni"),
73]
74if (exec_script(check_graphic_ext_file_script,
75                check_graphic_ext_file_args,
76                "string") == "True" && "${product_name}" == "ohcore") {
77  graphic_2d_ext_configs = {
78    import("//foundation/graphic/graphic_2d_ext/ohcore/build/config.gni")
79  }
80}
81
82graphic_2d_root = "//foundation/graphic/graphic_2d"
83