diff --git a/frameworks/core/components/form/resource/form_manager_delegate.cpp b/frameworks/core/components/form/resource/form_manager_delegate.cpp index 5d7bb7f4c0d815886867608dac013fd720922a6d..90b31dc8358d6e4d91cf3d57eac1145262613a2b 100644 --- a/frameworks/core/components/form/resource/form_manager_delegate.cpp +++ b/frameworks/core/components/form/resource/form_manager_delegate.cpp @@ -49,6 +49,32 @@ constexpr char FORM_RENDERER_DISPATCHER[] = "ohos.extra.param.key.process_on_for constexpr int32_t RENDER_DEAD_CODE = 16501006; constexpr int32_t FORM_NOT_TRUST_CODE = 16501007; constexpr char ALLOW_UPDATE[] = "allowUpdate"; +constexpr char IS_DYNAMIC[] = "isDynamic"; + +bool GetFormInfo( + std::string& bundleName, + std::string& moduleName, + const std::string& cardName, + OHOS::AppExecFwk::FormInfo& formInfo) +{ + std::vector formInfos; + auto result = OHOS::AppExecFwk::FormMgr::GetInstance() + .GetFormsInfoByModule(bundleName, moduleName, formInfos); + if (result != 0) { + LOGW("Query FormInfo failed."); + return false; + } + + auto iter = formInfos.begin(); + while (iter != formInfos.end()) { + if (cardName == iter->name) { + formInfo = *iter; + return true; + } + iter++; + } + return false; +} } // namespace FormManagerDelegate::~FormManagerDelegate() @@ -135,31 +161,21 @@ void FormManagerDelegate::AddForm(const WeakPtr& context, const Re wantCache_.SetParam(OHOS::AppExecFwk::Constants::PARAM_FORM_DIMENSION_KEY, info.dimension); } - std::vector formInfos; + OHOS::AppExecFwk::FormInfo formInfo; AppExecFwk::FormType uiSyntax = AppExecFwk::FormType::JS; std::string bundleName(info.bundleName); std::string moduleName(info.moduleName); - auto result = OHOS::AppExecFwk::FormMgr::GetInstance().GetFormsInfoByModule(bundleName, - moduleName, - formInfos); - if (result != 0) { + auto result = GetFormInfo(bundleName, moduleName, info.cardName, formInfo); + if (!result) { LOGW("Query form uiSyntax failed."); - } else { - auto iter = formInfos.begin(); - while (iter != formInfos.end()) { - auto formInfo = *iter; - if (info.cardName == formInfo.name) { - uiSyntax = formInfo.uiSyntax; - break; - } - iter++; - } } + uiSyntax = formInfo.uiSyntax; if (uiSyntax == AppExecFwk::FormType::ETS) { CHECK_NULL_VOID(renderDelegate_); wantCache_.SetParam(FORM_RENDERER_PROCESS_ON_ADD_SURFACE, renderDelegate_->AsObject()); wantCache_.SetParam(ALLOW_UPDATE, info.allowUpdate); + wantCache_.SetParam(IS_DYNAMIC, formInfo.isDynamic); } auto clientInstance = OHOS::AppExecFwk::FormHostClient::GetInstance(); @@ -170,10 +186,11 @@ void FormManagerDelegate::AddForm(const WeakPtr& context, const Re OnFormError(std::to_string(ret), errorMsg); return; } + LOGI("Add form success formId: %{public}s", std::to_string(formJsInfo.formId).c_str()); LOGI("Add form success type: %{public}d", static_cast(formJsInfo.type)); LOGI("Add form success uiSyntax: %{public}d", static_cast(formJsInfo.uiSyntax)); - + LOGI("Add form success isDynamic: %{public}d", isDynamic_); if (formCallbackClient_ == nullptr) { formCallbackClient_ = std::make_shared(); } @@ -202,30 +219,31 @@ void FormManagerDelegate::AddForm(const WeakPtr& context, const Re void FormManagerDelegate::OnSurfaceCreate(const AppExecFwk::FormJsInfo& formInfo, const std::shared_ptr& rsSurfaceNode, const AAFwk::Want& want) { + LOGI("Form OnSurfaceCreate formId: %{public}s, isDynamic: %{public}d", + std::to_string(formInfo.formId).c_str(), formInfo.isDynamic); if (!rsSurfaceNode) { LOGE("Form OnSurfaceCreate rsSurfaceNode is null"); return; } - LOGI("Form OnSurfaceCreate formId=%{public}s", std::to_string(formInfo.formId).c_str()); - if (onFormSurfaceNodeCallback_) { - onFormSurfaceNodeCallback_(rsSurfaceNode); - } else { - LOGE("Form OnSurfaceCreate onFormSurfaceNodeCallback = nullptr"); + if (!onFormSurfaceNodeCallback_) { + LOGE("Form OnSurfaceCreate onFormSurfaceNodeCallback is nullptr"); + return; } - if (formRendererDispatcher_) { - LOGW("Get formRendererDispatcher already exist."); - return; + onFormSurfaceNodeCallback_(rsSurfaceNode); + if (!formRendererDispatcher_) { + sptr proxy = want.GetRemoteObject(FORM_RENDERER_DISPATCHER); + formRendererDispatcher_ = iface_cast(proxy); + if (formRendererDispatcher_ == nullptr) { + LOGE("Get formRendererDispatcher failed."); + } } - sptr proxy = want.GetRemoteObject(FORM_RENDERER_DISPATCHER); - formRendererDispatcher_ = iface_cast(proxy); - if (formRendererDispatcher_ == nullptr) { - LOGE("Get formRendererDispatcher failed."); - return; + isDynamic_ = formInfo.isDynamic; + if (!formInfo.isDynamic) { + HandleSnapshotCallback(); } - LOGI("Get success, formRendererDispatcher."); } std::string FormManagerDelegate::ConvertRequestInfo(const RequestFormInfo& info) const @@ -405,6 +423,16 @@ void FormManagerDelegate::AddUnTrustFormCallback(const UnTrustFormCallback& call unTrustFormCallback_ = callback; } +void FormManagerDelegate::AddSnapshotCallback(SnapshotCallback&& callback) +{ + if (!callback || state_ == State::RELEASED) { + LOGE("callback is null or has released"); + return; + } + + snapshotCallback_ = std::move(callback); +} + bool FormManagerDelegate::ParseAction(const std::string &action, const std::string& type, AAFwk::Want &want) { auto eventAction = JsonUtil::ParseJsonString(action); @@ -577,8 +605,8 @@ void FormManagerDelegate::OnActionEvent(const std::string& action) void FormManagerDelegate::DispatchPointerEvent( const std::shared_ptr& pointerEvent) { - if (formRendererDispatcher_ == nullptr) { - LOGI("DispatchPointerEvent: is null"); + if (!isDynamic_ || formRendererDispatcher_ == nullptr) { + LOGI("Is not dynamic or dispatchPointerEvent is null"); return; } @@ -666,6 +694,14 @@ void FormManagerDelegate::HandleUnTrustFormCallback() } } +void FormManagerDelegate::HandleSnapshotCallback() +{ + LOGI("HandleSnapshotCallback."); + if (snapshotCallback_) { + snapshotCallback_(); + } +} + void FormManagerDelegate::ReAddForm() { LOGI("ReAddForm."); @@ -686,6 +722,7 @@ void FormManagerDelegate::ResetForm() { runningCardId_ = -1; runningCompId_.clear(); + formRendererDispatcher_ = nullptr; } void FormManagerDelegate::ReleaseForm() diff --git a/frameworks/core/components/form/resource/form_manager_delegate.h b/frameworks/core/components/form/resource/form_manager_delegate.h index 7bbaef9b1ff8f8c1fd394d25113a1dafd535a39c..20a9faed1a16e17d483900eb1ccc5dd92029503d 100644 --- a/frameworks/core/components/form/resource/form_manager_delegate.h +++ b/frameworks/core/components/form/resource/form_manager_delegate.h @@ -55,6 +55,7 @@ public: using OnFormSurfaceChangeCallback = std::function; using ActionEventHandle = std::function; using UnTrustFormCallback = std::function; + using SnapshotCallback = std::function; enum class State : char { WAITINGFORSIZE, @@ -81,6 +82,7 @@ public: void AddFormSurfaceChangeCallback(OnFormSurfaceChangeCallback&& callback); void AddActionEventHandle(const ActionEventHandle& callback); void AddUnTrustFormCallback(const UnTrustFormCallback& callback); + void AddSnapshotCallback(SnapshotCallback&& callback); void OnActionEventHandle(const std::string& action); void SetAllowUpdate(bool allowUpdate); void OnActionEvent(const std::string& action); @@ -114,6 +116,7 @@ private: void OnFormError(const std::string& param); void ReAddForm(); void HandleUnTrustFormCallback(); + void HandleSnapshotCallback(); bool ParseAction(const std::string& action, const std::string& type, AAFwk::Want& want); onFormAcquiredCallbackForJava onFormAcquiredCallbackForJava_; @@ -126,8 +129,10 @@ private: OnFormSurfaceChangeCallback onFormSurfaceChangeCallback_; ActionEventHandle actionEventHandle_; UnTrustFormCallback unTrustFormCallback_; + SnapshotCallback snapshotCallback_; State state_ { State::WAITINGFORSIZE }; + bool isDynamic_ = true; #ifdef OHOS_STANDARD_SYSTEM int64_t runningCardId_ = -1; std::string runningCompId_; diff --git a/frameworks/core/components_ng/pattern/form/form_node.h b/frameworks/core/components_ng/pattern/form/form_node.h index addd31bdfa708a01fa324d5828287a1100bbe8fe..c7cf8e481c1237d20bbb0f8f520d79f25b1533ce 100644 --- a/frameworks/core/components_ng/pattern/form/form_node.h +++ b/frameworks/core/components_ng/pattern/form/form_node.h @@ -42,6 +42,17 @@ public: void OnDetachFromMainTree(bool) override; OffsetF GetFormOffset() const; + + int32_t GetImageId() + { + if (!imageId_.has_value()) { + imageId_ = ElementRegister::GetInstance()->MakeUniqueId(); + } + return imageId_.value(); + } + +private: + std::optional imageId_; }; } // namespace OHOS::Ace::NG diff --git a/frameworks/core/components_ng/pattern/form/form_pattern.cpp b/frameworks/core/components_ng/pattern/form/form_pattern.cpp index d0b7003e0f253428c09979b4a73e3c30ad16096f..4202ce64b5f2b5619c09554a27ec54cb814c4899 100644 --- a/frameworks/core/components_ng/pattern/form/form_pattern.cpp +++ b/frameworks/core/components_ng/pattern/form/form_pattern.cpp @@ -22,11 +22,15 @@ #include "core/components/form/sub_container.h" #include "core/components_ng/pattern/form/form_event_hub.h" #include "core/components_ng/pattern/form/form_layout_property.h" +#include "core/components_ng/pattern/form/form_node.h" #include "core/components_ng/pattern/form/form_theme.h" +#include "core/components_ng/pattern/image/image_layout_property.h" +#include "core/components_ng/pattern/image/image_pattern.h" #include "core/components_ng/property/property.h" #include "core/components_ng/render/adapter/rosen_render_context.h" #include "core/pipeline_ng/pipeline_context.h" #include "pointer_event.h" +#include "transaction/rs_interfaces.h" #ifdef ENABLE_DRAG_FRAMEWORK #include "foundation/distributeddatamgr/udmf/interfaces/innerkits/common/unified_types.h" @@ -36,22 +40,23 @@ namespace OHOS::Ace::NG { namespace { -void ShowPointEvent(const std::shared_ptr& pointerEvent) -{ - if (!pointerEvent) { - LOGE("Func: %{public}s, pointerEvent is null.", __func__); - return; - } - int32_t pointerID = pointerEvent->GetPointerId(); - MMI::PointerEvent::PointerItem item; - bool ret = pointerEvent->GetPointerItem(pointerID, item); - if (!ret) { - LOGE("Func: %{public}s, get pointer item failed.", __func__); - return; +constexpr uint32_t DELAY_TIME_FOR_FORM_SUBCONTAINER_CACHE = 30000; +constexpr uint32_t DELAY_TIME_FOR_FORM_SNAPSHOT = 5000; + +class FormSnapshotCallback : public Rosen::SurfaceCaptureCallback { +public: + explicit FormSnapshotCallback(const WeakPtr& node) : weakFormPattern_(node) {} + ~FormSnapshotCallback() override = default; + void OnSurfaceCapture(std::shared_ptr pixelMap) override + { + auto formPattern_ = weakFormPattern_.Upgrade(); + CHECK_NULL_VOID(formPattern_); + formPattern_->OnSnapshot(pixelMap); } -} -constexpr uint32_t DELAY_TIME_FOR_FORM_SUBCONTAINER_CACHE = 30000; +private: + WeakPtr weakFormPattern_ = nullptr; +}; } // namespace FormPattern::FormPattern() @@ -95,6 +100,7 @@ void FormPattern::OnAttachToFrameNode() }, DELAY_TIME_FOR_FORM_SUBCONTAINER_CACHE); }); + scopeId_ = Container::CurrentId(); } void FormPattern::HandleUnTrustForm() @@ -144,8 +150,140 @@ void FormPattern::UpdateBackgroundColorWhenUnTrustForm() host->GetRenderContext()->UpdateBackgroundColor(unTrustBackgroundColor); } +void FormPattern::HandleSnapshot() +{ + auto pipeline = PipelineContext::GetCurrentContext(); + CHECK_NULL_VOID(pipeline); + auto executor = pipeline->GetTaskExecutor(); + CHECK_NULL_VOID(executor); + executor->PostDelayedTask( + [weak = WeakClaim(this)]() mutable { + auto form = weak.Upgrade(); + CHECK_NULL_VOID(form); + form->TakeSurfaceCaptureForUI(); + }, + TaskExecutor::TaskType::UI, DELAY_TIME_FOR_FORM_SNAPSHOT); +} + +void FormPattern::TakeSurfaceCaptureForUI() +{ + LOGI("TakeSurfaceCaptureForUI"); + auto host = GetHost(); + CHECK_NULL_VOID(host); + auto externalContext = DynamicCast(host->GetRenderContext()); + CHECK_NULL_VOID(externalContext); + auto rsNode = externalContext->GetRSNode(); + CHECK_NULL_VOID(rsNode); + auto& rsInterface = Rosen::RSInterfaces::GetInstance(); + rsInterface.TakeSurfaceCaptureForUI(rsNode, std::make_shared(WeakClaim(this))); +} + +void FormPattern::OnSnapshot(std::shared_ptr pixelMap) +{ + LOGI("OnSnapshot"); + CHECK_NULL_VOID(pixelMap); + pixelMap_ = PixelMap::CreatePixelMap(reinterpret_cast(&pixelMap)); + UpdateStaticCard(); + isDynamic_ = false; +} + +void FormPattern::UpdateStaticCard() +{ + LOGI("UpdateStaticCard"); + // 1. Use imageNode to display pixelMap + UpdateImageNode(); + // 2. Remove FrsNode from formNode + RemoveFrsNode(); + // 3. Release renderer obj + ReleaseRenderer(); +} + +RefPtr FormPattern::GetOrCreateImageNode() +{ + LOGI("GetOrCreateImageNode"); + auto host = GetHost(); + CHECK_NULL_RETURN(host, nullptr); + auto child = host->GetLastChild(); + if (!child) { + auto formNode = DynamicCast(host); + CHECK_NULL_RETURN(formNode, nullptr); + auto imageId = formNode->GetImageId(); + auto imageNode = FrameNode::CreateFrameNode(V2::IMAGE_ETS_TAG, imageId, AceType::MakeRefPtr()); + CHECK_NULL_RETURN(imageNode, nullptr); + host->AddChild(imageNode); + return imageNode; + } + + if (child->GetTag() != V2::IMAGE_ETS_TAG) { + LOGE("child is not Image"); + return nullptr; + } + + auto imageNode = DynamicCast(child); + return imageNode; +} + +void FormPattern::UpdateImageNode() +{ + LOGI("UpdateImageNode"); + ContainerScope scope(scopeId_); + CHECK_NULL_VOID(pixelMap_); + auto host = GetHost(); + CHECK_NULL_VOID(host); + auto imageNode = GetOrCreateImageNode(); + CHECK_NULL_VOID(imageNode); + auto pixelLayoutProperty = imageNode->GetLayoutProperty(); + CHECK_NULL_VOID(pixelLayoutProperty); + auto pixelSourceInfo = ImageSourceInfo(pixelMap_); + + auto width = static_cast(cardInfo_.width.Value()); + auto height = static_cast(cardInfo_.height.Value()); + CalcSize idealSize = { CalcLength(width), CalcLength(height) }; + MeasureProperty layoutConstraint; + layoutConstraint.selfIdealSize = idealSize; + layoutConstraint.maxSize = idealSize; + imageNode->UpdateLayoutConstraint(layoutConstraint); + pixelLayoutProperty->UpdateImageSourceInfo(pixelSourceInfo); + + imageNode->MarkModifyDone(); + imageNode->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); +} + +void FormPattern::RemoveFrsNode() +{ + LOGI("RemoveFrsNode"); + ContainerScope scope(scopeId_); + CHECK_NULL_VOID(externalRenderContext_); + auto host = GetHost(); + CHECK_NULL_VOID(host); + auto renderContext = DynamicCast(host->GetRenderContext()); + CHECK_NULL_VOID(renderContext); + renderContext->RemoveChild(externalRenderContext_); + + host->MarkDirtyNode(PROPERTY_UPDATE_LAYOUT); + auto parent = host->GetParent(); + CHECK_NULL_VOID(parent); + parent->MarkNeedSyncRenderTree(); + parent->RebuildRenderContextTree(); + host->GetRenderContext()->RequestNextFrame(); +} + +void FormPattern::ReleaseRenderer() +{ + LOGI("ReleaseRenderer"); + ContainerScope scope(scopeId_); + CHECK_NULL_VOID(formManagerBridge_); + formManagerBridge_->ReleaseForm(); + formManagerBridge_->ResetForm(); +} + void FormPattern::OnRebuildFrame() { + if (!isDynamic_) { + LOGI("Do not need reAddChild"); + return; + } + auto host = GetHost(); CHECK_NULL_VOID(host); auto renderContext = host->GetRenderContext(); @@ -398,6 +536,15 @@ void FormPattern::InitFormManagerDelegate() CHECK_NULL_VOID(formPattern); formPattern->HandleUnTrustForm(); }); + + formManagerBridge_->AddSnapshotCallback( + [weak = WeakClaim(this), instanceID]() { + ContainerScope scope(instanceID); + LOGI("HandleSnapshot"); + auto formPattern = weak.Upgrade(); + CHECK_NULL_VOID(formPattern); + formPattern->HandleSnapshot(); + }); } void FormPattern::CreateCardContainer() @@ -568,6 +715,7 @@ void FormPattern::OnLoadEvent() { LOGI("OnLoadEvent"); ACE_FUNCTION_TRACE(); + isDynamic_ = true; auto host = GetHost(); CHECK_NULL_VOID(host); auto uiTaskExecutor = SingleTaskExecutor::Make(host->GetContext()->GetTaskExecutor(), TaskExecutor::TaskType::UI); @@ -641,7 +789,6 @@ void FormPattern::DispatchPointerEvent( return; } - ShowPointEvent(pointerEvent); formManagerBridge_->DispatchPointerEvent(pointerEvent); } diff --git a/frameworks/core/components_ng/pattern/form/form_pattern.h b/frameworks/core/components_ng/pattern/form/form_pattern.h index 1720e77e8685685f62bf8f0e6432069f5a3a7ebe..777a255e8cd52a5ce3bd19d80bac09275f1d0f55 100644 --- a/frameworks/core/components_ng/pattern/form/form_pattern.h +++ b/frameworks/core/components_ng/pattern/form/form_pattern.h @@ -64,6 +64,8 @@ public: void DispatchPointerEvent( const std::shared_ptr& pointerEvent) const; + void OnSnapshot(std::shared_ptr pixelMap); + RefPtr GetExternalRenderContext() { return externalRenderContext_; @@ -78,6 +80,7 @@ public: { isUnTrust_ = isUnTrust; } + private: void OnAttachToFrameNode() override; bool OnDirtyLayoutWrapperSwap(const RefPtr& dirty, const DirtySwapConfig& config) override; @@ -98,6 +101,15 @@ private: bool ISAllowUpdate() const; void EnableDrag(); void UpdateConfiguration(); + + void HandleSnapshot(); + void TakeSurfaceCaptureForUI(); + void UpdateStaticCard(); + RefPtr GetOrCreateImageNode(); + void UpdateImageNode(); + void RemoveFrsNode(); + void ReleaseRenderer(); + // used by ArkTS Card, for RSSurfaceNode from FRS, RefPtr externalRenderContext_; @@ -108,6 +120,9 @@ private: bool isLoaded_ = false; bool isVisible_ = true; bool isUnTrust_ = false; + bool isDynamic_ = true; + RefPtr pixelMap_ = nullptr; + int32_t scopeId_; std::string localeTag_ = AceApplicationInfo::GetInstance().GetLocaleTag(); }; diff --git a/frameworks/core/components_ng/test/pattern/form/BUILD.gn b/frameworks/core/components_ng/test/pattern/form/BUILD.gn index f6934ad3998178fd2dc119e93ffedfc9693ce190..75ed1defa3a1f8326eacdd83e527bfaf973656c7 100644 --- a/frameworks/core/components_ng/test/pattern/form/BUILD.gn +++ b/frameworks/core/components_ng/test/pattern/form/BUILD.gn @@ -31,7 +31,7 @@ ohos_unittest("form_test_ng") { "$ace_root/frameworks/core/components_ng/test/pattern/form/mock/mock_sub_container.cpp", "$ace_root/frameworks/core/event/back_end_event_manager.cpp", - #slef + #self "$ace_root/frameworks/core/components_ng/pattern/form/form_model_ng.cpp", "$ace_root/frameworks/core/components_ng/pattern/form/form_node.cpp", "$ace_root/frameworks/core/components_ng/pattern/form/form_pattern.cpp", @@ -85,6 +85,9 @@ ohos_unittest("form_test_ng") { "$ace_root/frameworks/core/components_ng/layout/layout_property.cpp", "$ace_root/frameworks/core/components_ng/layout/layout_wrapper.cpp", "$ace_root/frameworks/core/components_ng/layout/layout_wrapper_builder.cpp", + "$ace_root/frameworks/core/components_ng/pattern/image/image_layout_algorithm.cpp", + "$ace_root/frameworks/core/components_ng/pattern/image/image_modifier.cpp", + "$ace_root/frameworks/core/components_ng/pattern/image/image_paint_method.cpp", "$ace_root/frameworks/core/components_ng/property/border_property.cpp", "$ace_root/frameworks/core/components_ng/property/calc_length.cpp", "$ace_root/frameworks/core/components_ng/property/grid_property.cpp", @@ -100,12 +103,16 @@ ohos_unittest("form_test_ng") { "$ace_root/frameworks/core/pipeline/base/constants.cpp", # mock + "$ace_root/frameworks/base/test/mock/mock_pixel_map.cpp", "$ace_root/frameworks/base/test/mock/mock_ressched_report.cpp", "$ace_root/frameworks/base/test/mock/mock_system_properties.cpp", "$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp", "$ace_root/frameworks/core/components/test/unittest/mock/ace_trace_mock.cpp", "$ace_root/frameworks/core/components_ng/test/mock/animation/mock_geometry_transition.cpp", "$ace_root/frameworks/core/components_ng/test/mock/base/mock_localization.cpp", + "$ace_root/frameworks/core/components_ng/test/mock/image_provider/mock_image_loading_context.cpp", + "$ace_root/frameworks/core/components_ng/test/mock/image_provider/mock_image_painter.cpp", + "$ace_root/frameworks/core/components_ng/test/mock/image_provider/mock_image_source_info.cpp", "$ace_root/frameworks/core/components_ng/test/mock/pattern/grid_container/mock_grid_container_layout_property.cpp", "$ace_root/frameworks/core/components_ng/test/mock/render/mock_animation_utils.cpp", "$ace_root/frameworks/core/components_ng/test/mock/render/mock_modifier_adapter.cpp", @@ -114,6 +121,8 @@ ohos_unittest("form_test_ng") { "$ace_root/frameworks/core/components_ng/test/mock/render/mock_render_surface_creator.cpp", "$ace_root/frameworks/core/components_ng/test/mock/syntax/mock_for_each_node.cpp", "$ace_root/frameworks/core/components_ng/test/pattern/form/mock/mock_rs_surface_mode.cpp", + "$ace_root/frameworks/core/components_ng/test/pattern/image/mock/mock_image_pattern.cpp", + "$ace_root/frameworks/core/components_ng/test/pattern/image/mock_icon_theme.cpp", "$ace_root/frameworks/core/pipeline_ng/test/mock/mock_element_register.cpp", "$ace_root/frameworks/core/pipeline_ng/test/mock/mock_pipeline_base.cpp", ] diff --git a/frameworks/core/components_ng/test/pattern/form/mock/mock_form_manager_delegate.cpp b/frameworks/core/components_ng/test/pattern/form/mock/mock_form_manager_delegate.cpp index 18fb556b260b565f578febecbfb0c825984d8075..d1a5e1219dfc1f089397b0b8d4d8c153f78f1d7c 100644 --- a/frameworks/core/components_ng/test/pattern/form/mock/mock_form_manager_delegate.cpp +++ b/frameworks/core/components_ng/test/pattern/form/mock/mock_form_manager_delegate.cpp @@ -68,4 +68,10 @@ void FormManagerDelegate::DispatchPointerEvent(const std::shared_ptr& rsNode) {} + +const std::shared_ptr& RosenRenderContext::GetRSNode() +{ + return rsNode_; +} } // namespace OHOS::Ace::NG