[ASDisplayNode] Always layout nodes on a background thread (#1907)

* Always layout nodes on a background thread

* Remove semaphore in ASDataController for allocating nodes and layout

* Fix variable not used error

* Remove overhead to create subarray of contexts of nodes while layout nodes

* Remove extra allocation of allocatedNodes and indexPaths array
This commit is contained in:
Michael Schneider
2016-07-14 21:35:58 -07:00
committed by appleguy
parent f95790f280
commit a8c5ac138d
2 changed files with 32 additions and 72 deletions

View File

@@ -791,7 +791,7 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
};
// TODO ihm: Can we always push the measure to the background thread and remove the parameter from the API?
if (shouldMeasureAsync) {
if (ASDisplayNodeThreadIsMain()) {
ASPerformBlockOnBackgroundThread(transitionBlock);
} else {
transitionBlock();