• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 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/config/components/ets_frontend/ets2abc_config.gni")
15import("//build/ohos.gni")
16import("//foundation/graphic/graphic_2d/graphic_config.gni")
17
18group("ani_drawing") {
19  deps = [
20    ":drawing_ani",
21    ":drawing_ets",
22    ":drawing_ani_core",
23  ]
24}
25
26config("drawing_ani_config") {
27  include_dirs = [
28    "$graphic_2d_root/interfaces/kits/ani/drawing",
29  ]
30  defines = [
31    "ROSEN_OHOS"
32  ]
33}
34
35config("graphic_ani_drawing_config") {
36  visibility = [ ":*" ]
37  defines = []
38  include_dirs = [
39    ".",
40    "$graphic_2d_root/rosen/modules/2d_graphics/include",
41    "$graphic_2d_root/rosen/modules/2d_graphics/src",
42    "$graphic_2d_root/rosen/modules/2d_graphics/src/drawing/engine_adapter",
43  ]
44
45  cflags = [
46    "-Wall",
47    "-Werror",
48    "-g3",
49    "-Wno-pointer-arith",
50    "-Wno-non-virtual-dtor",
51    "-Wno-missing-field-initializers",
52    "-Wno-c++11-narrowing",
53    "-Wno-unused-but-set-variable",
54  ]
55
56  if (current_os == "ohos" || current_os == "ohos_ng") {
57    defines += [ "ROSEN_OHOS" ]
58  }
59}
60
61ohos_shared_library("drawing_ani_core") {
62  branch_protector_ret = "pac_ret"
63
64  sanitize = {
65    cfi = true
66    cfi_cross_dso = true
67    cfi_vcall_icall_only = true
68    debug = false
69  }
70
71  public_configs = [
72    ":drawing_ani_config",
73    "$graphic_2d_root/rosen/modules/2d_graphics:export_config",
74  ]
75
76  configs = [
77    ":graphic_ani_drawing_config",
78  ]
79
80  sources = [ "ani_drawing_module.cpp" ]
81
82  deps = [
83    "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics",
84    ":drawing_ani",
85  ]
86
87  external_deps = [
88    "c_utils:utils",
89    "hilog:libhilog",
90    "image_framework:image_taihe",
91    "ipc:ipc_single",
92    "runtime_core:ani",
93    "runtime_core:libarkruntime",
94  ]
95
96  public_external_deps = [
97    "image_framework:image",
98  ]
99
100  part_name = "graphic_2d"
101  subsystem_name = "graphic"
102  output_extension = "so"
103}
104
105generate_static_abc("drawing") {
106  base_url = "./ets"
107  files = [
108    "ets/@ohos.graphics.common2D.ets",
109    "ets/@ohos.graphics.drawing.ets",
110  ]
111  is_boot_abc = "True"
112  device_dst_file = "/system/framework/drawing.abc"
113}
114
115generate_static_abc("drawing_test") {
116  base_url = "./ets"
117  files = [
118    "ets/drawing_test.ets"
119  ]
120  is_boot_abc = "True"
121  device_dst_file = "/system/framework/drawing_test.abc"
122}
123
124ohos_prebuilt_etc("drawing_ets") {
125  source = "$target_out_dir/drawing.abc"
126  module_install_dir = "framework"
127  subsystem_name = "graphic"
128  part_name = "graphic_2d"
129  deps = [
130    ":drawing",
131  ]
132}
133
134ohos_shared_library("drawing_ani") {
135  branch_protector_ret = "pac_ret"
136
137  sanitize = {
138    cfi = true
139    cfi_cross_dso = true
140    cfi_vcall_icall_only = true
141    debug = false
142  }
143
144  public_configs = [
145    ":drawing_ani_config",
146    "$graphic_2d_root/rosen/modules/2d_graphics:export_config",
147  ]
148
149  configs = [
150    ":graphic_ani_drawing_config",
151  ]
152  sources = [
153    "ani_drawing_utils.cpp",
154    "lattice_ani/ani_lattice.cpp",
155    "matrix_ani/ani_matrix.cpp",
156    "path_iterator_ani/ani_path_iterator.cpp",
157    "path_ani/ani_path.cpp",
158    "region_ani/ani_region.cpp",
159    "round_rect_ani/ani_round_rect.cpp",
160    "brush_ani/ani_brush.cpp",
161    "canvas_ani/ani_canvas.cpp",
162    "color_filter_ani/ani_color_filter.cpp",
163    "font_ani/ani_font.cpp",
164    "pen_ani/ani_pen.cpp",
165    "sampling_options_ani/ani_sampling_options.cpp",
166    "typeface_ani/ani_typeface.cpp",
167    "typeface_arguments_ani/ani_typeface_arguments.cpp",
168  ]
169
170  deps = [
171    "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics",
172  ]
173
174  external_deps = [
175    "c_utils:utils",
176    "hilog:libhilog",
177    "image_framework:image_taihe",
178    "ipc:ipc_single",
179    "runtime_core:ani",
180    "runtime_core:libarkruntime",
181  ]
182
183  public_external_deps = [
184    "image_framework:image",
185  ]
186
187  part_name = "graphic_2d"
188  subsystem_name = "graphic"
189  output_extension = "so"
190}