• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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/ohos.gni")
15import("//foundation/arkui/ace_engine/ace_config.gni")
16
17# build core sources
18template("ace_core_pipeline_source_set") {
19  forward_variables_from(invoker, "*")
20
21  ohos_source_set(target_name) {
22    subsystem_name = ace_engine_subsystem
23    part_name = ace_engine_part
24    if (current_os == "ohos") {
25      sanitize = {
26        integer_overflow = true
27        boundary_sanitize = true
28        debug = ace_sanitize_debug
29      }
30    }
31    defines += invoker.defines
32
33    # add common source file needed by all product platform here
34    sources = [
35      # context
36      "pipeline_base.cpp",
37      "pipeline_context.cpp",
38
39      # base component
40      "base/component.cpp",
41      "base/component_group_element.cpp",
42      "base/composed_component.cpp",
43      "base/composed_element.cpp",
44      "base/constants.cpp",
45      "base/element.cpp",
46      "base/element_register.cpp",
47      "base/multi_composed_component.cpp",
48      "base/multi_composed_element.cpp",
49      "base/related_node.cpp",
50      "base/render_context_creator.cpp",
51      "base/render_element.cpp",
52      "base/render_node.cpp",
53      "base/sole_child_element.cpp",
54
55      # factories
56      "base/factories/render_node_factory.cpp",
57    ]
58
59    if (!ace_use_new_skia) {
60      sources += [
61        "base/flutter_render_context.cpp",
62
63        # layer
64        "layers/clip_layer.cpp",
65        "layers/container_layer.cpp",
66        "layers/dropfilter_layer.cpp",
67        "layers/flutter_scene_builder.cpp",
68        "layers/gradient_layer.cpp",
69        "layers/hole_layer.cpp",
70        "layers/layer.cpp",
71        "layers/offset_layer.cpp",
72        "layers/opacity_layer.cpp",
73        "layers/picture_layer.cpp",
74        "layers/texture_layer.cpp",
75        "layers/transform_layer.cpp",
76      ]
77    }
78
79    configs = [ "$ace_root:ace_config" ]
80
81    deps = [ "$ace_root/frameworks/core/components/theme:build_theme_code" ]
82    external_deps = []
83    if (ace_use_new_skia) {
84      deps += [
85        "$ace_flutter_engine_root/libtxt:thirdparty_lib_txt_$platform",
86        "$skia_root_new:skia_$platform",
87      ]
88      configs += [ "$ace_flutter_engine_root:flutter_config" ]
89    } else {
90      deps += [
91        "$ace_flutter_engine_root:third_party_flutter_engine_$platform",
92        "$ace_flutter_engine_root/skia:ace_skia_$platform",
93      ]
94    }
95
96    if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) {
97      sources += [ "base/rosen_render_context.cpp" ]
98      if (is_arkui_x) {
99        deps += [ "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client_static" ]
100      } else {
101        external_deps += [ "graphic_2d:librender_service_client" ]
102        if (ace_use_rosen_drawing) {
103          external_deps += [ "graphic_2d:2d_graphics" ]
104        }
105      }
106    }
107
108    if (platform == "ohos" && defined(config.enable_native_view) &&
109        config.enable_native_view) {
110      sources += [ "layers/ace_scene_builder.cpp" ]
111      deps += [ "$ace_flutter_engine_root/ohos_layers:flutter_ohos_layers" ]
112    }
113
114    cflags_cc = []
115    cflags_cc += invoker.cflags_cc
116  }
117}
118
119foreach(item, ace_platforms) {
120  ace_core_pipeline_source_set("ace_core_pipeline_" + item.name) {
121    platform = item.name
122
123    if (defined(item.config)) {
124      config = item.config
125    } else {
126      config = {
127      }
128    }
129
130    if (defined(config.defines)) {
131      defines = config.defines
132    } else {
133      defines = []
134    }
135
136    if (defined(config.cflags_cc)) {
137      cflags_cc = config.cflags_cc
138    } else {
139      cflags_cc = []
140    }
141  }
142}
143