diff --git a/frameworks/core/common/platform_window.h b/frameworks/core/common/platform_window.h index e5bad4574fd3a74470be390fdae85c2746bb696d..6697b54cfc21aca4882c7b649ea3563bb3513238 100644 --- a/frameworks/core/common/platform_window.h +++ b/frameworks/core/common/platform_window.h @@ -24,7 +24,8 @@ #include "base/utils/noncopyable.h" namespace OHOS::Ace { -using AceVsyncCallback = std::function; + +using AceVsyncCallback = std::function; class AceView; class RenderNode; diff --git a/frameworks/core/common/rosen/rosen_window.h b/frameworks/core/common/rosen/rosen_window.h index 3e4752d5860395557689a7e88564b403e6e031d3..19b9641c9fefc486c6cec6b795a599f38c2be1c3 100644 --- a/frameworks/core/common/rosen/rosen_window.h +++ b/frameworks/core/common/rosen/rosen_window.h @@ -27,6 +27,7 @@ #include "core/common/platform_window.h" namespace OHOS::Ace::Platform { + class RSWindow final : public PlatformWindow { public: void Destroy() override; diff --git a/frameworks/core/common/window.cpp b/frameworks/core/common/window.cpp index 32edb42f340ed1eb37a1fc311a2033b69314d840..05a8139a5466d48b75b99b0109a1f66762e61c3b 100644 --- a/frameworks/core/common/window.cpp +++ b/frameworks/core/common/window.cpp @@ -21,7 +21,7 @@ namespace OHOS::Ace { Window::Window(std::unique_ptr platformWindow) : platformWindow_(std::move(platformWindow)) { CHECK_NULL_VOID(platformWindow_); - auto&& callback = [this](uint64_t nanoTimestamp, uint64_t frameCount) { OnVsync(nanoTimestamp, frameCount); }; + auto&& callback = [this](uint64_t nanoTimestamp, uint32_t frameCount) { OnVsync(nanoTimestamp, frameCount); }; platformWindow_->RegisterVsyncCallback(callback); LOGI("Window Created success."); } @@ -43,7 +43,7 @@ void Window::SetRootRenderNode(const RefPtr& root) platformWindow_->SetRootRenderNode(root); } -void Window::OnVsync(uint64_t nanoTimestamp, uint64_t frameCount) +void Window::OnVsync(uint64_t nanoTimestamp, uint32_t frameCount) { isRequestVsync_ = false; diff --git a/frameworks/core/common/window.h b/frameworks/core/common/window.h index 8a4652d3a4c7e281bd3ba15462390ecfb61d05e9..9c1f1064325997efbf22359ee93b07aec9a68e9c 100644 --- a/frameworks/core/common/window.h +++ b/frameworks/core/common/window.h @@ -51,7 +51,6 @@ public: } virtual void RequestFrame(); - virtual void ForceFlushVsync(uint64_t nanoTimestamp, uint64_t frameCount) {} virtual void FlushFrameRate(int32_t rate, int32_t animatorExpectedFrameRate, int32_t rateTyte) {} @@ -103,7 +102,7 @@ public: return false; } - virtual void OnVsync(uint64_t nanoTimestamp, uint64_t frameCount); + virtual void OnVsync(uint64_t nanoTimestamp, uint32_t frameCount); virtual void SetVsyncCallback(AceVsyncCallback&& callback); @@ -233,7 +232,7 @@ public: virtual void Unlock() {} virtual void SetUiDvsyncSwitch(bool dvsyncSwitch); - + virtual uint32_t GetStatusBarHeight() const { return 0; diff --git a/frameworks/core/components_ng/render/adapter/rosen_window.cpp b/frameworks/core/components_ng/render/adapter/rosen_window.cpp index 3638e96468104950b3bd107156669e31f1a6ea28..54f17df44db3748a109c77a8c2f5d7ba0e633ab2 100644 --- a/frameworks/core/components_ng/render/adapter/rosen_window.cpp +++ b/frameworks/core/components_ng/render/adapter/rosen_window.cpp @@ -29,10 +29,7 @@ namespace { constexpr int32_t IDLE_TASK_DELAY_MILLISECOND = 51; constexpr float ONE_SECOND_IN_NANO = 1000000000.0f; #ifdef VSYNC_TIMEOUT_CHECK -constexpr int32_t VSYNC_TASK_DELAY_MILLISECOND = 3000; // if vsync not received in 3s,report an system warning. -constexpr int32_t VSYNC_RECOVER_DELAY_MILLISECOND = 500; // if vsync not received in 500ms, We simulate a fake Vsync. -constexpr char VSYNC_TIMEOUT_CHECK_TASKNAME[] = "ArkUIVsyncTimeoutCheck"; -constexpr char VSYNC_RECOVER_TASKNAME[] = "ArkUIVsyncRecover"; +constexpr int32_t VSYNC_TASK_DELAY_MILLISECOND = 3000; #endif #ifdef PREVIEW @@ -41,11 +38,12 @@ constexpr float PREVIEW_REFRESH_RATE = 30.0f; } // namespace namespace OHOS::Ace::NG { + RosenWindow::RosenWindow(const OHOS::sptr& window, RefPtr taskExecutor, int32_t id) : rsWindow_(window), taskExecutor_(taskExecutor), id_(id) { vsyncCallback_ = std::make_shared(); - vsyncCallback_->onCallback = [weakTask = taskExecutor_, id = id_](uint64_t timeStampNanos, uint64_t frameCount) { + vsyncCallback_->onCallback = [weakTask = taskExecutor_, id = id_](int64_t timeStampNanos, int64_t frameCount) { auto taskExecutor = weakTask.Upgrade(); auto onVsync = [id, timeStampNanos, frameCount] { int64_t ts = GetSysTimestamp(); @@ -60,11 +58,11 @@ RosenWindow::RosenWindow(const OHOS::sptr& window, RefPtrGetWindow(); CHECK_NULL_VOID(window); int64_t refreshPeriod = window->GetVSyncPeriod(); - window->OnVsync(timeStampNanos, frameCount); + window->OnVsync(static_cast(timeStampNanos), static_cast(frameCount)); ArkUIPerfMonitor::GetPerfMonitor(id)->FinishPerf(); auto pipeline = container->GetPipelineContext(); CHECK_NULL_VOID(pipeline); - int64_t deadline = std::min(ts, static_cast(timeStampNanos)) + refreshPeriod; + int64_t deadline = std::min(ts, timeStampNanos) + refreshPeriod; bool dvsyncOn = window->GetUiDvsyncSwitch(); if (dvsyncOn) { int64_t frameBufferCount = (refreshPeriod != 0 && timeStampNanos - ts > 0) ? @@ -176,40 +174,6 @@ bool RosenWindow::GetIsRequestFrame() return isRequestVsync_; } -void RosenWindow::ForceFlushVsync(uint64_t nanoTimestamp, uint64_t frameCount) -{ - if (vsyncCallback_ && vsyncCallback_->onCallback) { - LOGI("ArkUI force flush vsync for recover pipelinecontext."); - vsyncCallback_->onCallback(nanoTimestamp, UINT64_MAX); - } -} - -void RosenWindow::PostVsyncTimeoutDFXTask(const RefPtr& taskExecutor) -{ -#ifdef VSYNC_TIMEOUT_CHECK - CHECK_NULL_VOID(taskExecutor); - auto windowId = rsWindow_->GetWindowId(); - static auto task = [windowId, instanceId = id_, timeStamp = lastRequestVsyncTime_]() { - LOGE("ArkUI request vsync,but no vsync received in 3 seconds"); - EventReport::SendVsyncException(VsyncExcepType::UI_VSYNC_TIMEOUT, windowId, instanceId, timeStamp); - }; - taskExecutor->PostDelayedTaskWithoutTraceId(task, TaskExecutor::TaskType::JS, - VSYNC_TASK_DELAY_MILLISECOND, VSYNC_TIMEOUT_CHECK_TASKNAME); - - static auto recoverTask = [ weakWindow = weak_from_this() ] { - LOGW("ArkUI request vsync, but no vsync received in 500ms"); - auto window = weakWindow.lock(); - if (window) { - uint64_t nanoTimestamp = static_cast(GetSysTimestamp()); - // force flush vsync with now time stamp and UINT64_MAX as frameCount. - window->ForceFlushVsync(nanoTimestamp, UINT64_MAX); - } - }; - taskExecutor->PostDelayedTaskWithoutTraceId(recoverTask, TaskExecutor::TaskType::UI, - VSYNC_RECOVER_DELAY_MILLISECOND, VSYNC_RECOVER_TASKNAME); -#endif -} - void RosenWindow::RequestFrame() { if (!forceVsync_ && !onShow_) { @@ -227,7 +191,18 @@ void RosenWindow::RequestFrame() } rsWindow_->RequestVsync(vsyncCallback_); lastRequestVsyncTime_ = static_cast(GetSysTimestamp()); - PostVsyncTimeoutDFXTask(taskExecutor); +#ifdef VSYNC_TIMEOUT_CHECK + if (taskExecutor) { + auto windowId = rsWindow_->GetWindowId(); + auto instanceId = Container::CurrentIdSafely(); + auto task = [windowId, instanceId, timeStamp = lastRequestVsyncTime_]() { + LOGE("ArkUI request vsync,but no vsync was received within 3 seconds"); + EventReport::SendVsyncException(VsyncExcepType::UI_VSYNC_TIMEOUT, windowId, instanceId, timeStamp); + }; + taskExecutor->PostDelayedTaskWithoutTraceId(task, TaskExecutor::TaskType::JS, + VSYNC_TASK_DELAY_MILLISECOND, "ArkUIVsyncTimeoutCheck"); + } +#endif } if (taskExecutor) { taskExecutor->PostDelayedTask( @@ -318,6 +293,7 @@ void RosenWindow::FlushTasks(std::function callback) } else { rsUIDirector_->SendMessages(callback); } + JankFrameReport::GetInstance().JsAnimationToRsRecord(); } @@ -378,24 +354,17 @@ std::string RosenWindow::GetWindowName() const return windowName; } -void RosenWindow::RemoveVsyncTimeoutDFXTask(uint64_t frameCount) +void RosenWindow::OnVsync(uint64_t nanoTimestamp, uint32_t frameCount) { -#ifdef VSYNC_TIMEOUT_CHECK + Window::OnVsync(nanoTimestamp, frameCount); auto taskExecutor = taskExecutor_.Upgrade(); - // frameCount is UINT64_MAX means fake vsync task, no need remove DFX task. - if (taskExecutor && frameCount != UINT64_MAX) { - taskExecutor->RemoveTask(TaskExecutor::TaskType::JS, VSYNC_TIMEOUT_CHECK_TASKNAME); - taskExecutor->RemoveTask(TaskExecutor::TaskType::JS, VSYNC_RECOVER_TASKNAME); - } +#ifdef VSYNC_TIMEOUT_CHECK + if (taskExecutor) { + taskExecutor->RemoveTask(TaskExecutor::TaskType::JS, "ArkUIVsyncTimeoutCheck"); + } #endif } -void RosenWindow::OnVsync(uint64_t nanoTimestamp, uint64_t frameCount) -{ - RemoveVsyncTimeoutDFXTask(frameCount); - Window::OnVsync(nanoTimestamp, frameCount); -} - uint32_t RosenWindow::GetStatusBarHeight() const { #ifndef PREVIEW diff --git a/frameworks/core/components_ng/render/adapter/rosen_window.h b/frameworks/core/components_ng/render/adapter/rosen_window.h index 0179544e016ef5b7472b6f0285c428159c6ae700..bad5e224e99d68e4d5d3c70163b9227e09c36d5c 100644 --- a/frameworks/core/components_ng/render/adapter/rosen_window.h +++ b/frameworks/core/components_ng/render/adapter/rosen_window.h @@ -134,8 +134,8 @@ public: void FlushImplicitTransaction(const std::shared_ptr& rsUIDirector); - void OnVsync(uint64_t nanoTimestamp, uint64_t frameCount) override; - + void OnVsync(uint64_t nanoTimestamp, uint32_t frameCount) override; + void SetUiDvsyncSwitch(bool vsyncSwitch) override; uint32_t GetStatusBarHeight() const override; @@ -149,13 +149,7 @@ public: void NotifySnapshotUpdate() override; void SetDVSyncUpdate(uint64_t dvsyncTime) override; - - void ForceFlushVsync(uint64_t nanoTimestamp, uint64_t frameCount) override; - private: - void RemoveVsyncTimeoutDFXTask(uint64_t frameCount); - void PostVsyncTimeoutDFXTask(const RefPtr& taskExecutor); - OHOS::sptr rsWindow_; WeakPtr taskExecutor_; int32_t id_ = 0; diff --git a/frameworks/core/pipeline/pipeline_base.cpp b/frameworks/core/pipeline/pipeline_base.cpp index 9c1289a416cd6b59ef4c97916efe9edb38f21be4..a7050278cd31f1f39751b0fa9dddc9d337259ef4 100644 --- a/frameworks/core/pipeline/pipeline_base.cpp +++ b/frameworks/core/pipeline/pipeline_base.cpp @@ -51,7 +51,7 @@ PipelineBase::PipelineBase(std::shared_ptr window, RefPtr imageCache_ = ImageCache::Create(); fontManager_ = FontManager::Create(); auto&& vsyncCallback = [weak = AceType::WeakClaim(this), instanceId]( - uint64_t nanoTimestamp, uint64_t frameCount) { + const uint64_t nanoTimestamp, const uint32_t frameCount) { ContainerScope scope(instanceId); auto context = weak.Upgrade(); if (context) { @@ -76,7 +76,7 @@ PipelineBase::PipelineBase(std::shared_ptr window, RefPtr imageCache_ = ImageCache::Create(); fontManager_ = FontManager::Create(); auto&& vsyncCallback = [weak = AceType::WeakClaim(this), instanceId]( - uint64_t nanoTimestamp, uint64_t frameCount) { + const uint64_t nanoTimestamp, const uint32_t frameCount) { ContainerScope scope(instanceId); auto context = weak.Upgrade(); if (context) { @@ -766,7 +766,7 @@ bool PipelineBase::CloseImplicitAnimation() #endif } -void PipelineBase::OnVsyncEvent(uint64_t nanoTimestamp, uint64_t frameCount) +void PipelineBase::OnVsyncEvent(uint64_t nanoTimestamp, uint32_t frameCount) { CHECK_RUN_ON(UI); ACE_SCOPED_TRACE("OnVsyncEvent now:%" PRIu64 "", nanoTimestamp); diff --git a/frameworks/core/pipeline/pipeline_base.h b/frameworks/core/pipeline/pipeline_base.h index 08d270e416af66b18586c763ab9212703d795ef0..df7d670c5eadb84d5598a8d59bb601dbb19b5380 100644 --- a/frameworks/core/pipeline/pipeline_base.h +++ b/frameworks/core/pipeline/pipeline_base.h @@ -93,7 +93,7 @@ class ManagerInterface; class NavigationController; enum class FrontendType; using SharePanelCallback = std::function; -using AceVsyncCallback = std::function; +using AceVsyncCallback = std::function; class ACE_FORCE_EXPORT PipelineBase : public AceType { DECLARE_ACE_TYPE(PipelineBase, AceType); @@ -219,7 +219,7 @@ public: virtual bool OnRotationEvent(const RotationEvent& event) const = 0; // Called by window when received vsync signal. - virtual void OnVsyncEvent(uint64_t nanoTimestamp, uint64_t frameCount); + virtual void OnVsyncEvent(uint64_t nanoTimestamp, uint32_t frameCount); // Called by viewr virtual void OnDragEvent(const DragPointerEvent& pointerEvent, DragEventAction action, @@ -1633,7 +1633,7 @@ protected: { return false; } - virtual void FlushVsync(uint64_t nanoTimestamp, uint64_t frameCount) = 0; + virtual void FlushVsync(uint64_t nanoTimestamp, uint32_t frameCount) = 0; virtual void SetRootRect(double width, double height, double offset = 0.0) = 0; virtual void FlushPipelineWithoutAnimation() = 0; diff --git a/frameworks/core/pipeline/pipeline_context.cpp b/frameworks/core/pipeline/pipeline_context.cpp index afeff23ac3650721326e74c54a77c9c38dbc83b2..7339526f603bee3c63b2df16a04f684f8ba25a5b 100644 --- a/frameworks/core/pipeline/pipeline_context.cpp +++ b/frameworks/core/pipeline/pipeline_context.cpp @@ -1984,7 +1984,7 @@ void PipelineContext::SetCardViewAccessibilityParams(const std::string& key, boo accessibilityManager->SetCardViewParams(key, focus); } -void PipelineContext::FlushVsync(uint64_t nanoTimestamp, uint64_t frameCount) +void PipelineContext::FlushVsync(uint64_t nanoTimestamp, uint32_t frameCount) { CHECK_RUN_ON(UI); ACE_FUNCTION_TRACK(); diff --git a/frameworks/core/pipeline/pipeline_context.h b/frameworks/core/pipeline/pipeline_context.h index efa7ae6238a84f5384c10c3d80f39256c945b50c..988820becdae25dcd9de843af337c877da2c6197 100644 --- a/frameworks/core/pipeline/pipeline_context.h +++ b/frameworks/core/pipeline/pipeline_context.h @@ -826,7 +826,7 @@ public: } protected: bool OnDumpInfo(const std::vector& params) const override; - void FlushVsync(uint64_t nanoTimestamp, uint64_t frameCount) override; + void FlushVsync(uint64_t nanoTimestamp, uint32_t frameCount) override; void FlushPipelineWithoutAnimation() override; void DispatchDisplaySync(uint64_t nanoTimestamp) override; void FlushAnimation(uint64_t nanoTimestamp) override; diff --git a/frameworks/core/pipeline_ng/pipeline_context.cpp b/frameworks/core/pipeline_ng/pipeline_context.cpp index 8f4b181337cd183f97277e0ff2c188e3eb2d77df..0b5b45e3c97fe3b26b8d84e14e54988b6551959d 100755 --- a/frameworks/core/pipeline_ng/pipeline_context.cpp +++ b/frameworks/core/pipeline_ng/pipeline_context.cpp @@ -719,7 +719,7 @@ void PipelineContext::UpdateDVSyncTime(uint64_t nanoTimestamp, const std::string } } -void PipelineContext::FlushVsync(uint64_t nanoTimestamp, uint64_t frameCount) +void PipelineContext::FlushVsync(uint64_t nanoTimestamp, uint32_t frameCount) { CHECK_RUN_ON(UI); if (IsDestroyed()) { @@ -728,7 +728,7 @@ void PipelineContext::FlushVsync(uint64_t nanoTimestamp, uint64_t frameCount) } SetVsyncTime(nanoTimestamp); ACE_SCOPED_TRACE_COMMERCIAL("UIVsyncTask[timestamp:%" PRIu64 "][vsyncID:%" PRIu64 "][instanceID:%d]", - nanoTimestamp, frameCount, instanceId_); + nanoTimestamp, static_cast(frameCount), instanceId_); window_->Lock(); static const std::string abilityName = AceApplicationInfo::GetInstance().GetProcessName().empty() ? GetBundleName() @@ -749,7 +749,7 @@ void PipelineContext::FlushVsync(uint64_t nanoTimestamp, uint64_t frameCount) ProcessDelayTasks(); DispatchDisplaySync(nanoTimestamp); FlushAnimation(nanoTimestamp); - FlushFrameCallback(nanoTimestamp, frameCount); + FlushFrameCallback(nanoTimestamp); auto hasRunningAnimation = FlushModifierAnimation(nanoTimestamp); FlushTouchEvents(); FlushDragEvents(); @@ -5974,34 +5974,23 @@ void PipelineContext::CheckAndLogLastConsumedAxisEventInfo(int32_t eventId, Axis eventManager_->CheckAndLogLastConsumedAxisEventInfo(eventId, action); } -void PipelineContext::FlushFrameCallback(uint64_t nanoTimestamp, uint64_t frameCount) +void PipelineContext::FlushFrameCallback(uint64_t nanoTimestamp) { - // UINT64_MAX means recover vsync, just request frame. - if (frameCount == UINT64_MAX) { - RequestFrame(); - return; - } if (!frameCallbackFuncs_.empty()) { - decltype(frameCallbackFuncs_) tasks; - std::swap(tasks, frameCallbackFuncs_); + decltype(frameCallbackFuncs_) tasks(std::move(frameCallbackFuncs_)); for (const auto& frameCallbackFunc : tasks) { frameCallbackFunc(nanoTimestamp); } } } -void PipelineContext::FlushFrameCallbackFromCAPI(uint64_t nanoTimestamp, uint64_t frameCount) +void PipelineContext::FlushFrameCallbackFromCAPI(uint64_t nanoTimestamp, uint32_t frameCount) { - // UINT64_MAX means recover vsync, just request frame. - if (frameCount == UINT64_MAX) { - RequestFrame(); - return; - } if (!frameCallbackFuncsFromCAPI_.empty()) { decltype(frameCallbackFuncsFromCAPI_) tasks; std::swap(tasks, frameCallbackFuncsFromCAPI_); for (const auto& frameCallbackFuncFromCAPI : tasks) { - frameCallbackFuncFromCAPI(nanoTimestamp, static_cast(frameCount)); + frameCallbackFuncFromCAPI(nanoTimestamp, frameCount); } } } diff --git a/frameworks/core/pipeline_ng/pipeline_context.h b/frameworks/core/pipeline_ng/pipeline_context.h index f6bcd34f934ad64b071553eb39bfc55ecfec7c6f..90664ea0b91c95e316f4711949c27ea0a9e17b27 100755 --- a/frameworks/core/pipeline_ng/pipeline_context.h +++ b/frameworks/core/pipeline_ng/pipeline_context.h @@ -1072,11 +1072,11 @@ public: void AddFrameCallback(FrameCallbackFunc&& frameCallbackFunc, IdleCallbackFunc&& idleCallbackFunc, int64_t delayMillis); - void FlushFrameCallback(uint64_t nanoTimestamp, uint64_t frameCount); + void FlushFrameCallback(uint64_t nanoTimestamp); void TriggerIdleCallback(int64_t deadline); void AddCAPIFrameCallback(FrameCallbackFuncFromCAPI&& frameCallbackFuncFromCAPI); - void FlushFrameCallbackFromCAPI(uint64_t nanoTimestamp, uint64_t frameCount); + void FlushFrameCallbackFromCAPI(uint64_t nanoTimestamp, uint32_t frameCount); void RegisterTouchEventListener(const std::shared_ptr& listener); void UnregisterTouchEventListener(const WeakPtr& pattern); @@ -1288,7 +1288,7 @@ protected: void MaximizeInImplictAnimation(int32_t width, int32_t height, WindowSizeChangeReason type, const std::shared_ptr& rsTransaction = nullptr); - void FlushVsync(uint64_t nanoTimestamp, uint64_t frameCount) override; + void FlushVsync(uint64_t nanoTimestamp, uint32_t frameCount) override; void FlushPipelineWithoutAnimation() override; void FlushFocus(); void FlushFocusWithNode(RefPtr focusNode, bool isScope); diff --git a/test/mock/core/common/mock_window.cpp b/test/mock/core/common/mock_window.cpp index 4552f9037d90e1c0ae1ad40b3d0e08add46d57f5..89f43cc3579d1b7b6f43d4f3e061a98864024645 100644 --- a/test/mock/core/common/mock_window.cpp +++ b/test/mock/core/common/mock_window.cpp @@ -18,7 +18,7 @@ namespace OHOS::Ace { Window::Window(std::unique_ptr platformWindow) : platformWindow_(std::move(platformWindow)) {} -void Window::OnVsync(uint64_t nanoTimestamp, uint64_t frameCount) {} +void Window::OnVsync(uint64_t nanoTimestamp, uint32_t frameCount) {} void Window::RequestFrame() {} diff --git a/test/mock/core/pipeline/mock_pipeline_context.cpp b/test/mock/core/pipeline/mock_pipeline_context.cpp index d92c0349de31eb6fd8eacff0887ced3e31b4ef2e..f2ef480805d95c3b869efafe3561daacf9e54f81 100644 --- a/test/mock/core/pipeline/mock_pipeline_context.cpp +++ b/test/mock/core/pipeline/mock_pipeline_context.cpp @@ -494,7 +494,7 @@ void PipelineContext::DetachNode(RefPtr) {} void PipelineContext::Finish(bool autoFinish) const {} -void PipelineContext::FlushVsync(uint64_t nanoTimestamp, uint64_t frameCount) {} +void PipelineContext::FlushVsync(uint64_t nanoTimestamp, uint32_t frameCount) {} void PipelineContext::FlushPipelineWithoutAnimation() {} @@ -714,7 +714,7 @@ void PipelineContext::AddDirtyLayoutNode(const RefPtr& dirty) void PipelineContext::AddIgnoreLayoutSafeAreaBundle(IgnoreLayoutSafeAreaBundle&& bundle) { - if (MockPipelineContext::GetCurrent()->UseFlushUITasks()) + if (MockPipelineContext::GetCurrent()->UseFlushUITasks()) { taskScheduler_->AddIgnoreLayoutSafeAreaBundle(std::move(bundle)); } @@ -1187,7 +1187,7 @@ void PipelineBase::OnVirtualKeyboardAreaChange(Rect keyboardArea, double positio const std::shared_ptr& rsTransaction, bool forceChange) {} -void PipelineBase::OnVsyncEvent(uint64_t nanoTimestamp, uint64_t frameCount) {} +void PipelineBase::OnVsyncEvent(uint64_t nanoTimestamp, uint32_t frameCount) {} bool PipelineBase::ReachResponseDeadline() const { diff --git a/test/unittest/core/pattern/ui_extension/mock/mock_rosen_window.cpp b/test/unittest/core/pattern/ui_extension/mock/mock_rosen_window.cpp index 6c567e7562d02e34fe970280d21f0193626b9812..d148189d64273dccb2b3a5690a6c6b2fb8e44caf 100644 --- a/test/unittest/core/pattern/ui_extension/mock/mock_rosen_window.cpp +++ b/test/unittest/core/pattern/ui_extension/mock/mock_rosen_window.cpp @@ -59,7 +59,7 @@ std::string RosenWindow::GetWindowName() const return ""; } -void RosenWindow::OnVsync(uint64_t nanoTimestamp, uint64_t frameCount) {} +void RosenWindow::OnVsync(uint64_t nanoTimestamp, uint32_t frameCount) {} uint32_t RosenWindow::GetStatusBarHeight() const { diff --git a/test/unittest/core/pipeline/pipeline_context_test_ng_two.cpp b/test/unittest/core/pipeline/pipeline_context_test_ng_two.cpp index 8c5a2e36ecd89b70e620ad356cd5a0e7d385550a..3de9d7ba347e2838facdb790b629ce5b08c9e19e 100644 --- a/test/unittest/core/pipeline/pipeline_context_test_ng_two.cpp +++ b/test/unittest/core/pipeline/pipeline_context_test_ng_two.cpp @@ -1217,7 +1217,7 @@ HWTEST_F(PipelineContextTestNg, PipelineContextTestNg164, TestSize.Level1) { /** * @tc.steps1: Call the function FlushFrameCallback. - * @tc.expected: Test the member frameCallbackFuncs_ is empty. + * @tc.expected: Test the member frameCallbackFuncs_ is not empty. */ ASSERT_NE(context_, nullptr); uint64_t nanoTimestamp = 1; @@ -1225,16 +1225,8 @@ HWTEST_F(PipelineContextTestNg, PipelineContextTestNg164, TestSize.Level1) return; }; context_->frameCallbackFuncs_.push_back(callback); - context_->FlushFrameCallback(nanoTimestamp, 0); + context_->FlushFrameCallback(nanoTimestamp); EXPECT_TRUE(context_->frameCallbackFuncs_.empty()); - /** - * @tc.steps2: Call the function FlushFrameCallback with UINT64_MAX as framecount . - * @tc.expected: frameCallbackFuncs_ size is 1. - */ - context_->frameCallbackFuncs_.push_back(callback); - context_->FlushFrameCallback(nanoTimestamp, UINT64_MAX); - EXPECT_EQ(context_->frameCallbackFuncs_.size(), 1); - context_->frameCallbackFuncs_.clear(); } /** @@ -1250,21 +1242,13 @@ HWTEST_F(PipelineContextTestNg, PipelineContextTestNg165, TestSize.Level1) */ ASSERT_NE(context_, nullptr); uint64_t nanoTimestamp = 1; - uint64_t frameCount = 1; + uint32_t frameCount = 1; FrameCallbackFuncFromCAPI frameCallback = [](uint64_t nanoTimestamp, uint32_t frameCount) { return; }; context_->frameCallbackFuncsFromCAPI_.push_back(frameCallback); context_->FlushFrameCallbackFromCAPI(nanoTimestamp, frameCount); EXPECT_TRUE(context_->frameCallbackFuncsFromCAPI_.empty()); - /** - * @tc.steps2: Call the function FlushFrameCallbackFromCAPI with UINT64_MAX as framecount . - * @tc.expected: frameCallbackFuncsFromCAPI_ size is 1. - */ - context_->frameCallbackFuncsFromCAPI_.push_back(frameCallback); - context_->FlushFrameCallbackFromCAPI(nanoTimestamp, UINT64_MAX); - EXPECT_EQ(context_->frameCallbackFuncsFromCAPI_.size(), 1); - context_->frameCallbackFuncsFromCAPI_.clear(); } /**