• 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  source_set(target_name) {
22    defines += invoker.defines
23
24    # add common source file needed by all product platform here
25    sources = [
26      # context
27      "pipeline_base.cpp",
28      "pipeline_context.cpp",
29
30      # base component
31      "base/component.cpp",
32      "base/component_group_element.cpp",
33      "base/composed_component.cpp",
34      "base/composed_element.cpp",
35      "base/constants.cpp",
36      "base/element.cpp",
37      "base/element_register.cpp",
38      "base/flutter_render_context.cpp",
39      "base/multi_composed_component.cpp",
40      "base/multi_composed_element.cpp",
41      "base/related_node.cpp",
42      "base/render_context_creator.cpp",
43      "base/render_element.cpp",
44      "base/render_node.cpp",
45      "base/sole_child_element.cpp",
46
47      # factories
48      "base/factories/render_node_factory.cpp",
49
50      # layer
51      "layers/clip_layer.cpp",
52      "layers/container_layer.cpp",
53      "layers/dropfilter_layer.cpp",
54      "layers/flutter_scene_builder.cpp",
55      "layers/gradient_layer.cpp",
56      "layers/hole_layer.cpp",
57      "layers/layer.cpp",
58      "layers/offset_layer.cpp",
59      "layers/opacity_layer.cpp",
60      "layers/picture_layer.cpp",
61      "layers/texture_layer.cpp",
62      "layers/transform_layer.cpp",
63    ]
64
65    configs += [ "$ace_root:ace_config" ]
66
67    deps = [
68      "$ace_flutter_engine_root:third_party_flutter_engine_$platform",
69      "$ace_flutter_engine_root/skia:ace_skia_$platform",
70      "$ace_root/frameworks/core/components/theme:build_theme_code",
71    ]
72
73    if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) {
74      sources += [ "base/rosen_render_context.cpp" ]
75      deps += [ "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client" ]
76    }
77
78    if (platform == "ohos" && defined(config.enable_native_view) &&
79        config.enable_native_view) {
80      sources += [ "layers/ace_scene_builder.cpp" ]
81      deps += [ "$ace_flutter_engine_root/ohos_layers:flutter_ohos_layers" ]
82    }
83
84    cflags_cc = []
85    cflags_cc += invoker.cflags_cc
86  }
87}
88
89foreach(item, ace_platforms) {
90  ace_core_pipeline_source_set("ace_core_pipeline_" + item.name) {
91    platform = item.name
92
93    if (defined(item.config)) {
94      config = item.config
95    } else {
96      config = {
97      }
98    }
99
100    if (defined(config.defines)) {
101      defines = config.defines
102    } else {
103      defines = []
104    }
105
106    if (defined(config.cflags_cc)) {
107      cflags_cc = config.cflags_cc
108    } else {
109      cflags_cc = []
110    }
111  }
112}
113