• 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")
16
17module_output_path = "graphic_2d/rosen/modules/2d_graphics/render_context"
18
19group("unittest") {
20  testonly = true
21
22  deps = [
23    ":2d_graphics_shader_cache_test",
24    ":RenderContextTest",
25  ]
26}
27
28## Build RenderContextTest
29ohos_unittest("RenderContextTest") {
30  module_out_path = module_output_path
31  sources = [ "render_context_test.cpp" ]
32  deps = [ ":render_context" ]
33
34  external_deps = [
35    "c_utils:utils",
36    "hilog:libhilog",
37  ]
38}
39
40## Build render_context.a {{{
41config("render_context_public_config") {
42  include_dirs =
43      [ "$graphic_2d_root/rosen/modules/2d_graphics/src/render_context" ]
44
45  cflags = [
46    "-Wall",
47    "-Werror",
48    "-g3",
49    "-Dprivate=public",
50    "-Dprotected=public",
51  ]
52}
53
54ohos_static_library("render_context") {
55  visibility = [ ":*" ]
56  testonly = true
57
58  public_configs = [ ":render_context_public_config" ]
59
60  public_deps = [
61    "$graphic_2d_root/rosen/modules/render_service_base:librender_service_base",
62    "//third_party/googletest:gtest_main",
63  ]
64  subsystem_name = "graphic"
65  part_name = "graphic_2d"
66}
67
68## Build render_context.a }}}
69
70ohos_unittest("2d_graphics_shader_cache_test") {
71  module_out_path = module_output_path
72
73  sources = [
74    "cache_data_test.cpp",
75    "shader_cache_test.cpp",
76  ]
77
78  include_dirs = [
79    "$graphic_2d_root/rosen/modules/2d_engine",
80    "$graphic_2d_root/rosen/modules/2d_graphics/src/render_context",
81    "$graphic_2d_root/rosen/modules/2d_graphics/include",
82  ]
83
84  if (defined(use_new_skia) && use_new_skia) {
85    include_dirs += [ "//third_party/skia/" ]
86  } else {
87    include_dirs += [ "//third_party/flutter/skia/" ]
88  }
89
90  deps = [
91    "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics",
92    "$graphic_2d_root/rosen/modules/render_service_base:librender_service_base",
93    "//third_party/googletest:gtest_main",
94  ]
95
96  external_deps = [ "hilog:libhilog" ]
97
98  defines = []
99  defines += gpu_defines
100
101  part_name = "graphic_2d"
102  subsystem_name = "graphic"
103}
104