• 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
14import("//build/ohos.gni")
15import("//foundation/graphic/graphic_2d/graphic_config.gni")
16
17## Build surface.so {{{
18config("surface_config") {
19  visibility = [ ":*" ]
20
21  include_dirs = [ "include" ]
22
23  cflags = [
24    "-Wall",
25    "-Werror",
26    "-g3",
27  ]
28}
29
30config("surface_public_config") {
31  include_dirs = [
32    "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include",
33    "//foundation/graphic/graphic_2d/interfaces/inner_api/surface",
34    "//foundation/graphic/graphic_2d/interfaces/inner_api/common",
35    "//foundation/graphic/graphic_2d/utils/sandbox",
36  ]
37
38  if (defined(graphic_2d_ext_configs.vendor_root)) {
39    include_dirs += graphic_2d_ext_configs.libsurface_ext_include_dirs
40  }
41
42  defines = []
43  if (ace_enable_gpu) {
44    defines = [ "ACE_ENABLE_GPU" ]
45  }
46  if (graphic_standard_feature_freemem_enable) {
47    defines += [ "SURFACE_ENABLE_FREEMEM" ]
48  }
49  defines += gpu_defines
50
51  cflags = [ "-Wno-error=deprecated-declarations" ]
52}
53
54ohos_shared_library("surface") {
55  sources = [
56    "src/buffer_client_producer.cpp",
57    "src/buffer_extra_data_impl.cpp",
58    "src/buffer_manager.cpp",
59    "src/buffer_queue.cpp",
60    "src/buffer_queue_consumer.cpp",
61    "src/buffer_queue_producer.cpp",
62    "src/buffer_utils.cpp",
63    "src/consumer_surface.cpp",
64    "src/native_buffer.cpp",
65    "src/native_window.cpp",
66    "src/producer_surface.cpp",
67    "src/surface.cpp",
68    "src/surface_buffer_impl.cpp",
69    "src/surface_delegate.cpp",
70    "src/surface_tunnel_handle.cpp",
71    "src/surface_utils.cpp",
72  ]
73
74  configs = [ ":surface_config" ]
75
76  public_configs = [
77    ":surface_public_config",
78    "//commonlibrary/c_utils/base:utils_config",
79  ]
80
81  deps = [ "//foundation/graphic/graphic_2d/utils/sync_fence:sync_fence" ]
82
83  public_deps = [
84    "//commonlibrary/c_utils/base:utils",
85    "//drivers/peripheral/display/hdi_service/gralloc/client:hdi_gralloc_client",
86    "//foundation/graphic/graphic_2d/utils/buffer_handle:buffer_handle",
87    "//foundation/graphic/graphic_2d/utils/sandbox:sandbox_utils",
88    "//foundation/graphic/graphic_2d/utils/scoped_bytrace:scoped_bytrace",
89    "//third_party/EGL:libEGL",
90    "//third_party/openGLES:libGLES",
91  ]
92
93  external_deps = [
94    "hitrace_native:hitrace_meter",
95    "hiviewdfx_hilog_native:libhilog",
96    "ipc:ipc_core",
97  ]
98
99  symlink_target_name = [ "libnative_window.so" ]
100
101  if (defined(graphic_2d_ext_configs.vendor_root)) {
102    sources += graphic_2d_ext_configs.libsurface_ext_sources
103    sources -= graphic_2d_ext_configs.libsurface_ext_sources_del
104
105    public_deps += [ "//foundation/graphic/graphic_2d_ext/ohcore/graphic_compat_layer:libgraphic_compat_layer" ]
106
107    public_deps -= [ "//drivers/peripheral/display/hdi_service/gralloc/client:hdi_gralloc_client" ]
108  }
109
110  part_name = "graphic_standard"
111  subsystem_name = "graphic"
112}
113
114## Build surface.so }}}
115
116