Skip to content

Commit

Permalink
Expose rootTag / surfaceId as part of schedulerDidRequestPreliminaryV…
Browse files Browse the repository at this point in the history
…iewAllocation 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
  • Loading branch information
mdvacca authored and facebook-github-bot committed Nov 9, 2018
1 parent 95b21b4 commit 2b01da0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion React/Fabric/RCTScheduler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void schedulerDidFinishTransaction(Tag rootTag, const ShadowViewMutationList &mu
[scheduler.delegate schedulerDidFinishTransaction:mutations rootTag:rootTag];
}

void schedulerDidRequestPreliminaryViewAllocation(ComponentName componentName) override {
void schedulerDidRequestPreliminaryViewAllocation(SurfaceId surfaceId, ComponentName componentName) override {
RCTScheduler *scheduler = (__bridge RCTScheduler *)scheduler_;
[scheduler.delegate schedulerDidRequestPreliminaryViewAllocationWithComponentName:RCTNSStringFromString(componentName, NSASCIIStringEncoding)];
}
Expand Down
2 changes: 1 addition & 1 deletion ReactCommon/fabric/uimanager/Scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void Scheduler::uiManagerDidCreateShadowNode(
const SharedShadowNode &shadowNode) {
if (delegate_) {
delegate_->schedulerDidRequestPreliminaryViewAllocation(
shadowNode->getComponentName());
shadowNode->getRootTag(), shadowNode->getComponentName());
}
}

Expand Down
1 change: 1 addition & 0 deletions ReactCommon/fabric/uimanager/SchedulerDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class SchedulerDelegate {
* Called right after a new ShadowNode was created.
*/
virtual void schedulerDidRequestPreliminaryViewAllocation(
SurfaceId surfaceId,
ComponentName componentName) = 0;

virtual ~SchedulerDelegate() noexcept = default;
Expand Down

0 comments on commit 2b01da0

Please sign in to comment.