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
This commit is contained in:
David Vacca 2018-11-08 16:55:12 -08:00 коммит произвёл Facebook Github Bot
Родитель 95b21b4828
Коммит 2b01da073c
3 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -27,7 +27,7 @@ public:
[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)];
}

Просмотреть файл

@ -186,7 +186,7 @@ void Scheduler::uiManagerDidCreateShadowNode(
const SharedShadowNode &shadowNode) {
if (delegate_) {
delegate_->schedulerDidRequestPreliminaryViewAllocation(
shadowNode->getComponentName());
shadowNode->getRootTag(), shadowNode->getComponentName());
}
}

Просмотреть файл

@ -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;