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