• 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/test.gni")
15import("//foundation/graphic/graphics_effect/config.gni")
16
17module_output_path = "graphics_effect/effect_process"
18
19group("unittest") {
20  testonly = true
21  deps = [ ":GraphicsEffectTest" ]
22}
23
24ohos_source_set("graphics_effect_test_src") {
25  cflags = [
26    "-O2",
27    "-ftrapv",
28    "-FPIC",
29    "-FS",
30    "-D_FORTIFY_SOURCE=2",
31    "-fdata-sections",
32    "-ffunction-sections",
33  ]
34  cflags_cc = [
35    "-std=c++17",
36    "-O2",
37    "-ftrapv",
38    "-FPIC",
39    "-FS",
40    "-D_FORTIFY_SOURCE=2",
41    "-fvisibility-inlines-hidden",
42    "-fdata-sections",
43    "-ffunction-sections",
44  ]
45
46  include_dirs = [ "${graphics_effect_root}/include" ]
47
48  sources = [
49    "${graphics_effect_root}/src/ext/gex_dot_matrix_shader.cpp",
50    "${graphics_effect_root}/src/ext/gex_flow_light_sweep_shader.cpp",
51    "${graphics_effect_root}/src/ext/gex_marshalling_helper.cpp",
52    "${graphics_effect_root}/src/ext/gex_complex_shader.cpp",
53    "${graphics_effect_root}/src/ge_aibar_shader_filter.cpp",
54    "${graphics_effect_root}/src/ge_aurora_noise_shader.cpp",
55    "${graphics_effect_root}/src/ge_bezier_warp_shader_filter.cpp",
56    "${graphics_effect_root}/src/ge_border_light_shader.cpp",
57    "${graphics_effect_root}/src/ge_color_gradient_shader_filter.cpp",
58    "${graphics_effect_root}/src/ge_content_light_shader_filter.cpp",
59    "${graphics_effect_root}/src/ge_direction_light_shader_filter.cpp",
60    "${graphics_effect_root}/src/ge_contour_diagonal_flow_light_shader.cpp",
61    "${graphics_effect_root}/src/ge_displacement_distort_shader_filter.cpp",
62    "${graphics_effect_root}/src/ge_edge_light_shader_filter.cpp",
63    "${graphics_effect_root}/src/ge_external_dynamic_loader.cpp",
64    "${graphics_effect_root}/src/ge_filter_composer.cpp",
65    "${graphics_effect_root}/src/ge_grey_shader_filter.cpp",
66    "${graphics_effect_root}/src/ge_kawase_blur_shader_filter.cpp",
67    "${graphics_effect_root}/src/ge_linear_gradient_blur_shader_filter.cpp",
68    "${graphics_effect_root}/src/ge_linear_gradient_shader_mask.cpp",
69    "${graphics_effect_root}/src/ge_magnifier_shader_filter.cpp",
70    "${graphics_effect_root}/src/ge_mask_transition_shader_filter.cpp",
71    "${graphics_effect_root}/src/ge_mesa_blur_shader_filter.cpp",
72    "${graphics_effect_root}/src/ge_particle_circular_halo_shader.cpp",
73    "${graphics_effect_root}/src/ge_pixel_map_shader_mask.cpp",
74    "${graphics_effect_root}/src/ge_radial_gradient_shader_mask.cpp",
75    "${graphics_effect_root}/src/ge_render.cpp",
76    "${graphics_effect_root}/src/ge_ripple_shader_mask.cpp",
77    "${graphics_effect_root}/src/ge_double_ripple_shader_mask.cpp",
78    "${graphics_effect_root}/src/ge_shader.cpp",
79    "${graphics_effect_root}/src/ge_shader_filter.cpp",
80    "${graphics_effect_root}/src/ge_sound_wave_filter.cpp",
81    "${graphics_effect_root}/src/ge_system_properties.cpp",
82    "${graphics_effect_root}/src/ge_tone_mapping_helper.cpp",
83    "${graphics_effect_root}/src/ge_variable_radius_blur_shader_filter.cpp",
84    "${graphics_effect_root}/src/ge_visual_effect.cpp",
85    "${graphics_effect_root}/src/ge_visual_effect_container.cpp",
86    "${graphics_effect_root}/src/ge_visual_effect_impl.cpp",
87    "${graphics_effect_root}/src/ge_water_ripple_filter.cpp",
88    "${graphics_effect_root}/src/ge_hps_effect_filter.cpp",
89    "${graphics_effect_root}/src/ge_wave_gradient_shader_mask.cpp",
90    "${graphics_effect_root}/src/ge_wavy_ripple_light_shader.cpp",
91  ]
92
93  external_deps = []
94  external_deps += [ "c_utils:utils" ]
95  if (is_arkui_x) {
96    deps += [
97      "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${target_os}",
98      "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics",
99      "//third_party/bounds_checking_function:libsec_static",
100      "//third_party/skia:skia_$target_os",
101    ]
102    external_deps += [ "hilog:libhilog" ]
103  } else {
104    external_deps += [
105      "bounds_checking_function:libsec_shared",
106      "graphic_2d:2d_graphics",
107      "hilog:libhilog",
108    ]
109  }
110
111  defines = []
112  if (current_os == "ohos") {
113    defines += [ "GE_OHOS" ]
114    external_deps += [ "init:libbegetutil" ]
115  }
116
117  if (ge_is_ohos || ge_is_linux) {
118    defines += [ "GE_PLATFORM_UNIX" ]
119  }
120
121  part_name = "graphics_effect"
122  subsystem_name = "graphic"
123}
124
125ohos_unittest("GraphicsEffectTest") {
126  module_out_path = module_output_path
127
128  sources = [
129    "ge_aibar_shader_filter_test.cpp",
130    "ge_aurora_noise_shader_test.cpp",
131    "ge_bezier_warp_shader_filter_test.cpp",
132    "ge_border_light_shader_test.cpp",
133    "ge_color_gradient_shader_filter_test.cpp",
134    "ge_content_light_shader_filter_test.cpp",
135    "ge_contour_diagonal_flow_light_shader_test.cpp",
136    "ge_displacement_distort_shader_filter_test.cpp",
137    "ge_edge_light_shader_filter_test.cpp",
138    "ge_grey_shader_filter_test.cpp",
139    "ge_kawase_blur_shader_filter_test.cpp",
140    "ge_linear_gradient_blur_shader_filter_test.cpp",
141    "ge_magnifier_shader_filter_test.cpp",
142    "ge_mesa_blur_shader_filter_test.cpp",
143    "ge_particle_circular_halo_shader_test.cpp",
144    "ge_pixel_map_shader_mask_test.cpp",
145    "ge_render_test.cpp",
146    "ge_ripple_shader_mask_test.cpp",
147    "ge_shader_filter_test.cpp",
148    "ge_shader_test.cpp",
149    "ge_sound_wave_filter_test.cpp",
150    "ge_system_properties_test.cpp",
151    "ge_variable_radius_blur_shader_filter_test.cpp",
152    "ge_visual_effect_container_test.cpp",
153    "ge_visual_effect_impl_test.cpp",
154    "ge_visual_effect_test.cpp",
155    "ge_water_ripple_filter_test.cpp",
156    "ge_wavy_ripple_light_shader_test.cpp",
157    "gex_dot_matrix_shader_params_test.cpp",
158    "gex_dot_matrix_shader_test.cpp",
159    "gex_flow_light_sweep_shader_test.cpp",
160    "gex_complex_shader_test.cpp",
161    "ge_hps_effect_filter_test.cpp"
162  ]
163
164  if (!is_mingw && !is_win) {
165    sources += [ "ge_external_dynamic_loader_test.cpp" ]
166  }
167
168  include_dirs = [ "$graphics_effect_root/include" ]
169
170  cflags = [
171    "-Dprivate=public",
172    "-Dprotected=public",
173  ]
174
175  public_deps = [ ":graphics_effect_test_src" ]
176
177  external_deps = [
178    "c_utils:utils",
179    "graphic_2d:2d_graphics",
180    "hilog:libhilog",
181  ]
182
183  part_name = "graphics_effect"
184  subsystem_name = "graphic"
185}
186