diff --git a/AsyncDisplayKit/ASDisplayNode.mm b/AsyncDisplayKit/ASDisplayNode.mm index 9baec3b662..b00ecc405d 100644 --- a/AsyncDisplayKit/ASDisplayNode.mm +++ b/AsyncDisplayKit/ASDisplayNode.mm @@ -586,6 +586,7 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) - (ASLayout *)measureWithSizeRange:(ASSizeRange)constrainedSize { + NSLog(@"About to measure lock for %@", self); ASDN::MutexLocker l(_propertyLock); return [self __measureWithSizeRange:constrainedSize]; } @@ -666,6 +667,7 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) - (BOOL)shouldRasterizeDescendants { ASDisplayNodeAssertThreadAffinity(self); + NSLog(@"About to descendants lock for %p, %@", self, [self class]); ASDN::MutexLocker l(_propertyLock); return _flags.shouldRasterizeDescendants; } @@ -722,6 +724,7 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) - (void)recursivelyDisplayImmediately { ASDN::MutexLocker l(_propertyLock); + for (ASDisplayNode *child in _subnodes) { [child recursivelyDisplayImmediately]; } @@ -730,12 +733,12 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) - (void)__setNeedsDisplay { + ASDN::MutexLocker l(_propertyLock); + NSLog(@"About to find parent rasterize for %@", self); ASDisplayNode *rasterizedContainerNode = [self __rasterizedContainerNode]; if (rasterizedContainerNode) { [rasterizedContainerNode setNeedsDisplay]; } else { - [_layer setNeedsDisplay]; - if (_layer && !self.isSynchronous && self.displaysAsynchronously) { [ASDisplayNode scheduleNodeForDisplay:self]; } diff --git a/AsyncDisplayKit/Private/ASDisplayNode+UIViewBridge.mm b/AsyncDisplayKit/Private/ASDisplayNode+UIViewBridge.mm index 6f0ecd9dac..a6d4c3b0da 100644 --- a/AsyncDisplayKit/Private/ASDisplayNode+UIViewBridge.mm +++ b/AsyncDisplayKit/Private/ASDisplayNode+UIViewBridge.mm @@ -219,10 +219,8 @@ - (void)setNeedsDisplay { _bridge_prologue; - // Send the message to the layer first, as __setNeedsDisplay may call -displayIfNeeded. - // REVIEW: Audit if this is necessary or if it can be called after like __setNeedsLayout - // -> Likely possible because of the aggregation / trampoline to occur on a later runloop. - _messageToLayer(setNeedsDisplay); + // Send the message to the view/layer first, as __setNeedsDisplay may call -displayIfNeeded. + _messageToViewOrLayer(setNeedsDisplay); [self __setNeedsDisplay]; }