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/ge_aibar_shader_filter.cpp", 53 "src/ge_grey_shader_filter.cpp", 54 "src/ge_kawase_blur_shader_filter.cpp", 55 "src/ge_linear_gradient_blur_shader_filter.cpp", 56 "src/ge_magnifier_shader_filter.cpp", 57 "src/ge_mesa_blur_shader_filter.cpp", 58 "src/ge_render.cpp", 59 "src/ge_system_properties.cpp", 60 "src/ge_visual_effect.cpp", 61 "src/ge_visual_effect_container.cpp", 62 "src/ge_visual_effect_impl.cpp", 63 "src/ge_water_ripple_filter.cpp", 64 ] 65 66 deps = [ "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics" ] 67 if (is_arkui_x) { 68 deps += [ 69 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${target_os}", 70 "//third_party/bounds_checking_function:libsec_static", 71 "//third_party/skia:skia_$target_os", 72 ] 73 external_deps = [ "hilog:libhilog" ] 74 } else { 75 external_deps = [ 76 "bounds_checking_function:libsec_static", 77 "hilog:libhilog", 78 "skia:skia_canvaskit", 79 ] 80 } 81 82 if (current_os == "ohos") { 83 defines = [ "GE_OHOS" ] 84 external_deps += [ "init:libbegetutil" ] 85 } 86 87 part_name = "graphic_2d" 88 subsystem_name = "graphic" 89} 90 91if (is_arkui_x) { 92 ohos_source_set("libgraphics_effect") { 93 branch_protector_ret = "pac_ret" 94 sanitize = { 95 cfi = true 96 cfi_cross_dso = true 97 debug = false 98 } 99 100 public_deps = [ ":graphics_effect_src" ] 101 deps = [ 102 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${target_os}", 103 "//third_party/bounds_checking_function:libsec_static", 104 "//third_party/skia:skia_$target_os", 105 ] 106 107 part_name = "graphic_2d" 108 subsystem_name = "graphic" 109 } 110} else { 111 ohos_shared_library("libgraphics_effect") { 112 branch_protector_ret = "pac_ret" 113 sanitize = { 114 cfi = true 115 cfi_cross_dso = true 116 debug = false 117 } 118 119 public_deps = [ ":graphics_effect_src" ] 120 external_deps = [ 121 "bounds_checking_function:libsec_static", 122 "hilog:libhilog", 123 "skia:skia_canvaskit", 124 ] 125 126 part_name = "graphic_2d" 127 subsystem_name = "graphic" 128 } 129} 130