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