Skip to content

Commit 2b01da0

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Expose rootTag / surfaceId as part of schedulerDidRequestPreliminaryViewAllocation method
Summary: This diff exposes rootTag as part of SchedulerDelegate.schedulerDidRequestPreliminaryViewAllocation(). This will be necessary to be able to pool views per Surface in Android Reviewed By: shergin Differential Revision: D12875656 fbshipit-source-id: d2a8c1f9bcc6b14c17b34bf59085da44ae3c3416
1 parent 95b21b4 commit 2b01da0

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

React/Fabric/RCTScheduler.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void schedulerDidFinishTransaction(Tag rootTag, const ShadowViewMutationList &mu
2727
[scheduler.delegate schedulerDidFinishTransaction:mutations rootTag:rootTag];
2828
}
2929

30-
void schedulerDidRequestPreliminaryViewAllocation(ComponentName componentName) override {
30+
void schedulerDidRequestPreliminaryViewAllocation(SurfaceId surfaceId, ComponentName componentName) override {
3131
RCTScheduler *scheduler = (__bridge RCTScheduler *)scheduler_;
3232
[scheduler.delegate schedulerDidRequestPreliminaryViewAllocationWithComponentName:RCTNSStringFromString(componentName, NSASCIIStringEncoding)];
3333
}

ReactCommon/fabric/uimanager/Scheduler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ void Scheduler::uiManagerDidCreateShadowNode(
186186
const SharedShadowNode &shadowNode) {
187187
if (delegate_) {
188188
delegate_->schedulerDidRequestPreliminaryViewAllocation(
189-
shadowNode->getComponentName());
189+
shadowNode->getRootTag(), shadowNode->getComponentName());
190190
}
191191
}
192192

ReactCommon/fabric/uimanager/SchedulerDelegate.h

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class SchedulerDelegate {
3232
* Called right after a new ShadowNode was created.
3333
*/
3434
virtual void schedulerDidRequestPreliminaryViewAllocation(
35+
SurfaceId surfaceId,
3536
ComponentName componentName) = 0;
3637

3738
virtual ~SchedulerDelegate() noexcept = default;

0 commit comments

Comments
 (0)