mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
PR #1000 on GitHub! Provide a Beta API to enable the new, high efficiency render-ahead mechanism.
This commit is contained in:
@@ -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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user