|
17 | 17 |
|
18 | 18 | #import <AsyncDisplayKit/ASDisplayNodeInternal.h> |
19 | 19 |
|
| 20 | +#import <AsyncDisplayKit/ASDisplayNode+Ancestry.h> |
20 | 21 | #import <AsyncDisplayKit/ASDisplayNode+FrameworkSubclasses.h> |
21 | 22 | #import <AsyncDisplayKit/ASDisplayNode+Beta.h> |
22 | 23 | #import <AsyncDisplayKit/ASDisplayNode+Deprecated.h> |
@@ -600,9 +601,9 @@ - (CALayer *)_locked_layerToLoad |
600 | 601 | return layer; |
601 | 602 | } |
602 | 603 |
|
603 | | -- (void)_locked_loadViewOrLayerIsLayerBacked:(BOOL)isLayerBacked |
| 604 | +- (void)_locked_loadViewOrLayer |
604 | 605 | { |
605 | | - if (isLayerBacked) { |
| 606 | + if (_flags.layerBacked) { |
606 | 607 | TIME_SCOPED(_debugTimeToCreateView); |
607 | 608 | _layer = [self _locked_layerToLoad]; |
608 | 609 | static int ASLayerDelegateAssociationKey; |
@@ -692,7 +693,7 @@ - (UIView *)view |
692 | 693 |
|
693 | 694 | // Loading a view needs to happen on the main thread |
694 | 695 | ASDisplayNodeAssertMainThread(); |
695 | | - [self _locked_loadViewOrLayerIsLayerBacked:isLayerBacked]; |
| 696 | + [self _locked_loadViewOrLayer]; |
696 | 697 |
|
697 | 698 | // FIXME: Ideally we'd call this as soon as the node receives -setNeedsLayout |
698 | 699 | // but automatic subnode management would require us to modify the node tree |
@@ -727,20 +728,13 @@ - (CALayer *)layer |
727 | 728 | return _layer; |
728 | 729 | } |
729 | 730 |
|
730 | | - BOOL isLayerBacked = _flags.layerBacked; |
731 | | - if (!isLayerBacked) { |
732 | | - // No need for the lock and call the view explicitly in case it needs to be loaded first |
733 | | - ASDN::MutexUnlocker u(__instanceLock__); |
734 | | - return self.view.layer; |
735 | | - } |
736 | | - |
737 | 731 | if (![self _locked_shouldLoadViewOrLayer]) { |
738 | 732 | return nil; |
739 | 733 | } |
740 | 734 |
|
741 | 735 | // Loading a layer needs to happen on the main thread |
742 | 736 | ASDisplayNodeAssertMainThread(); |
743 | | - [self _locked_loadViewOrLayerIsLayerBacked:isLayerBacked]; |
| 737 | + [self _locked_loadViewOrLayer]; |
744 | 738 |
|
745 | 739 | // FIXME: Ideally we'd call this as soon as the node receives -setNeedsLayout |
746 | 740 | // but automatic subnode management would require us to modify the node tree |
@@ -3909,8 +3903,8 @@ - (ASEventLog *)eventLog |
3909 | 3903 | [result addObject:@{ @"frame" : [NSValue valueWithCGRect:_pendingViewState.frame] }]; |
3910 | 3904 | } |
3911 | 3905 |
|
3912 | | - // Check supernode so that if we are cell node we don't find self. |
3913 | | - ASCellNode *cellNode = ASDisplayNodeFindFirstSupernodeOfClass(self.supernode, [ASCellNode class]); |
| 3906 | + // Check supernode so that if we are a cell node we don't find self. |
| 3907 | + ASCellNode *cellNode = [self supernodeOfClass:[ASCellNode class] includingSelf:NO]; |
3914 | 3908 | if (cellNode != nil) { |
3915 | 3909 | [result addObject:@{ @"cellNode" : ASObjectDescriptionMakeTiny(cellNode) }]; |
3916 | 3910 | } |
|
0 commit comments