From 7b831e00fa8827b760b22dad131c172121c8d6b7 Mon Sep 17 00:00:00 2001 From: yanansong Date: Thu, 15 Jun 2023 10:21:21 +0800 Subject: [PATCH 1/3] enable sandbox, libvsync --- build/gn/BUILD.gn | 1 + build/gn/fangtian.gni | 2 +- build/prebuild.sh | 4 +- .../inner_api/composer/vsync_receiver.h | 2 +- .../modules/composer/vsync/ft_build/BUILD.gn | 74 +++++++++++++++++++ .../utils/sandbox/ft_build/BUILD.gn | 26 +++++++ 6 files changed, 105 insertions(+), 4 deletions(-) create mode 100644 display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn create mode 100644 display_server/utils/sandbox/ft_build/BUILD.gn diff --git a/build/gn/BUILD.gn b/build/gn/BUILD.gn index 0301823..cc6bf28 100644 --- a/build/gn/BUILD.gn +++ b/build/gn/BUILD.gn @@ -14,5 +14,6 @@ group("ft_engine") { deps = [ "//display_server/utils/socketpair/ft_build:socketpair", + "//display_server/rosen/modules/composer/vsync/ft_build:libvsync", ] } diff --git a/build/gn/fangtian.gni b/build/gn/fangtian.gni index a345c67..e1b2f44 100755 --- a/build/gn/fangtian.gni +++ b/build/gn/fangtian.gni @@ -18,4 +18,4 @@ declare_args() { } -sys_inc = "/usr/include" +sys_inc = "/usr/local/include" diff --git a/build/prebuild.sh b/build/prebuild.sh index 91e0b3c..74fab2d 100755 --- a/build/prebuild.sh +++ b/build/prebuild.sh @@ -67,7 +67,7 @@ fi # copy prebuild library to /usr/lib64 ARCHNAME=`uname -m` cd ${PROJECT_DIR}/prebuilts/libs/library/${ARCHNAME} -sudo cp -fr *.so /usr/lib64 +sudo cp -fr *.so /usr/local/lib64 cd ${PROJECT_DIR} rm -fr ${PROJECT_DIR}/prebuilts/libs @@ -78,7 +78,7 @@ fi # copy include files to /usr/include. delete download files cd ${PROJECT_DIR}/prebuilts/inc -sudo cp -fr * /usr/include +sudo cp -fr * /usr/local/include cd ${PROJECT_DIR} rm -fr ${PROJECT_DIR}/prebuilts/inc diff --git a/display_server/interfaces/inner_api/composer/vsync_receiver.h b/display_server/interfaces/inner_api/composer/vsync_receiver.h index 848f17d..d1ed143 100644 --- a/display_server/interfaces/inner_api/composer/vsync_receiver.h +++ b/display_server/interfaces/inner_api/composer/vsync_receiver.h @@ -57,7 +57,7 @@ private: std::mutex mtx_; }; -#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__gnu_linux__) +#ifndef ROSEN_CROSS_PLATFORM class VSyncReceiver : public RefBase { public: // check diff --git a/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn b/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn new file mode 100644 index 0000000..7859b83 --- /dev/null +++ b/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn @@ -0,0 +1,74 @@ +# Copyright (c) 2023 Huawei Technologies Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/gn/fangtian.gni") + +config("vsync_config") { + visibility = [ ":*" ] + include_dirs = [ + "${sys_inc}/c_utils", + "${sys_inc}/ipc_core", + "${sys_inc}/eventhandler", + "${sys_inc}/hilog", + "//display_server/utils/log", + "//display_server/interfaces/inner_api/common", + "//display_server/rosen/modules/composer/vsync/include", + ] + cflags = [ + "-Wall", + "-Werror", + "-g3", + "-Wno-c++11-narrowing" + ] + libs = ["ipc_core", "eventhandler", "hilog", "utils"] +} + +config("vsync_public_config") { + include_dirs = [ + "//display_server/interfaces/inner_api/composer", + "//display_server/rosen/include/common", + "//display_server/rosen/modules/composer/vsync/include", + "//display_server/utils/sandbox", + "//display_server/utils/socketpair/export", + ] +} + +ft_shared_library("libvsync") { + sources = [ + "../src/vsync_connection_proxy.cpp", + "../src/vsync_connection_stub.cpp", + "../src/vsync_controller.cpp", + "../src/vsync_distributor.cpp", + "../src/vsync_generator.cpp", + "../src/vsync_receiver.cpp", + "../src/vsync_sampler.cpp", + ] + + configs = [ ":vsync_config" ] + + public_configs = [ + ":vsync_public_config", + ] + + deps = [ + "//display_server/utils/sandbox/ft_build:sandbox_utils", + "//display_server/utils/socketpair/ft_build:socketpair", + ] + + public_deps = [ + "//display_server/utils/scoped_bytrace/ft_build:scoped_bytrace", + ] + + part_name = "graphic_standard" + subsystem_name = "graphic" +} diff --git a/display_server/utils/sandbox/ft_build/BUILD.gn b/display_server/utils/sandbox/ft_build/BUILD.gn new file mode 100644 index 0000000..a8f8155 --- /dev/null +++ b/display_server/utils/sandbox/ft_build/BUILD.gn @@ -0,0 +1,26 @@ +# Copyright (c) 2023 Huawei Technologies Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/gn/fangtian.gni") + +config("sandbox_utils_config") { + include_dirs = [ "../." ] +} + +ft_static_library("sandbox_utils") { + sources = [ "../sandbox_utils.cpp" ] + public_configs = [ ":sandbox_utils_config" ] + + subsystem_name = "graphic" + part_name = "graphic_standard" +} -- Gitee From 9c3456e13249e6995a680dbeffa992424f691de3 Mon Sep 17 00:00:00 2001 From: yanansong Date: Fri, 16 Jun 2023 14:32:34 +0800 Subject: [PATCH 2/3] remove partname subsystem_name --- display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn | 3 --- display_server/utils/sandbox/BUILD.gn | 3 --- 2 files changed, 6 deletions(-) diff --git a/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn b/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn index 7859b83..f05185e 100644 --- a/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn +++ b/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn @@ -68,7 +68,4 @@ ft_shared_library("libvsync") { public_deps = [ "//display_server/utils/scoped_bytrace/ft_build:scoped_bytrace", ] - - part_name = "graphic_standard" - subsystem_name = "graphic" } diff --git a/display_server/utils/sandbox/BUILD.gn b/display_server/utils/sandbox/BUILD.gn index 3ac4a8d..d83d95b 100644 --- a/display_server/utils/sandbox/BUILD.gn +++ b/display_server/utils/sandbox/BUILD.gn @@ -20,7 +20,4 @@ config("sandbox_utils_config") { ohos_static_library("sandbox_utils") { sources = [ "sandbox_utils.cpp" ] public_configs = [ ":sandbox_utils_config" ] - - subsystem_name = "graphic" - part_name = "graphic_standard" } -- Gitee From 9053079a7da40e4cecd057912e6528f4bea1fac5 Mon Sep 17 00:00:00 2001 From: yanansong Date: Fri, 16 Jun 2023 14:33:38 +0800 Subject: [PATCH 3/3] sanbox remove subsystem partname --- display_server/utils/sandbox/BUILD.gn | 3 +++ display_server/utils/sandbox/ft_build/BUILD.gn | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/display_server/utils/sandbox/BUILD.gn b/display_server/utils/sandbox/BUILD.gn index d83d95b..3ac4a8d 100644 --- a/display_server/utils/sandbox/BUILD.gn +++ b/display_server/utils/sandbox/BUILD.gn @@ -20,4 +20,7 @@ config("sandbox_utils_config") { ohos_static_library("sandbox_utils") { sources = [ "sandbox_utils.cpp" ] public_configs = [ ":sandbox_utils_config" ] + + subsystem_name = "graphic" + part_name = "graphic_standard" } diff --git a/display_server/utils/sandbox/ft_build/BUILD.gn b/display_server/utils/sandbox/ft_build/BUILD.gn index a8f8155..d663f0c 100644 --- a/display_server/utils/sandbox/ft_build/BUILD.gn +++ b/display_server/utils/sandbox/ft_build/BUILD.gn @@ -20,7 +20,4 @@ config("sandbox_utils_config") { ft_static_library("sandbox_utils") { sources = [ "../sandbox_utils.cpp" ] public_configs = [ ":sandbox_utils_config" ] - - subsystem_name = "graphic" - part_name = "graphic_standard" } -- Gitee