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") 16import("//foundation/graphic/graphic_2d/rosen/modules/effect/effect_config.gni") 17 18## Build libeffectchain.so 19 20config("effect_config") { 21 cflags = [ 22 "-Wall", 23 "-Werror", 24 "-g3", 25 "-Wall", 26 "-Wno-pointer-arith", 27 "-Wno-non-virtual-dtor", 28 "-Wno-missing-field-initializers", 29 "-Wno-c++11-narrowing", 30 ] 31 defines = [ "EGL_EGLEXT_PROTOTYPES" ] 32} 33 34config("effect_public_config") { 35 include_dirs = [ 36 "$graphic_2d_root/utils/log", 37 "include", 38 ] 39} 40 41ohos_shared_library("libeffectchain") { 42 sources = [ "//third_party/cJSON/cJSON.c" ] 43 44 external_deps = [ 45 "cJSON:cjson", 46 "hilog:libhilog", 47 "hitrace:hitrace_meter", 48 "image_framework:image_native", 49 ] 50 51 if (effect_enable_gpu) { 52 sources += [ 53 "src/algo_filter.cpp", 54 "src/brightness_filter.cpp", 55 "src/contrast_filter.cpp", 56 "src/filter.cpp", 57 "src/filter_factory.cpp", 58 "src/gaussian_blur_filter.cpp", 59 "src/horizontal_blur_filter.cpp", 60 "src/image_chain.cpp", 61 "src/input.cpp", 62 "src/mesh.cpp", 63 "src/output.cpp", 64 "src/program.cpp", 65 "src/saturation_filter.cpp", 66 "src/scale_filter.cpp", 67 "src/vertical_blur_filter.cpp", 68 ] 69 70 deps = [ 71 "$graphic_2d_root/frameworks/opengl_wrapper:EGL", 72 "$graphic_2d_root/frameworks/opengl_wrapper:GLESv3", 73 ] 74 } 75 76 configs = [ ":effect_config" ] 77 78 public_configs = [ ":effect_public_config" ] 79 80 public_external_deps = [ "c_utils:utils" ] 81 82 cflags_cc = [ "-std=c++17" ] 83 84 if (effect_enable_gpu) { 85 install_enable = true 86 } else { 87 install_enable = false 88 } 89 90 part_name = "graphic_2d" 91 subsystem_name = "graphic" 92} 93