• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 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/graphics_effect/config.gni")
16
17config("export_config") {
18  include_dirs = [ "include" ]
19  cflags_cc = [ "-std=c++17" ]
20}
21
22ohos_source_set("graphics_effect_src") {
23  branch_protector_ret = "pac_ret"
24  sanitize = {
25    cfi = true
26    cfi_cross_dso = true
27    debug = false
28  }
29  cflags = [
30    "-Wall",
31    "-O2",
32    "-ftrapv",
33    "-FPIC",
34    "-FS",
35    "-D_FORTIFY_SOURCE=2",
36    "-fvisibility=hidden",
37    "-fdata-sections",
38    "-ffunction-sections",
39  ]
40  cflags_cc = [
41    "-std=c++17",
42    "-O2",
43    "-ftrapv",
44    "-FPIC",
45    "-FS",
46    "-D_FORTIFY_SOURCE=2",
47    "-fdata-sections",
48    "-ffunction-sections",
49    "-fvisibility=hidden",
50    "-fvisibility-inlines-hidden",
51  ]
52
53  public_configs = [ ":export_config" ]
54  include_dirs = [ "include" ]
55
56  sources = [
57    "src/ext/gex_dot_matrix_shader.cpp",
58    "src/ext/gex_flow_light_sweep_shader.cpp",
59    "src/ext/gex_marshalling_helper.cpp",
60    "src/ext/gex_complex_shader.cpp",
61    "src/ge_aibar_shader_filter.cpp",
62    "src/ge_aurora_noise_shader.cpp",
63    "src/ge_bezier_warp_shader_filter.cpp",
64    "src/ge_border_light_shader.cpp",
65    "src/ge_color_gradient_shader_filter.cpp",
66    "src/ge_content_light_shader_filter.cpp",
67    "src/ge_contour_diagonal_flow_light_shader.cpp",
68    "src/ge_displacement_distort_shader_filter.cpp",
69    "src/ge_direction_light_shader_filter.cpp",
70    "src/ge_edge_light_shader_filter.cpp",
71    "src/ge_external_dynamic_loader.cpp",
72    "src/ge_filter_composer.cpp",
73    "src/ge_grey_shader_filter.cpp",
74    "src/ge_kawase_blur_shader_filter.cpp",
75    "src/ge_linear_gradient_blur_shader_filter.cpp",
76    "src/ge_linear_gradient_shader_mask.cpp",
77    "src/ge_magnifier_shader_filter.cpp",
78    "src/ge_mask_transition_shader_filter.cpp",
79    "src/ge_mesa_blur_shader_filter.cpp",
80    "src/ge_particle_circular_halo_shader.cpp",
81    "src/ge_pixel_map_shader_mask.cpp",
82    "src/ge_render.cpp",
83    "src/ge_radial_gradient_shader_mask.cpp",
84    "src/ge_ripple_shader_mask.cpp",
85    "src/ge_shader.cpp",
86    "src/ge_shader_filter.cpp",
87    "src/ge_sound_wave_filter.cpp",
88    "src/ge_system_properties.cpp",
89    "src/ge_tone_mapping_helper.cpp",
90    "src/ge_variable_radius_blur_shader_filter.cpp",
91    "src/ge_visual_effect.cpp",
92    "src/ge_visual_effect_container.cpp",
93    "src/ge_visual_effect_impl.cpp",
94    "src/ge_water_ripple_filter.cpp",
95    "src/ge_wavy_ripple_light_shader.cpp",
96    "src/ge_hps_effect_filter.cpp",
97    "src/ge_wave_gradient_shader_mask.cpp",
98    "src/ge_double_ripple_shader_mask.cpp",
99  ]
100
101  deps = [ ":utils" ]
102
103  external_deps = []
104  if (is_arkui_x) {
105    deps += [
106      "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${target_os}",
107      "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics",
108      "//third_party/bounds_checking_function:libsec_static",
109      "//third_party/skia:skia_$target_os",
110    ]
111    external_deps += [ "hilog:libhilog" ]
112  } else {
113    external_deps += [
114      "bounds_checking_function:libsec_shared",
115      "graphic_2d:2d_graphics",
116      "hilog:libhilog",
117    ]
118  }
119
120  if (!build_ohos_sdk) {
121    external_deps += [ "hitrace:hitrace_meter" ]
122  }
123
124  defines = []
125  if (current_os == "ohos") {
126    defines += [ "GE_OHOS" ]
127    external_deps += [ "init:libbegetutil" ]
128  }
129  if (is_arkui_x) {
130    if (graphics_effect_feature_upgrade_skia) {
131      defines += [ "USE_M133_SKIA" ]
132    }
133  }
134  if (ge_is_ohos || ge_is_linux) {
135    defines += [ "GE_PLATFORM_UNIX" ]
136  }
137
138  output_name = "graphics_effect"
139  part_name = "graphics_effect"
140  subsystem_name = "graphic"
141}
142
143if (is_arkui_x) {
144  ohos_source_set("libgraphics_effect") {
145    branch_protector_ret = "pac_ret"
146    sanitize = {
147      cfi = true
148      cfi_cross_dso = true
149      debug = false
150    }
151
152    deps = [
153      ":graphics_effect_src",
154      "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${target_os}",
155      "//third_party/bounds_checking_function:libsec_static",
156    ]
157
158    part_name = "graphics_effect"
159    subsystem_name = "graphic"
160  }
161} else {
162  ohos_shared_library("graphics_effect_core") {
163    branch_protector_ret = "pac_ret"
164    sanitize = {
165      cfi = true
166      cfi_cross_dso = true
167      debug = false
168    }
169
170    public_configs = [ ":export_config" ]
171
172    deps = [ ":graphics_effect_src" ]
173    external_deps = [
174      "bounds_checking_function:libsec_shared",
175      "hilog:libhilog",
176    ]
177
178    output_name = "graphics_effect"
179    part_name = "graphics_effect"
180    subsystem_name = "graphic"
181  }
182}
183
184# utils {{{
185group("utils") {
186  if (current_os == "ohos") {
187    public_external_deps = [ "c_utils:utils" ]
188  } else if (current_os == "android" || current_os == "ios") {
189    public_external_deps = [ "c_utils:utilsbase" ]
190  } else {
191    public_deps = [ ":mock_utils" ]
192  }
193}
194
195config("utils_config") {
196  include_dirs = [ "src/platform/mock" ]
197}
198
199ohos_source_set("mock_utils") {
200  public_configs = [ ":utils_config" ]
201  sources = [
202    "src/platform/mock/parcel.cpp",
203    "src/platform/mock/refbase.cpp",
204  ]
205  public_external_deps = [ "bounds_checking_function:libsec_shared" ]
206  part_name = "graphics_effect"
207  subsystem_name = "graphic"
208}
209# utils }}}
210