• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-2025 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")
16
17if (!defined(graphic_2d_ext_feature_enable_ddgr) ||
18    !graphic_2d_ext_feature_enable_ddgr) {
19  module_output_path =
20      "graphic_2d/rosen/modules/2d_graphics/engine_adapter/skia_adapter"
21
22  ohos_unittest("2d_graphics_skia_canvas_test") {
23    module_out_path = module_output_path
24
25    sources = [
26      "../../../../modules/2d_graphics/src/drawing/engine_adapter/skia_adapter/skia_mask_filter.cpp",
27      "../../../../modules/2d_graphics/src/drawing/engine_adapter/skia_adapter/skia_picture.cpp",
28      "skia_bitmap_test.cpp",
29      "skia_canvas_autocache_test.cpp",
30      "skia_canvas_test.cpp",
31      "skia_color_filter_test.cpp",
32      "skia_color_space_test.cpp",
33      "skia_data_test.cpp",
34      "skia_font_mgr_test.cpp",
35      "skia_font_style_set_test.cpp",
36      "skia_font_test.cpp",
37      "skia_gpu_context_test.cpp",
38      "skia_helper_test.cpp",
39      "skia_hm_symbol_config_ohos_test.cpp",
40      "skia_hm_symbol_test.cpp",
41      "skia_image_filter_test.cpp",
42      "skia_image_info_test.cpp",
43      "skia_image_test.cpp",
44      "skia_mask_filter_test.cpp",
45      "skia_matrix44_test.cpp",
46      "skia_matrix_test.cpp",
47      "skia_memory_tracer_test.cpp",
48      "skia_paint_test.cpp",
49      "skia_path_effect_test.cpp",
50      "skia_path_test.cpp",
51      "skia_picture_test.cpp",
52      "skia_pixmap_test.cpp",
53      "skia_region_test.cpp",
54      "skia_runtime_blender_builder_test.cpp",
55      "skia_runtime_effect_test.cpp",
56      "skia_runtime_shader_builder_test.cpp",
57      "skia_shader_effect_test.cpp",
58      "skia_static_factory_test.cpp",
59      "skia_surface_test.cpp",
60      "skia_text_blob_test.cpp",
61      "skia_texture_info_test.cpp",
62      "skia_trace_memory_dump_test.cpp",
63      "skia_typeface_test.cpp",
64      "skia_vertices_test.cpp",
65    ]
66
67    include_dirs = [
68      "//third_party/googletest/googletest/include",
69      "$graphic_2d_root/rosen/modules/2d_graphics/include",
70      "$graphic_2d_root/rosen/modules/2d_graphics/src",
71      "$graphic_2d_root/rosen/modules/2d_graphics/src/drawing/engine_adapter",
72      "$graphic_2d_root/rosen/modules/2d_graphics/src/drawing",
73    ]
74
75    deps = [ "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics" ]
76
77    external_deps = [
78      "c_utils:utils",
79      "hilog:libhilog",
80      "image_framework:image_native",
81      "jsoncpp:jsoncpp",
82      "skia:skia_canvaskit",
83    ]
84
85    include_dirs += [
86      "//third_party/skia",
87      "//third_party/skia/include/",
88      "//third_party/skia/include/core/",
89      "//third_party/skia/third_party/externals/swiftshader/third_party/SPIRV-Headers/tools/buildHeaders/jsoncpp/dist/",
90    ]
91
92    if (rs_enable_gpu) {
93      defines = [ "RS_ENABLE_GPU" ]
94    }
95
96    cflags = [
97      "-Dprivate=public",
98      "-Dprotected=public",
99    ]
100
101    part_name = "graphic_2d"
102    subsystem_name = "graphic"
103  }
104
105  group("unittest") {
106    testonly = true
107
108    deps = [ ":2d_graphics_skia_canvas_test" ]
109  }
110}
111