diff --git a/frameworks/core/pipeline_ng/BUILD.gn b/frameworks/core/pipeline_ng/BUILD.gn index c6acc591e5fb7be1600abbcc2ae10899f578e39f..97352d26ebe2b2bd588366189150810ede615899 100644 --- a/frameworks/core/pipeline_ng/BUILD.gn +++ b/frameworks/core/pipeline_ng/BUILD.gn @@ -48,6 +48,10 @@ template("ace_core_pipeline_ng_source_set") { if (use_hilog) { external_deps += [ "hilog:libhilog" ] } + if (cpuboost_enable) { + external_deps += [ "ffrt:libffrt" ] + defines += [ "CPUBOOST_EN" ] + } if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) { if (is_arkui_x) { deps += [ "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client_static" ] diff --git a/frameworks/core/pipeline_ng/pipeline_context.cpp b/frameworks/core/pipeline_ng/pipeline_context.cpp index 98fb5f77882a684ad1aae4737d48372565d1d6d8..35a829cc46505356692c98638d326b688b4666ef 100755 --- a/frameworks/core/pipeline_ng/pipeline_context.cpp +++ b/frameworks/core/pipeline_ng/pipeline_context.cpp @@ -68,6 +68,9 @@ #include "component_test/pipeline_status.h" #endif // COMPONENT_TEST_ENABLED #include "interfaces/inner_api/ace_kit/src/view/ui_context_impl.h" +#ifdef CPUBOOST_EN +#include "c/ffrt_cpu_boost.h" +#endif // CPUBOOST_EN namespace { constexpr uint64_t ONE_MS_IN_NS = 1 * 1000 * 1000; @@ -499,6 +502,10 @@ void PipelineContext::FlushDirtyNodeUpdate() ACE_SCOPED_TRACE("Error update, node stack non-empty"); LOGW("stack is not empty when call FlushDirtyNodeUpdate, node may be mounted to incorrect pos!"); } +#ifdef CPUBOOST_EN + // cpu boost feature start: accelerate FlushDirtyNode. + ffrt_cpu_boost_start(CPUBOOST_START_POINT); +#endif // CPUBOOST_EN // SomeTimes, customNode->Update may add some dirty custom nodes to dirtyNodes_, // use maxFlushTimes to avoid dead cycle. int maxFlushTimes = 3; @@ -515,6 +522,10 @@ void PipelineContext::FlushDirtyNodeUpdate() } --maxFlushTimes; } +#ifdef CPUBOOST_EN + // cpu boost feature end. + ffrt_cpu_boost_end(CPUBOOST_START_POINT); +#endif // CPUBOOST_EN if (FrameReport::GetInstance().GetEnable()) { FrameReport::GetInstance().EndFlushBuild(); @@ -895,6 +906,10 @@ void PipelineContext::DispatchDisplaySync(uint64_t nanoTimestamp) return; } +#ifdef CPUBOOST_EN + // cpu boost feature start: accelerate Displaysync. + ffrt_cpu_boost_start(CPUBOOST_START_POINT + 1); +#endif // CPUBOOST_EN displaySyncManager->SetRefreshRateMode(window_->GetCurrentRefreshRateMode()); displaySyncManager->SetVsyncPeriod(window_->GetVSyncPeriod()); @@ -914,6 +929,10 @@ void PipelineContext::DispatchDisplaySync(uint64_t nanoTimestamp) auto monitorVsyncRate = displaySyncManager->GetMonitorVsyncRate(); auto id = GetInstanceId(); ArkUIPerfMonitor::GetPerfMonitor(id)->RecordDisplaySyncRate(monitorVsyncRate); +#ifdef CPUBOOST_EN + // cpu boost feature end. + ffrt_cpu_boost_end(CPUBOOST_START_POINT + 1); +#endif // CPUBOOST_EN } void PipelineContext::FlushAnimation(uint64_t nanoTimestamp)