mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-12 22:39:06 +08:00
Fabric: Sharing a pointer to ShadowTreeRegister with UIManager
Summary: The diff adds a pointer to ShadowTreeRegistry to UIManager which enables the possibility of implementing ShadowTree mutating and inspecting methods like `setNativeProps` and `getRelativeLayoutMetrics`. Reviewed By: mdvacca Differential Revision: D13036549 fbshipit-source-id: 5ed1252d84c8dd895fe0e6e8cc71afbaa9dab4b7
This commit is contained in:
committed by
Facebook Github Bot
parent
b4fa1fa0c6
commit
f8be867cd8
@@ -49,6 +49,7 @@ Scheduler::Scheduler(const SharedContextContainer &contextContainer)
|
||||
eventDispatcher, contextContainer);
|
||||
|
||||
uiManagerRef.setDelegate(this);
|
||||
uiManagerRef.setShadowTreeRegistry(&shadowTreeRegistry_);
|
||||
uiManagerRef.setComponentDescriptorRegistry(componentDescriptorRegistry_);
|
||||
|
||||
runtimeExecutor_([=](jsi::Runtime &runtime) {
|
||||
|
||||
@@ -67,6 +67,10 @@ void UIManager::completeSurface(
|
||||
}
|
||||
}
|
||||
|
||||
void UIManager::setShadowTreeRegistry(ShadowTreeRegistry *shadowTreeRegistry) {
|
||||
shadowTreeRegistry_ = shadowTreeRegistry;
|
||||
}
|
||||
|
||||
void UIManager::setComponentDescriptorRegistry(
|
||||
const SharedComponentDescriptorRegistry &componentDescriptorRegistry) {
|
||||
componentDescriptorRegistry_ = componentDescriptorRegistry;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <react/core/ShadowNode.h>
|
||||
#include <react/uimanager/ComponentDescriptorRegistry.h>
|
||||
#include <react/uimanager/ShadowTreeRegistry.h>
|
||||
#include <react/uimanager/UIManagerDelegate.h>
|
||||
|
||||
namespace facebook {
|
||||
@@ -15,6 +16,8 @@ namespace react {
|
||||
|
||||
class UIManager {
|
||||
public:
|
||||
void setShadowTreeRegistry(ShadowTreeRegistry *shadowTreeRegistry);
|
||||
|
||||
void setComponentDescriptorRegistry(
|
||||
const SharedComponentDescriptorRegistry &componentDescriptorRegistry);
|
||||
|
||||
@@ -49,6 +52,7 @@ class UIManager {
|
||||
SurfaceId surfaceId,
|
||||
const SharedShadowNodeUnsharedList &rootChildren) const;
|
||||
|
||||
ShadowTreeRegistry *shadowTreeRegistry_;
|
||||
SharedComponentDescriptorRegistry componentDescriptorRegistry_;
|
||||
UIManagerDelegate *delegate_;
|
||||
};
|
||||
|
||||
@@ -90,6 +90,7 @@ void UIManagerBinding::dispatchEvent(
|
||||
}
|
||||
|
||||
void UIManagerBinding::invalidate() const {
|
||||
uiManager_->setShadowTreeRegistry(nullptr);
|
||||
uiManager_->setDelegate(nullptr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user