Final cleanup for initial version of removing the UIWindow-based render range.

The UIWindow mode remains enabled by default, but rendering and the test suite works correctly both enabled and disabled.
This commit is contained in:
Scott Goodson
2015-12-18 18:47:08 -08:00
parent c6759671e6
commit 578d0f4f78
5 changed files with 10 additions and 34 deletions

View File

@@ -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();

View File

@@ -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);

View File

@@ -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

View File

@@ -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.

View File

@@ -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
}
}