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/ohos.gni") 15import("//foundation/graphic/graphic_2d/graphic_config.gni") 16 17## Build libskeffectchain.so 18 19config("effect_SKeffectChian_config") { 20 cflags = [ 21 "-Wall", 22 "-Werror", 23 "-g3", 24 "-Wall", 25 "-Wno-pointer-arith", 26 "-Wno-non-virtual-dtor", 27 "-Wno-missing-field-initializers", 28 "-Wno-c++11-narrowing", 29 ] 30 if (target_os == "ios") { 31 cflags += ["-Wno-ignored-qualifiers"] 32 } 33 34 include_dirs = [ 35 "$graphic_2d_root/rosen/modules/render_service_base/include", 36 "$graphic_2d_root/rosen/modules/render_service_base/src", 37 "$graphic_2d_root/rosen/modules/effect/color_picker/include", 38 ] 39 40 if (!defined(defines)) { 41 defines = [] 42 } 43 if (rs_enable_gpu) { 44 defines += [ "RS_ENABLE_GPU" ] 45 } 46} 47 48config("effect_SKeffectChian_public_config") { 49 include_dirs = [ 50 "../egl/include", 51 "$graphic_2d_root/utils/log", 52 "include", 53 "$graphic_2d_root/rosen/modules/2d_graphics", 54 ] 55 56 if (is_arkui_x) { 57 include_dirs += [ 58 "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include", 59 "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/src", 60 "//foundation/multimedia/image_framework/interfaces/innerkits/include", 61 "//foundation/graphic/graphic_2d/utils/color_manager/export", 62 "//base/hiviewdfx/hilog/interfaces/native/innerkits", 63 "//foundation/graphic/graphics_effect/include", 64 "//foundation/graphic/graphic_surface/interfaces/inner_api/surface", 65 ] 66 } 67} 68if (is_arkui_x) { 69 ohos_source_set("skeffectchain") { 70 public_deps = [ 71 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${target_os}", 72 "//foundation/arkui/ace_engine/adapter/${target_os}/build:libarkui_${target_os}", 73 "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics", 74 ] 75 76 if (target_os == "android") { 77 defines = [ "ANDROID_PLATFORM" ] 78 } else if (target_os == "ios") { 79 defines = [ "IOS_PLATFORM" ] 80 } 81 82 if (target_os == "android") { 83 public_deps += 84 [ "$graphic_2d_root/rosen/modules/effect/egl:libegl_effect" ] 85 86 if (rs_enable_gpu) { 87 defines += [ "RS_ENABLE_GPU" ] 88 defines += gpu_defines 89 public_deps += [ 90 "$graphic_2d_root/frameworks/opengl_wrapper:EGL", 91 "$graphic_2d_root/frameworks/opengl_wrapper:GLESv3", 92 ] 93 } 94 } 95 96 public_external_deps = [ 97 "c_utils:utilsbase", 98 "skia:skia_canvaskit_static", 99 ] 100 101 deps = [ 102 "$graphic_2d_root/rosen/modules/render_service_base:librender_service_base_static", 103 ] 104 105 sources = [ 106 "src/effect_image_chain.cpp", 107 "src/effect_image_render.cpp", 108 "src/sk_image_chain.cpp", 109 "src/sk_image_filter_factory.cpp", 110 ] 111 112 if (rs_enable_gpu) { 113 if (graphic_2d_feature_enable_vulkan) { 114 sources += [ 115 "src/effect_vulkan_context.cpp", 116 ] 117 } 118 } 119 120 configs = [ ":effect_SKeffectChian_config" ] 121 122 public_configs = [ ":effect_SKeffectChian_public_config" ] 123 124 cflags_cc = [ "-std=c++17" ] 125 126 part_name = "graphic_2d" 127 subsystem_name = "graphic" 128 } 129} else { 130 ohos_shared_library("skeffectchain") { 131 public_deps = [ 132 "$graphic_2d_root/rosen/modules/effect/egl:libegl_effect", 133 "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics", 134 ] 135 136 if (rs_enable_gpu) { 137 defines = gpu_defines 138 public_deps += [ 139 "$graphic_2d_root/frameworks/opengl_wrapper:EGL", 140 "$graphic_2d_root/frameworks/opengl_wrapper:GLESv3", 141 ] 142 } 143 144 public_external_deps = [ 145 "graphic_surface:surface", 146 "skia:skia_canvaskit", 147 ] 148 149 external_deps = [ 150 "c_utils:utils", 151 "graphics_effect:graphics_effect_core", 152 "hilog:libhilog", 153 "hitrace:hitrace_meter", 154 "image_framework:image", 155 "image_framework:image_native", 156 "image_framework:pixelconvertadapter", 157 "init:libbegetutil", 158 "ipc:ipc_core", 159 "napi:ace_napi", 160 "samgr:samgr_proxy", 161 ] 162 163 sources = [ 164 "src/effect_image_chain.cpp", 165 "src/effect_image_render.cpp", 166 "src/sk_image_chain.cpp", 167 "src/sk_image_filter_factory.cpp", 168 ] 169 if (rs_enable_gpu) { 170 if (graphic_2d_feature_enable_vulkan) { 171 sources += [ 172 "src/effect_vulkan_context.cpp", 173 ] 174 } 175 } 176 177 configs = [ ":effect_SKeffectChian_config" ] 178 179 public_configs = [ ":effect_SKeffectChian_public_config" ] 180 181 deps = [ 182 "$graphic_2d_root/rosen/modules/render_service_base:librender_service_base", 183 ] 184 185 cflags_cc = [ "-std=c++17" ] 186 187 install_enable = true 188 part_name = "graphic_2d" 189 subsystem_name = "graphic" 190 } 191} 192