Merge pull request #140 from facebook/manual-display-part-deux

Update manual display logic
This commit is contained in:
Nadine Salter
2014-12-04 12:57:03 -08:00
4 changed files with 42 additions and 45 deletions

View File

@@ -434,33 +434,6 @@ void ASDisplayNodePerformBlockOnMainThread(void (^block)())
_contentsScaleForDisplay = contentsScaleForDisplay;
}
- (void)display
{
ASDisplayNodeAssertMainThread();
ASDisplayNodeAssert(self.nodeLoaded, @"backing store must be loaded before calling -display");
// rendering a backing store requires a node be laid out
[self __layout];
CALayer *layer = [self isLayerBacked] ? self.layer : self.view.layer;
if (layer.contents) {
return;
}
[layer setNeedsDisplay];
[layer displayIfNeeded];
}
- (void)recursivelyDisplay
{
for (ASDisplayNode *node in self.subnodes) {
[node recursivelyDisplay];
}
[self display];
}
- (void)displayImmediately
{
ASDisplayNodeAssertMainThread();