• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2023 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")
16import("render_service_client.gni")
17
18config("render_service_client_config") {
19  include_dirs = [
20    "$graphic_2d_root/rosen/modules",
21    "$graphic_2d_root/rosen/modules/render_service_client/core",
22    "$graphic_2d_root/rosen/modules/render_service_base/include",
23    "$graphic_2d_root/interfaces/inner_api/common",
24    "$graphic_2d_root/interfaces/inner_api/surface",
25    "$graphic_2d_root/interfaces/inner_api/composer",
26    "//drivers/peripheral/display/interfaces/include",
27    "//drivers/peripheral/base",
28  ]
29  defines = rs_common_define
30}
31
32template("render_service_client_source_set") {
33  ohos_source_set(target_name) {
34    defines = []
35    defines += gpu_defines
36    defines += [ "MODULE_RSC" ]
37    is_static_lib = invoker.is_static_lib
38    include_dirs = [
39      "$graphic_2d_root/rosen/modules/2d_graphics/src",
40      "$graphic_2d_root/rosen/modules/render_frame_trace/include",
41      "$graphic_2d_root/rosen/modules/render_service_base/src",
42      "$graphic_2d_root/utils/log",
43      "$graphic_2d_root/utils/sandbox",
44    ]
45
46    sources = [
47      #animation
48      "core/animation/rs_animation.cpp",
49      "core/animation/rs_animation_callback.cpp",
50      "core/animation/rs_animation_group.cpp",
51      "core/animation/rs_animation_timing_curve.cpp",
52      "core/animation/rs_curve_animation.cpp",
53      "core/animation/rs_implicit_animation_param.cpp",
54      "core/animation/rs_implicit_animator.cpp",
55      "core/animation/rs_implicit_animator_map.cpp",
56      "core/animation/rs_interpolating_spring_animation.cpp",
57      "core/animation/rs_keyframe_animation.cpp",
58      "core/animation/rs_path_animation.cpp",
59      "core/animation/rs_property_animation.cpp",
60      "core/animation/rs_spring_animation.cpp",
61      "core/animation/rs_transition.cpp",
62      "core/animation/rs_transition_effect.cpp",
63
64      #modifier
65      "core/modifier/rs_extended_modifier.cpp",
66      "core/modifier/rs_modifier.cpp",
67      "core/modifier/rs_modifier_extractor.cpp",
68      "core/modifier/rs_modifier_manager.cpp",
69      "core/modifier/rs_modifier_manager_map.cpp",
70      "core/modifier/rs_property.cpp",
71      "core/modifier/rs_property_modifier.cpp",
72      "core/modifier/rs_showing_properties_freezer.cpp",
73
74      #jank_detector
75      "core/jank_detector/rs_jank_detector.cpp",
76
77      #pipeline
78      "core/pipeline/rs_divided_ui_capture.cpp",
79      "core/pipeline/rs_node_map.cpp",
80      "core/pipeline/rs_render_thread.cpp",
81      "core/pipeline/rs_render_thread_visitor.cpp",
82
83      #transaction
84      "core/transaction/rs_application_agent_impl.cpp",
85      "core/transaction/rs_interfaces.cpp",
86      "core/transaction/rs_process_transaction_controller.cpp",
87      "core/transaction/rs_render_thread_client.cpp",
88      "core/transaction/rs_sync_transaction_controller.cpp",
89      "core/transaction/rs_transaction.cpp",
90
91      #ui
92      "core/ui/rs_canvas_drawing_node.cpp",
93      "core/ui/rs_canvas_node.cpp",
94      "core/ui/rs_display_node.cpp",
95      "core/ui/rs_effect_node.cpp",
96      "core/ui/rs_node.cpp",
97      "core/ui/rs_proxy_node.cpp",
98      "core/ui/rs_root_node.cpp",
99      "core/ui/rs_surface_extractor.cpp",
100      "core/ui/rs_surface_node.cpp",
101      "core/ui/rs_ui_director.cpp",
102      "core/ui/rs_ui_share_context.cpp",
103    ]
104
105    if (defined(graphic_2d_ext_configs.vendor_root)) {
106      sources += graphic_2d_ext_configs.librender_service_client_ext_sources
107      sources -= graphic_2d_ext_configs.librender_service_client_ext_sources_del
108    }
109
110    cflags = [
111      "-Wall",
112      "-Wno-pointer-arith",
113      "-Wno-non-virtual-dtor",
114      "-Wno-missing-field-initializers",
115      "-Wno-c++11-narrowing",
116      "-fvisibility=hidden",
117    ]
118
119    cflags_cc = [
120      "-std=c++17",
121      "-fvisibility-inlines-hidden",
122    ]
123
124    deps = [
125      "$graphic_2d_root/rosen/modules/platform:ipc_core",
126      "$graphic_2d_root/rosen/modules/render_frame_trace:render_frame_trace",
127    ]
128    public_deps = []
129    if (enable_export_macro) {
130      defines += [ "ENABLE_EXPORT_MACRO" ]
131    }
132
133    if (defined(use_rosen_drawing) && use_rosen_drawing) {
134      defines += [ "USE_ROSEN_DRAWING" ]
135      deps += [ "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics" ]
136      if (ace_enable_gpu) {
137        defines += [ "ACE_ENABLE_GPU" ]
138      }
139      if (current_os == "mingw") {
140        defines += [ "WINDOWS_PLATFORM" ]
141      }
142    }
143    if (rosen_is_ohos) {
144      public_deps +=
145          [ "$graphic_2d_root/rosen/modules/frame_analyzer:libframe_analyzer" ]
146      external_deps = [
147        "c_utils:utils",
148        "hisysevent:libhisysevent",
149        "hitrace:hitrace_meter",
150        "image_framework:image_native",
151      ]
152
153      if (accessibility_enable) {
154        external_deps += [ "accessibility:accessibilityconfig" ]
155        defines += accessibility_defines
156      }
157    } else if (rosen_preview) {
158      deps += [
159        "$graphic_2d_root:libgl",
160        "$graphic_2d_root/rosen/modules/glfw_render_context:libglfw_render_context",
161      ]
162
163      if (rss_enabled) {
164        external_deps = []
165      }
166    }
167
168    if (rss_enabled) {
169      defines += [ "OHOS_RSS_CLIENT" ]
170      external_deps += [ "resource_schedule_service:ressched_client" ]
171    }
172
173    if (is_static_lib) {
174      public_deps += [ "$graphic_2d_root/rosen/modules/render_service_base:librender_service_base_static" ]
175    } else {
176      public_deps += [ "$graphic_2d_root/rosen/modules/render_service_base:librender_service_base" ]
177      deps += [ "$rosen_root/modules/platform:eventhandler" ]
178    }
179
180    if (defined(use_new_render_context) && use_new_render_context) {
181      public_deps += [ "$graphic_2d_root/rosen/modules/render_service_base/src/render_backend:librender_backend" ]
182    }
183
184    public_configs = [ ":render_service_client_config" ]
185
186    part_name = "graphic_2d"
187    subsystem_name = "graphic"
188  }
189}
190
191render_service_client_source_set("render_service_client_src") {
192  is_static_lib = false
193}
194
195render_service_client_source_set("render_service_client_src_static") {
196  is_static_lib = true
197}
198
199ohos_shared_library("librender_service_client") {
200  public_deps = [ ":render_service_client_src" ]
201  innerapi_tags = [ "platformsdk" ]
202  part_name = "graphic_2d"
203  subsystem_name = "graphic"
204}
205
206ohos_source_set("librender_service_client_static") {
207  public_deps = [ ":render_service_client_src_static" ]
208  deps = [ "$rosen_root/modules/platform:eventhandler" ]
209  part_name = "graphic_2d"
210  subsystem_name = "graphic"
211}
212
213group("test") {
214  if (rosen_is_ohos) {
215    testonly = true
216
217    deps = [ "test:test" ]
218  }
219}
220