PR #1000 on GitHub! Provide a Beta API to enable the new, high efficiency render-ahead mechanism.

This commit is contained in:
Scott Goodson
2015-12-26 16:34:44 -08:00
parent e5988138e9
commit 4b560a703a
7 changed files with 9 additions and 8 deletions

View File

@@ -527,7 +527,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
ASCellNode *cellNode = [self nodeForItemAtIndexPath:indexPath]; ASCellNode *cellNode = [self nodeForItemAtIndexPath:indexPath];
if (cellNode.neverShowPlaceholders) { if (cellNode.neverShowPlaceholders) {
[cellNode recursivelyEnsureDisplay]; [cellNode recursivelyEnsureDisplaySynchronously:YES];
} }
} }

View File

@@ -16,7 +16,8 @@
/** /**
* @abstract Recursively ensures node and all subnodes are displayed. * @abstract Recursively ensures node and all subnodes are displayed.
* @see Full documentation in ASDisplayNode+FrameworkPrivate.h
*/ */
- (void)recursivelyEnsureDisplay; - (void)recursivelyEnsureDisplaySynchronously:(BOOL)synchronously;
@end @end

View File

@@ -1543,9 +1543,9 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock)
recursivelyTriggerDisplayForLayer(layer, shouldBlock); recursivelyTriggerDisplayForLayer(layer, shouldBlock);
} }
- (void)recursivelyEnsureDisplay - (void)recursivelyEnsureDisplaySynchronously:(BOOL)synchronously
{ {
[self __recursivelyTriggerDisplayAndBlock:YES]; [self __recursivelyTriggerDisplayAndBlock:synchronously];
} }
- (void)setShouldBypassEnsureDisplay:(BOOL)shouldBypassEnsureDisplay - (void)setShouldBypassEnsureDisplay:(BOOL)shouldBypassEnsureDisplay

View File

@@ -558,7 +558,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
ASCellNode *cellNode = [self nodeForRowAtIndexPath:indexPath]; ASCellNode *cellNode = [self nodeForRowAtIndexPath:indexPath];
if (cellNode.neverShowPlaceholders) { if (cellNode.neverShowPlaceholders) {
[cellNode recursivelyEnsureDisplay]; [cellNode recursivelyEnsureDisplaySynchronously:YES];
} }
} }

View File

@@ -57,7 +57,7 @@
{ {
if (_ensureDisplayed && self.neverShowPlaceholders) { if (_ensureDisplayed && self.neverShowPlaceholders) {
_ensureDisplayed = NO; _ensureDisplayed = NO;
[self.node recursivelyEnsureDisplay]; [self.node recursivelyEnsureDisplaySynchronously:YES];
} }
[super viewDidLayoutSubviews]; [super viewDidLayoutSubviews];
} }

View File

@@ -65,7 +65,7 @@
if (![ASDisplayNode shouldUseNewRenderingRange]) { if (![ASDisplayNode shouldUseNewRenderingRange]) {
[node recursivelyEnsureDisplay]; // Need to do this without waiting [node recursivelyEnsureDisplaySynchronously:NO];
} else { } else {
// Add the node's layer to an off-screen window to trigger display and mark its contents as non-volatile. // Add the node's layer to an off-screen window to trigger display and mark its contents as non-volatile.
// Use the layer directly to avoid the substantial overhead of UIView heirarchy manipulations. // Use the layer directly to avoid the substantial overhead of UIView heirarchy manipulations.

View File

@@ -90,7 +90,7 @@ typedef NS_OPTIONS(NSUInteger, ASHierarchyState)
* In order to guarantee against deadlocks, this method should only be called on the main thread. * In order to guarantee against deadlocks, this method should only be called on the main thread.
* It may block on the private queue, [_ASDisplayLayer displayQueue] * It may block on the private queue, [_ASDisplayLayer displayQueue]
*/ */
- (void)recursivelyEnsureDisplay; - (void)recursivelyEnsureDisplaySynchronously:(BOOL)synchronously;
/** /**
* @abstract Allows a node to bypass all ensureDisplay passes. Defaults to NO. * @abstract Allows a node to bypass all ensureDisplay passes. Defaults to NO.