1# Copyright (c) 2024 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 17config("export_config") { 18 include_dirs = [ "include" ] 19 cflags_cc = [ "-std=c++17" ] 20} 21 22ohos_source_set("graphics_effect_src") { 23 branch_protector_ret = "pac_ret" 24 sanitize = { 25 cfi = true 26 cfi_cross_dso = true 27 debug = false 28 } 29 cflags = [ 30 "-O2", 31 "-ftrapv", 32 "-FPIC", 33 "-FS", 34 "-D_FORTIFY_SOURCE=2", 35 ] 36 cflags_cc = [ 37 "-O2", 38 "-ftrapv", 39 "-FPIC", 40 "-FS", 41 "-D_FORTIFY_SOURCE=2", 42 ] 43 44 public_configs = [ ":export_config" ] 45 include_dirs = [ 46 "$graphic_2d_root/rosen/modules/graphics_effect/src", 47 "$graphic_2d_root/rosen/modules/utils", 48 "$graphic_2d_root/utils/color_manager/export", 49 ] 50 51 sources = [ 52 "src/ext/gex_dot_matrix_shader.cpp", 53 "src/ext/gex_flow_light_sweep_shader.cpp", 54 "src/ext/gex_marshalling_helper.cpp", 55 "src/ge_aibar_shader_filter.cpp", 56 "src/ge_external_dynamic_loader.cpp", 57 "src/ge_grey_shader_filter.cpp", 58 "src/ge_kawase_blur_shader_filter.cpp", 59 "src/ge_linear_gradient_blur_shader_filter.cpp", 60 "src/ge_magnifier_shader_filter.cpp", 61 "src/ge_mesa_blur_shader_filter.cpp", 62 "src/ge_render.cpp", 63 "src/ge_system_properties.cpp", 64 "src/ge_visual_effect.cpp", 65 "src/ge_visual_effect_container.cpp", 66 "src/ge_visual_effect_impl.cpp", 67 "src/ge_water_ripple_filter.cpp", 68 ] 69 70 deps = [ 71 "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics", 72 "$graphic_2d_root/rosen/modules/platform:utils", 73 ] 74 if (is_arkui_x) { 75 deps += [ 76 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${target_os}", 77 "//third_party/bounds_checking_function:libsec_static", 78 "//third_party/skia:skia_$target_os", 79 ] 80 external_deps = [ "hilog:libhilog" ] 81 } else { 82 external_deps = [ 83 "bounds_checking_function:libsec_static", 84 "hilog:libhilog", 85 "skia:skia_canvaskit", 86 ] 87 } 88 89 defines = [] 90 if (current_os == "ohos") { 91 defines += [ "GE_OHOS" ] 92 external_deps += [ "init:libbegetutil" ] 93 } 94 95 if (is_mingw || is_win) { 96 defines += [ "GE_PLATFORM_WIN" ] 97 } else { 98 defines += [ "GE_PLATFORM_UNIX" ] 99 } 100 101 part_name = "graphic_2d" 102 subsystem_name = "graphic" 103} 104 105if (is_arkui_x) { 106 ohos_source_set("libgraphics_effect") { 107 branch_protector_ret = "pac_ret" 108 sanitize = { 109 cfi = true 110 cfi_cross_dso = true 111 debug = false 112 } 113 114 public_deps = [ ":graphics_effect_src" ] 115 deps = [ 116 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${target_os}", 117 "//third_party/bounds_checking_function:libsec_static", 118 "//third_party/skia:skia_$target_os", 119 ] 120 121 part_name = "graphic_2d" 122 subsystem_name = "graphic" 123 } 124} else { 125 ohos_shared_library("libgraphics_effect") { 126 branch_protector_ret = "pac_ret" 127 sanitize = { 128 cfi = true 129 cfi_cross_dso = true 130 debug = false 131 } 132 133 public_deps = [ ":graphics_effect_src" ] 134 external_deps = [ 135 "bounds_checking_function:libsec_static", 136 "hilog:libhilog", 137 "skia:skia_canvaskit", 138 ] 139 140 part_name = "graphic_2d" 141 subsystem_name = "graphic" 142 } 143} 144