From 281f69ee0f5f721a9e85376a9d28b0dbe2f4ca12 Mon Sep 17 00:00:00 2001 From: lice Date: Sat, 13 Sep 2025 15:56:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=80=A7=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lice --- .../ark_component/src/ArkComponent.ts | 2 +- .../declarative_frontend/engine/arkComponent.js | 2 +- frameworks/core/components_ng/base/ui_node.cpp | 6 +++--- frameworks/core/components_ng/base/ui_node.h | 12 ++++++------ frameworks/core/pipeline_ng/pipeline_context.cpp | 6 +++--- frameworks/core/pipeline_ng/pipeline_context.h | 2 +- test/mock/core/pipeline/mock_pipeline_context.cpp | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/frameworks/bridge/declarative_frontend/ark_component/src/ArkComponent.ts b/frameworks/bridge/declarative_frontend/ark_component/src/ArkComponent.ts index 4aa20a329be..2ca91363336 100644 --- a/frameworks/bridge/declarative_frontend/ark_component/src/ArkComponent.ts +++ b/frameworks/bridge/declarative_frontend/ark_component/src/ArkComponent.ts @@ -277,7 +277,7 @@ class AllowForceDarkModifier extends ModifierWithKey { } static identity: Symbol = Symbol('allowForceDark'); applyPeer(node: KNode, reset: boolean): void { - getUINativeModule().common.allowForceDark(node); + getUINativeModule().common.allowForceDark(node, this.value); } checkObjectDiff(): boolean { return !isBaseOrResourceEqual(this.stageValue, this.value); diff --git a/frameworks/bridge/declarative_frontend/engine/arkComponent.js b/frameworks/bridge/declarative_frontend/engine/arkComponent.js index 9a36d3ceaf3..cc492018f65 100755 --- a/frameworks/bridge/declarative_frontend/engine/arkComponent.js +++ b/frameworks/bridge/declarative_frontend/engine/arkComponent.js @@ -209,7 +209,7 @@ class AllowForceDarkModifier extends ModifierWithKey { super(value); } applyPeer(node, reset) { - getUINativeModule().common.allowForceDark(node); + getUINativeModule().common.allowForceDark(node, this.value); } checkObjectDiff() { return !isBaseOrResourceEqual(this.stageValue, this.value); diff --git a/frameworks/core/components_ng/base/ui_node.cpp b/frameworks/core/components_ng/base/ui_node.cpp index f48f06f4b13..01fff41c8c2 100644 --- a/frameworks/core/components_ng/base/ui_node.cpp +++ b/frameworks/core/components_ng/base/ui_node.cpp @@ -605,7 +605,7 @@ void UINode::AllowForceDark(bool forceDarkAllowed) if (context_) { context_->NeedReloadResource(true); - context_->AddNeedReloadNodes(WeakClaim(this)); + context_->AddNeedReloadNodes(this); } for (const auto& child : GetChildren()) { child->AllowForceDark(forceDarkAllowed); @@ -624,11 +624,11 @@ void UINode::UpdateForceDarkAllowedNode(const RefPtr& child) if (!GetForceDarkAllowed() || (!child->GetForceDarkAllowed() && !(child->GetForceDarkAllowedByUser()))) { child->forceDarkAllowed_ = GetForceDarkAllowed(); pipelineContext->NeedReloadResource(true); - pipelineContext->AddNeedReloadNodes(WeakClaim(AceType::RawPtr(child))); + pipelineContext->AddNeedReloadNodes(AceType::RawPtr(child)); } if (!child->GetForceDarkAllowed() && GetForceDarkAllowed() && child->GetForceDarkAllowedByUser()) { pipelineContext->NeedReloadResource(true); - pipelineContext->AddNeedReloadNodes(WeakClaim(AceType::RawPtr(child))); + pipelineContext->AddNeedReloadNodes(AceType::RawPtr(child)); } for (const auto& uiChild : child->GetChildren()) { child->UpdateForceDarkAllowedNode(uiChild); diff --git a/frameworks/core/components_ng/base/ui_node.h b/frameworks/core/components_ng/base/ui_node.h index 4471989b4ee..bc61338f2b4 100644 --- a/frameworks/core/components_ng/base/ui_node.h +++ b/frameworks/core/components_ng/base/ui_node.h @@ -982,7 +982,7 @@ public: shouldRerender_ = shouldRerender; } - bool GetRerenderable() + bool GetRerenderable() const { return shouldRerender_; } @@ -992,7 +992,7 @@ public: isDarkMode_ = isDarkMode; } - bool CheckIsDarkMode() + bool CheckIsDarkMode() const { return isDarkMode_; } @@ -1002,7 +1002,7 @@ public: measureAnyWay_ = measureAnyWay; } - bool CheckMeasureAnyway() + bool CheckMeasureAnyway() const { return measureAnyWay_; } @@ -1012,14 +1012,14 @@ public: shouldClearCache_ = shouldClearCache; } - bool CheckShouldClearCache() + bool CheckShouldClearCache() const { return shouldClearCache_; } void AllowForceDark(bool forceDarkAllowed); - bool GetForceDarkAllowed() + bool GetForceDarkAllowed() const { return forceDarkAllowed_; } @@ -1029,7 +1029,7 @@ public: forceDarkAllowedbyUser_ = forceDarkAllowedbyUser; } - bool GetForceDarkAllowedByUser() + bool GetForceDarkAllowedByUser() const { return forceDarkAllowedbyUser_; } diff --git a/frameworks/core/pipeline_ng/pipeline_context.cpp b/frameworks/core/pipeline_ng/pipeline_context.cpp index 93eccc55deb..dd70237521f 100755 --- a/frameworks/core/pipeline_ng/pipeline_context.cpp +++ b/frameworks/core/pipeline_ng/pipeline_context.cpp @@ -722,11 +722,11 @@ void PipelineContext::UpdateDVSyncTime(uint64_t nanoTimestamp, const std::string } } -void PipelineContext::AddNeedReloadNodes(const WeakPtr& node) +void PipelineContext::AddNeedReloadNodes(UINode* node) { CHECK_NULL_VOID(node.Upgrade()); - if (std::find(needReloadNodes_.begin(), needReloadNodes_.end(), node) == needReloadNodes_.end()) { - needReloadNodes_.push_back(node); + if (std::find(needReloadNodes_.begin(), needReloadNodes_.end(), WeakClaim(node)) == needReloadNodes_.end()) { + needReloadNodes_.push_back(WeakClaim(node)); } } diff --git a/frameworks/core/pipeline_ng/pipeline_context.h b/frameworks/core/pipeline_ng/pipeline_context.h index b81e9f2b462..0aa8f88dd5e 100755 --- a/frameworks/core/pipeline_ng/pipeline_context.h +++ b/frameworks/core/pipeline_ng/pipeline_context.h @@ -1123,7 +1123,7 @@ public: bool AddChangedFrameNode(const WeakPtr& node); void RemoveChangedFrameNode(int32_t nodeId); - void AddNeedReloadNodes(const WeakPtr& node); + void AddNeedReloadNodes(UINode* node); void ReloadNodesResource(); void NeedReloadResource(bool needReloadResource) diff --git a/test/mock/core/pipeline/mock_pipeline_context.cpp b/test/mock/core/pipeline/mock_pipeline_context.cpp index dec263e9a54..160f317b4d2 100644 --- a/test/mock/core/pipeline/mock_pipeline_context.cpp +++ b/test/mock/core/pipeline/mock_pipeline_context.cpp @@ -1515,7 +1515,7 @@ std::string NG::PipelineContext::GetCurrentPageNameCallback() return ""; } -void NG::PipelineContext::AddNeedReloadNodes(const WeakPtr& node) {} +void NG::PipelineContext::AddNeedReloadNodes(NG::UINode* node) {} void NG::PipelineContext::SetVsyncListener(VsyncCallbackFun vsync) { -- Gitee