• 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/frameworks/text/config.gni")
16import("//foundation/graphic/graphic_2d/graphic_config.gni")
17
18module_output_path = "graphic_2d/graphic_2d/rosen/modules/2d_graphics/ndk/"
19
20ohos_unittest("2d_graphics_ndk_test") {
21  module_out_path = module_output_path
22
23  defines = []
24  sources = [
25    "drawing_bitmap_test.cpp",
26    "drawing_brush_test.cpp",
27    "drawing_canvas_test.cpp",
28    "drawing_color_space_test.cpp",
29    "drawing_color_test.cpp",
30    "drawing_error_code_test.cpp",
31    "drawing_gpu_context_test.cpp",
32    "drawing_image_test.cpp",
33    "drawing_matrix_test.cpp",
34    "drawing_memory_stream_test.cpp",
35    "drawing_path_effect_test.cpp",
36    "drawing_path_test.cpp",
37    "drawing_pen_test.cpp",
38    "drawing_pixel_map_test.cpp",
39    "drawing_point_test.cpp",
40    "drawing_record_cmd_test.cpp",
41    "drawing_rect_test.cpp",
42    "drawing_region_test.cpp",
43    "drawing_round_rect_test.cpp",
44    "drawing_sampling_options_test.cpp",
45    "drawing_shader_effect_test.cpp",
46    "drawing_surface_test.cpp",
47    "drawing_typeface_test.cpp",
48    "drawing_font_test.cpp",
49  ]
50
51  include_dirs = [
52    "$graphic_2d_root/rosen/frameworks/text/service",
53    "$graphic_2d_root/rosen/modules/2d_graphics/drawing_ndk/drawing_utils",
54    "$graphic_2d_root/rosen/modules/2d_graphics/drawing_ndk/include",
55    "$graphic_2d_root/rosen/modules/2d_graphics/drawing_ndk/src",
56    "$graphic_2d_root/rosen/modules/2d_graphics/src",
57    "$graphic_2d_root/rosen/modules/2d_graphics/src/drawing/engine_adapter",
58    "$graphic_2d_root/rosen/modules/render_service_client",
59    "$graphic_2d_root/rosen/modules/render_service_base/src",
60    "$rosen_text_root/service/texgine/src",
61    "$graphic_2d_root/interfaces/inner_api/color_manager",
62  ]
63
64  cflags_cc = [
65    "-std=c++17",
66    "-Dprivate=public",
67    "-Dprotected=public",
68  ]
69
70  if (enable_text_gine) {
71    include_dirs += [
72      "$rosen_text_root/interface/export",
73      "$rosen_text_root/adapter/skia",
74      "$graphic_2d_root/rosen/modules/render_service_base/include",
75    ]
76  } else {
77    include_dirs += [ "$graphic_2d_root/rosen/modules/2d_engine" ]
78  }
79
80  defines += gpu_defines
81
82  deps = [
83    "$graphic_2d_root/frameworks/opengl_wrapper:EGL",
84    "$graphic_2d_root/frameworks/opengl_wrapper:GLESv3",
85    "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics",
86    "$graphic_2d_root/rosen/modules/2d_graphics/drawing_ndk:native_drawing_ndk",
87    "$graphic_2d_root/rosen/modules/render_service_base:librender_service_base",
88    "$graphic_2d_root/rosen/modules/render_service_client:librender_service_client",
89    "$rosen_text_root:rosen_text",
90    "$graphic_2d_root/utils/color_manager/ndk:libnative_color_space_manager",
91  ]
92
93  subsystem_name = "graphic"
94  external_deps = [
95    "bundle_framework:appexecfwk_base",
96    "bundle_framework:appexecfwk_core",
97    "c_utils:utils",
98    "eventhandler:libeventhandler",
99    "graphic_surface:surface_headers",
100    "hilog:libhilog",
101    "image_framework:pixelmap",
102    "openssl:libcrypto_shared",
103  ]
104
105  platform = current_os
106  if (platform == "ohos" || platform == "ohos_ng") {
107    defines += [ "ENABLE_OHOS_ENHANCE" ]
108  }
109}
110
111group("unittest") {
112  testonly = true
113
114  deps = [ ":2d_graphics_ndk_test" ]
115}
116