• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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/graphic_2d/graphic_config.gni")
16import("//foundation/graphic/graphic_2d/rosen/modules/effect/effect_config.gni")
17
18module_output_path = "graphic_2d/rosen/modules/effect"
19
20ohos_unittest("EffectTest") {
21  module_out_path = module_output_path
22
23  deps = [ "//third_party/googletest:gtest_main" ]
24
25  sources = [
26    "color_picker_common_unittest.cpp",
27    "color_picker_unittest.cpp",
28    "test_picture_files.cpp",
29  ]
30
31  if (effect_enable_gpu) {
32    sources += [
33      "effect_filter_unittest.cpp",
34      "egl_manager_test.cpp",
35      "filter_common_unittest.cpp",
36      "sk_image_chain_unittest.cpp",
37      "sk_image_filter_factory_unittest.cpp",
38    ]
39  }
40
41  deps += [
42    "$graphic_2d_root/frameworks/opengl_wrapper:EGL",
43    "$graphic_2d_root/frameworks/opengl_wrapper:GLESv3",
44    "$graphic_2d_root/rosen/modules/effect/color_picker:color_picker",
45    "$graphic_2d_root/rosen/modules/effect/effect_common:effect_common",
46    "$graphic_2d_root/rosen/modules/effect/effect_ndk:native_effect_ndk",
47    "$graphic_2d_root/rosen/modules/effect/egl:libegl_effect",
48    "$graphic_2d_root/rosen/modules/effect/skia_effectChain:skeffectchain",
49    "$graphic_2d_root/utils/color_manager:color_manager",
50    "//foundation/multimedia/image_framework/interfaces/innerkits:image_native",
51    "//foundation/multimedia/image_framework/interfaces/kits/js/common:image",
52  ]
53
54  cflags = [
55    "-Dprivate=public",
56    "-Dprotected=public",
57  ]
58
59  configs = [
60    ":effect_test_config",
61    "$graphic_2d_root/utils/color_manager:color_manager_public_config",
62  ]
63  external_deps = [
64    "cJSON:cjson",
65    "c_utils:utils",
66    "hilog:libhilog",
67    "image_framework:image",
68    "image_framework:pixelmap",
69  ]
70
71  if (defined(use_new_skia) && use_new_skia) {
72    external_deps += [ "skia:skia_canvaskit" ]
73  } else {
74    include_dirs += [ "$flutter_root" ]
75  }
76}
77
78config("effect_test_config") {
79  visibility = [ ":*" ]
80  include_dirs = [
81    "//third_party/EGL/api",
82    "//third_party/openGLES/api",
83    "//third_party/skia",
84    "$graphic_2d_root/rosen/modules/effect/color_picker/include",
85    "$graphic_2d_root/rosen/modules/effect/effect_common/include",
86    "$graphic_2d_root/rosen/modules/effect/effect_ndk/include",
87    "$graphic_2d_root/rosen/modules/effect/egl/include",
88    "$graphic_2d_root/utils/color_manager/export",
89    "//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
90    "//foundation/multimedia/image_framework/interfaces/innerkits/include/",
91  ]
92}
93
94group("test") {
95  testonly = true
96  deps = [ ":EffectTest" ]
97}
98