Revert "Switch to use only layers for offscreen working range window."

There is an unsolved issue with this optimization that may cause crashes
in certain cases.  Reverting until it's properly resolved.  It doesn't
appear to be possible to cause the issue in the test apps used to develop it.

This reverts commit 3f982b5c9a.
This commit is contained in:
Scott Goodson
2015-08-17 17:19:51 -07:00
committed by rcancro
parent f7e94f42ed
commit e005a83a2b

View File

@@ -39,12 +39,8 @@
[node recursivelySetDisplaySuspended:NO];
// 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.
// Any view-backed nodes will still create their views in order to assemble the layer heirarchy, and they will
// also assemble a view subtree for the node, but we avoid the much more significant expense triggered by a view
// being added or removed from an onscreen window (responder chain setup, will/DidMoveToWindow: recursive calls, etc)
[[[self.class workingWindow] layer] addSublayer:node.layer];
// add the node to an off-screen window to force display and preserve its contents
[[self.class workingWindow] addSubnode:node];
}
- (void)node:(ASDisplayNode *)node exitedRangeOfType:(ASLayoutRangeType)rangeType
@@ -53,7 +49,7 @@
ASDisplayNodeAssert(rangeType == ASLayoutRangeTypeRender, @"Render delegate should not handle other ranges");
[node recursivelySetDisplaySuspended:YES];
[node.layer removeFromSuperlayer];
[node.view removeFromSuperview];
[node recursivelyClearContents];
}