From 0a6e36a239201b8025765c11d9210e4fac86c69f Mon Sep 17 00:00:00 2001 From: Rene Cacheaux Date: Sun, 12 Oct 2014 09:02:59 -0500 Subject: [PATCH] Adds check for nodes who should rasterize descendants and opts to recurse down the subnode hierarchy in _recursiveSetPreventOrCancelDisplay. --- AsyncDisplayKit/ASDisplayNode.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AsyncDisplayKit/ASDisplayNode.mm b/AsyncDisplayKit/ASDisplayNode.mm index d5b0556a66..e73641810a 100644 --- a/AsyncDisplayKit/ASDisplayNode.mm +++ b/AsyncDisplayKit/ASDisplayNode.mm @@ -1290,13 +1290,13 @@ static void _recursiveSetPreventOrCancelDisplay(ASDisplayNode *node, CALayer *la // Set the flag on the node. If this is a pure layer (no node) then this has no effect (plain layers don't support preventing/cancelling display). node.preventOrCancelDisplay = flag; - if (layer) { + if (layer && !node.shouldRasterizeDescendants) { // If there is a layer, recurse down the layer hierarchy to set the flag on descendants. This will cover both layer-based and node-based children. for (CALayer *sublayer in layer.sublayers) { _recursiveSetPreventOrCancelDisplay(nil, sublayer, flag); } } else { - // If there is no layer (view not loaded yet), recurse down the subnode hierarchy to set the flag on descendants. This covers only node-based children, but for a node whose view is not loaded it can't possibly have nodeless children. + // If there is no layer (view not loaded yet) or this node rasterizes descendants (there won't be a layer tree to traverse), recurse down the subnode hierarchy to set the flag on descendants. This covers only node-based children, but for a node whose view is not loaded it can't possibly have nodeless children. for (ASDisplayNode *subnode in node.subnodes) { _recursiveSetPreventOrCancelDisplay(subnode, nil, flag); }