diff --git a/frameworks/bridge/declarative_frontend/ark_component/src/ArkComponent.ts b/frameworks/bridge/declarative_frontend/ark_component/src/ArkComponent.ts index 4aa20a329be0728a937888225ca2b555f3fc0536..2ca9136333687b36e32589610770184ad3659a1d 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 9a36d3ceaf3429a8ff657ebcad0dcece895b05f6..cc492018f65d6ee5b54deb07f5d151d10770e403 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 f48f06f4b13c05d82d9c34277750883fe7bd340a..01fff41c8c222dcd7fd7410e5418cb70daea6219 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 4471989b4eeea968f2e7d4ffa8bde2f8e6cabc53..bc61338f2b48e448df1a54af964ae5eaacca069f 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 93eccc55deb1ac272af4ee7140154f78ca62954d..dd70237521f18ac64f003d191f57fe6020ae5db0 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 b81e9f2b462d1f97de51d68fa99f359995e6010e..0aa8f88dd5eee8e5d32c38b7a1f99d0a60817981 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 dec263e9a5464654abf86f4e6700331057a86ac9..160f317b4d257c76b109341c86c78e615ebe70bc 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) {