diff --git a/build/gn/BUILD.gn b/build/gn/BUILD.gn index 1b2c4173290c04c9997896d630ca845b00f0de3e..f3a53d255ac34273b5fff077085fa1b0cc211350 100644 --- a/build/gn/BUILD.gn +++ b/build/gn/BUILD.gn @@ -21,6 +21,7 @@ group("ft_engine") { "//display_server/rosen/modules/render_service_base/ft_build:librender_service_base", "//display_server/drivers/hdi_service/gralloc/client:hdi_gralloc_client", "//display_server/rosen/modules/composer/ft_build:libcomposer", + "//display_server/rosen/modules/render_service_client/ft_build:librender_service_client", "//window_manager/utils/ft_build:libwmutil", "//window_manager/dm/ft_build:libdm", diff --git a/build/gn/configs/system_libs/BUILD.gn b/build/gn/configs/system_libs/BUILD.gn index 5b3ccc8c5e3742ef2026278667c2cce9b9ec485f..c3b9cbca3a97b40b190b9788e4a47b4268e32c2f 100644 --- a/build/gn/configs/system_libs/BUILD.gn +++ b/build/gn/configs/system_libs/BUILD.gn @@ -55,3 +55,8 @@ config("mmi_config") { include_dirs = [ "${sys_inc}/mmi" ] libs = [ "mmi-client" ] } + +config("syspara_config") { + include_dirs = [ "${sys_inc}/syspara" ] + libs = [ "beget_proxy", "begetutil" ] +} 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 f05185ec23f9c52612897726613fc6dfd0b6a1b6..c233ffec403906e1fcf680f698e752b951af6c22 100644 --- a/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn +++ b/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn @@ -12,17 +12,18 @@ # limitations under the License. import("//build/gn/fangtian.gni") +import("//display_server/ft_configs/ds_config.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", + "$display_server_root/utils/log", + "$display_server_root/interfaces/inner_api/common", + "$rosen_root/modules/composer/vsync/include", + "$display_server_root/interfaces/inner_api/composer", + "$rosen_root/include/common", + "$display_server_root/utils/sandbox", + "$display_server_root/utils/socketpair/export", ] cflags = [ "-Wall", @@ -30,16 +31,11 @@ config("vsync_config") { "-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", + "$rosen_root/modules/composer/vsync/include", ] } @@ -54,7 +50,13 @@ ft_shared_library("libvsync") { "../src/vsync_sampler.cpp", ] - configs = [ ":vsync_config" ] + configs = [ + ":vsync_config", + "//build/gn/configs/system_libs:eventhandler_config", + "//build/gn/configs/system_libs:ipc_core_config", + "//build/gn/configs/system_libs:c_utils_config", + "//build/gn/configs/system_libs:hilog_config", + ] public_configs = [ ":vsync_public_config", diff --git a/display_server/rosen/modules/frame_analyzer/ft_build/BUILD.gn b/display_server/rosen/modules/frame_analyzer/ft_build/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..131082ad284c6d8fef7185b2d03a893347f2e82f --- /dev/null +++ b/display_server/rosen/modules/frame_analyzer/ft_build/BUILD.gn @@ -0,0 +1,55 @@ +# Copyright (c) 2021 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") +import("//display_server/ft_configs/ds_config.gni") + +config("libframe_analyzer_config") { + visibility = [ ":*" ] + + cflags = [ + "-Wall", + "-Werror", + "-g3", + "-Wno-c++11-narrowing", + ] +} + +config("libframe_analyzer_public_config") { + include_dirs = [ "../export" ] +} + +ft_shared_library("libframe_analyzer") { + sources = [ + "../src/frame_collector.cpp", + "../src/frame_painter.cpp", + "../src/frame_saver.cpp", + ] + + include_dirs = [ "//foundation/graphic/graphic_2d/utils/sandbox" ] + + deps = [ + "$display_server_root/utils/sandbox/ft_build:sandbox_utils", + ] + + configs = [ + ":libframe_analyzer_config", + "//build/gn/configs/system_libs:hitrace_meter_config", + "//build/gn/configs/system_libs:hilog_config", + "//build/gn/configs/system_libs:c_utils_config", + "//build/gn/configs/system_libs:skia_config", + "//build/gn/configs/system_libs:syspara_config", + ] + + public_configs = [ ":libframe_analyzer_public_config" ] +} diff --git a/display_server/rosen/modules/frame_analyzer/src/frame_saver.cpp b/display_server/rosen/modules/frame_analyzer/src/frame_saver.cpp index 7046e2b257cd4b83218f472f10ec7781d4443018..501275fd6358c2b236ffacff79dcb4645a48e9b0 100644 --- a/display_server/rosen/modules/frame_analyzer/src/frame_saver.cpp +++ b/display_server/rosen/modules/frame_analyzer/src/frame_saver.cpp @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include #include diff --git a/display_server/rosen/modules/render_frame_trace/ft_build/BUILD.gn b/display_server/rosen/modules/render_frame_trace/ft_build/BUILD.gn index f93cb9aca9a7de4358689a53c6ae612f0f118d89..a55d203465f46b1a7f04a5d8dae9d68c14440d13 100644 --- a/display_server/rosen/modules/render_frame_trace/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_frame_trace/ft_build/BUILD.gn @@ -17,4 +17,4 @@ ft_source_set("render_frame_trace") { include_dirs = [ "../include" ] sources = [ "../src/render_frame_trace.cpp" ] cflags = [ "-fstack-protector-all" ] -} \ No newline at end of file +} diff --git a/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn b/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn index b076446b7fc7189fc02fb9ba24512fb9fd2bc6be..3048b31176b0060ffd7d1c06a9a2032a552c73ed 100644 --- a/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn +++ b/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn @@ -46,6 +46,7 @@ ft_source_set("rosen_fangtian_sources") { #backend "backend/rs_surface_frame_raster.cpp", "backend/rs_surface_raster.cpp", + "rs_accessibility.cpp", "rs_ashmem_helper.cpp", #overdraw @@ -93,9 +94,8 @@ ft_source_set("rosen_fangtian_sources") { "$rosen_root/modules/render_service_base/src/platform/fangtian/include", "$rosen_root/modules/platform/image_native", "$rosen_root/modules/render_service_base/src", - "//utils/system/safwk/native/include", - "//drivers/peripheral/display/interfaces/include/", "$display_server_root/utils/log", + "$display_server_root/interfaces/inner_api/composer", ] deps = [ @@ -103,6 +103,7 @@ ft_source_set("rosen_fangtian_sources") { "$rosen_root/modules/composer/vsync/ft_build:libvsync", "$display_server_root/utils/sync_fence/ft_build:sync_fence", "$display_server_root/utils/buffer_handle/ft_build:buffer_handle", + "$display_server_root/utils/sandbox/ft_build:sandbox_utils", ] if (rs_enable_gpu) { diff --git a/display_server/rosen/modules/render_service_base/src/platform/fangtian/rs_accessibility.cpp b/display_server/rosen/modules/render_service_base/src/platform/fangtian/rs_accessibility.cpp index 0b7063fc7fb545bdb6c717ae8dbddf683d57da00..20f0bf0b37b71abdc1a5b69df77efc2a08e760fd 100644 --- a/display_server/rosen/modules/render_service_base/src/platform/fangtian/rs_accessibility.cpp +++ b/display_server/rosen/modules/render_service_base/src/platform/fangtian/rs_accessibility.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Technologies Co., Ltd. + * 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 @@ -15,65 +15,21 @@ #include "platform/common/rs_accessibility.h" -#include "accessibility_config.h" -#include "platform/common/rs_log.h" - -using namespace OHOS::AccessibilityConfig; - namespace OHOS { namespace Rosen { -class RSAccessibilityOHOS : public RSAccessibility { +class RSAccessibilityFangTian : public RSAccessibility { public: - static RSAccessibilityOHOS &GetInstance(); void ListenHighContrastChange(OnHighContrastChange callback) override; - -private: - class Observer : public AccessibilityConfigObserver { - public: - virtual void OnConfigChanged(const CONFIG_ID id, const ConfigValue &value) override; - }; - - void ListenHighContrast(); - - std::shared_ptr observer_ = std::make_shared(); - bool listeningHighContrast_ = false; - OnHighContrastChange onHighContrastChange_ = nullptr; }; -RSAccessibilityOHOS &RSAccessibilityOHOS::GetInstance() -{ - static RSAccessibilityOHOS instance; - return instance; -} - RSAccessibility &RSAccessibility::GetInstance() { - return RSAccessibilityOHOS::GetInstance(); -} - -void RSAccessibilityOHOS::ListenHighContrastChange(OnHighContrastChange callback) -{ - onHighContrastChange_ = callback; - ListenHighContrast(); -} - -void RSAccessibilityOHOS::ListenHighContrast() -{ - if (!listeningHighContrast_) { - auto &config = OHOS::AccessibilityConfig::AccessibilityConfig::GetInstance(); - config.InitializeContext(); - config.SubscribeConfigObserver(CONFIG_ID::CONFIG_HIGH_CONTRAST_TEXT, observer_); - listeningHighContrast_ = true; - } + static RSAccessibilityFangTian instance; + return instance; } -void RSAccessibilityOHOS::Observer::OnConfigChanged(const CONFIG_ID id, const ConfigValue &value) +void RSAccessibilityFangTian::ListenHighContrastChange(OnHighContrastChange callback) { - ROSEN_LOGD("OnConfigChanged %d", static_cast(id)); - auto &accessbility = RSAccessibilityOHOS::GetInstance(); - if (id == CONFIG_ID::CONFIG_HIGH_CONTRAST_TEXT && accessbility.onHighContrastChange_) { - accessbility.onHighContrastChange_(value.highContrastText); - } } } // namespace Rosen } // namespace OHOS diff --git a/display_server/rosen/modules/render_service_client/core/jank_detector/rs_jank_detector.cpp b/display_server/rosen/modules/render_service_client/core/jank_detector/rs_jank_detector.cpp index fa572f4958850f7a414725f632dd575918155099..250e07760f25860a5b3795b73f4b949f049f519e 100644 --- a/display_server/rosen/modules/render_service_client/core/jank_detector/rs_jank_detector.cpp +++ b/display_server/rosen/modules/render_service_client/core/jank_detector/rs_jank_detector.cpp @@ -17,7 +17,7 @@ #include #ifdef ROSEN_OHOS -#include "base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent/include/hisysevent.h" +#include "hisysevent.h" #include "sandbox_utils.h" #endif diff --git a/display_server/rosen/modules/render_service_client/core/pipeline/rs_render_thread.cpp b/display_server/rosen/modules/render_service_client/core/pipeline/rs_render_thread.cpp index b8af45f7c43be3f8b19f24890e9d0e8ec5eec9f7..3213e30c0225aaf3e2613f3ea393b8f5e9a3bc9b 100644 --- a/display_server/rosen/modules/render_service_client/core/pipeline/rs_render_thread.cpp +++ b/display_server/rosen/modules/render_service_client/core/pipeline/rs_render_thread.cpp @@ -45,7 +45,6 @@ #ifdef ROSEN_OHOS #include #include -#include "accessibility_config.h" #include "frame_collector.h" #include "render_frame_trace.h" #include "platform/ohos/overdraw/rs_overdraw_controller.h" diff --git a/display_server/rosen/modules/render_service_client/ft_build/BUILD.gn b/display_server/rosen/modules/render_service_client/ft_build/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..91881d13dee5eed709f4772c67c362a41a4495de --- /dev/null +++ b/display_server/rosen/modules/render_service_client/ft_build/BUILD.gn @@ -0,0 +1,141 @@ +# Copyright (c) 2021-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") +import("//display_server/ft_configs/ds_config.gni") + +config("render_service_client_config") { + include_dirs = [ + "$rosen_root/modules", + "$rosen_root/modules/render_service_client/core", + "$rosen_root/modules/render_service_base/include", + "$rosen_root/modules/render_service_base/src/platform/fangtian/include", + "$rosen_root/modules/platform/image_native", + "$display_server_root/interfaces/inner_api/common", + "$display_server_root/interfaces/inner_api/surface", + "$display_server_root/interfaces/inner_api/composer", + #"//drivers/peripheral/display/interfaces/include", + #"//drivers/peripheral/base", + ] + defines = [ "ROSEN_OHOS" ] +} + +ft_source_set("render_service_client_src") { + defines = [] + defines += gpu_defines + defines += [ "MODULE_RSC" ] + include_dirs = [ + "$rosen_root/modules/2d_graphics/src", + "$rosen_root/modules/render_frame_trace/include", + "$rosen_root/modules/render_service_base/src", + "$display_server_root/utils/log", + "$display_server_root/utils/sandbox", + ] + + sources = [ + #animation + "../core/animation/rs_animation.cpp", + "../core/animation/rs_animation_callback.cpp", + "../core/animation/rs_animation_group.cpp", + "../core/animation/rs_animation_manager_map.cpp", + "../core/animation/rs_animation_timing_curve.cpp", + "../core/animation/rs_curve_animation.cpp", + "../core/animation/rs_implicit_animation_param.cpp", + "../core/animation/rs_implicit_animator.cpp", + "../core/animation/rs_implicit_animator_map.cpp", + "../core/animation/rs_keyframe_animation.cpp", + "../core/animation/rs_path_animation.cpp", + "../core/animation/rs_property_animation.cpp", + "../core/animation/rs_spring_animation.cpp", + "../core/animation/rs_transition.cpp", + "../core/animation/rs_ui_animation_manager.cpp", + + #modifier + "../core/modifier/rs_extended_modifier.cpp", + "../core/modifier/rs_modifier_extractor.cpp", + "../core/modifier/rs_modifier_manager.cpp", + "../core/modifier/rs_property.cpp", + "../core/modifier/rs_property_modifier.cpp", + + #jank_detector + "../core/jank_detector/rs_jank_detector.cpp", + + #pipeline + "../core/pipeline/rs_node_map.cpp", + "../core/pipeline/rs_render_thread.cpp", + "../core/pipeline/rs_render_thread_visitor.cpp", + + #transaction + "../core/transaction/rs_application_agent_impl.cpp", + "../core/transaction/rs_interfaces.cpp", + "../core/transaction/rs_render_thread_client.cpp", + "../core/transaction/rs_transaction.cpp", + + #ui + "../core/ui/rs_base_node.cpp", + "../core/ui/rs_canvas_node.cpp", + "../core/ui/rs_display_node.cpp", + "../core/ui/rs_node.cpp", + "../core/ui/rs_pixel_map_util.cpp", + "../core/ui/rs_proxy_node.cpp", + "../core/ui/rs_root_node.cpp", + "../core/ui/rs_surface_extractor.cpp", + "../core/ui/rs_surface_node.cpp", + "../core/ui/rs_ui_director.cpp", + "../core/ui/rs_ui_share_context.cpp", + ] + + cflags = [ + "-Wall", + "-Wno-pointer-arith", + "-Wno-non-virtual-dtor", + "-Wno-missing-field-initializers", + "-Wno-c++11-narrowing", + "-fvisibility=hidden", + ] + + cflags_cc = [ + "-std=c++17", + "-fvisibility-inlines-hidden", + ] + + #if (enable_export_macro) { + # defines += [ "ENABLE_EXPORT_MACRO" ] + #} + + deps = [ + "$rosen_root/modules/composer/vsync/ft_build:libvsync", + "$rosen_root/modules/frame_analyzer/ft_build:libframe_analyzer", + "$rosen_root/modules/render_frame_trace/ft_build:render_frame_trace", + "$rosen_root/modules/render_service_base/ft_build:librender_service_base", + "$display_server_root/utils/buffer_handle/ft_build:buffer_handle", + "$display_server_root/utils/sync_fence/ft_build:sync_fence", + "$display_server_root/utils/sandbox/ft_build:sandbox_utils", + ] + + public_configs = [ ":render_service_client_config" ] + + configs = [ + "//build/gn/configs/system_libs:eventhandler_config", + "//build/gn/configs/system_libs:ipc_core_config", + "//build/gn/configs/system_libs:c_utils_config", + "//build/gn/configs/system_libs:skia_config", + "//build/gn/configs/system_libs:hitrace_meter_config", + ] +} + +ft_shared_library("librender_service_client") { + public_deps = [ + ":render_service_client_src", + ] +}