diff --git a/AsyncDisplayKit/ASCellNode.m b/AsyncDisplayKit/ASCellNode.m index 1428682b53..a4357479f9 100644 --- a/AsyncDisplayKit/ASCellNode.m +++ b/AsyncDisplayKit/ASCellNode.m @@ -18,9 +18,6 @@ #pragma mark - #pragma mark ASCellNode -//#define LOG(...) NSLog(__VA_ARGS__) -#define LOG(...) - @implementation ASCellNode - (instancetype)init @@ -67,29 +64,6 @@ } } -- (void)clearFetchedData -{ - [super clearFetchedData]; - LOG(@"%p - clearFetchedData", self); -} - -- (void)fetchData -{ - [super fetchData]; - LOG(@"%p - fetchData", self); -} - -- (void)clearContents -{ - [super clearContents]; - LOG(@"%p - clearContents", self); -} - -- (void)dealloc -{ - LOG(@"%p - dealloc", self); -} - - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { ASDisplayNodeAssertMainThread(); diff --git a/AsyncDisplayKit/ASDisplayNode.mm b/AsyncDisplayKit/ASDisplayNode.mm index b10ffa7521..1ad6732d64 100644 --- a/AsyncDisplayKit/ASDisplayNode.mm +++ b/AsyncDisplayKit/ASDisplayNode.mm @@ -567,7 +567,6 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) - (ASLayout *)measureWithSizeRange:(ASSizeRange)constrainedSize { - //NSLog(@"About to measure lock for %@", self); ASDN::MutexLocker l(_propertyLock); return [self __measureWithSizeRange:constrainedSize]; } @@ -648,7 +647,6 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) - (BOOL)shouldRasterizeDescendants { ASDisplayNodeAssertThreadAffinity(self); - //NSLog(@"About to descendants lock for %p, %@", self, [self class]); ASDN::MutexLocker l(_propertyLock); ASDisplayNodeAssert(!((_hierarchyState & ASHierarchyStateRasterized) && _flags.shouldRasterizeDescendants), @"Subnode of a rasterized node should not have redundant shouldRasterizeDescendants enabled"); @@ -1518,8 +1516,6 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) - (void)__recursivelyTriggerDisplayAndBlock:(BOOL)shouldBlock { ASDisplayNodeAssertMainThread(); -// ASDisplayNodeAssert(self.isNodeLoaded, @"Node must have layer or view loaded to use -recursivelyEnsureDisplay"); -// ASDisplayNodeAssert(self.inHierarchy && (self.isLayerBacked || self.view.window != nil), @"Node must be in a hierarchy to use -recursivelyEnsureDisplay"); CALayer *layer = self.layer; // -layoutIfNeeded is recursive, and even walks up to superlayers to check if they need layout, @@ -2160,7 +2156,9 @@ static void _recursivelySetDisplaySuspended(ASDisplayNode *node, CALayer *layer, return _replaceAsyncSentinel != nil; } -// FIXME: This method doesn't appear to be called, and should be removed. +// FIXME: This method doesn't appear to be called, and could be removed. +// However, it may be useful for an API similar to what Paper used to create a new node hierarchy, +// trigger asynchronous measurement and display on it, and have it swap out and replace an old hierarchy. - (ASSentinel *)_asyncReplaceSentinel { ASDN::MutexLocker l(_propertyLock); diff --git a/AsyncDisplayKit/Details/ASRangeHandlerRender.mm b/AsyncDisplayKit/Details/ASRangeHandlerRender.mm index 756338f8ea..4872707e7e 100644 --- a/AsyncDisplayKit/Details/ASRangeHandlerRender.mm +++ b/AsyncDisplayKit/Details/ASRangeHandlerRender.mm @@ -12,8 +12,6 @@ #import "ASDisplayNode+Subclasses.h" #import "ASDisplayNode+FrameworkPrivate.h" -#define USE_WORKING_WINDOW 1 - @interface ASRangeHandlerRender () @property (nonatomic,readonly) UIWindow *workingWindow; @end diff --git a/AsyncDisplayKit/Private/ASDisplayNode+FrameworkPrivate.h b/AsyncDisplayKit/Private/ASDisplayNode+FrameworkPrivate.h index 58cc12c35c..0ad88aafcb 100644 --- a/AsyncDisplayKit/Private/ASDisplayNode+FrameworkPrivate.h +++ b/AsyncDisplayKit/Private/ASDisplayNode+FrameworkPrivate.h @@ -19,6 +19,10 @@ #import "ASThread.h" #import "ASLayoutOptions.h" +// Project-wide control for whether the offscreen UIWindow is used for display, or if +// ASDK's internal system for coalescing and triggering display events is used. +#define USE_WORKING_WINDOW 1 + /** Hierarchy state is propogated from nodes to all of their children when certain behaviors are required from the subtree. Examples include rasterization and external driving of the .interfaceState property. diff --git a/AsyncDisplayKit/Private/ASDisplayNode+UIViewBridge.mm b/AsyncDisplayKit/Private/ASDisplayNode+UIViewBridge.mm index a34d1fd1ec..2239cc038a 100644 --- a/AsyncDisplayKit/Private/ASDisplayNode+UIViewBridge.mm +++ b/AsyncDisplayKit/Private/ASDisplayNode+UIViewBridge.mm @@ -247,10 +247,12 @@ // -setNeedsDisplay to the CALayer will result in a synchronous display in the next frame. _messageToViewOrLayer(setNeedsDisplay); + +#if !USE_WORKING_WINDOW if (_layer && !self.isSynchronous) { [ASDisplayNode scheduleNodeForDisplay:self]; } - +#endif } }