File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 294294 */
295295@property (nonatomic , assign ) BOOL shouldRasterizeDescendants;
296296
297- /* *
298- * @abstract Calls -setNeedsDisplay and -displayIfNeeded on the node's backing store.
299- *
300- * @note This method must be called on the main thread but there are plans to allow this on any thread.
301- */
302- - (void )display ;
303-
304- /* *
305- * @abstract Call -display on the node and recursively on all subnodes, forcing the entire node hierarchy to be
306- * displayed.
307- */
308- - (void )recursivelyDisplay ;
309-
310- /* *
311- * @abstract Display the node's view/layer immediately on the current thread, bypassing the background thread rendering.
312- */
313- - (void )displayImmediately ;
314-
315297/* *
316298 * @abstract Prevent the node's layer from displaying.
317299 *
Original file line number Diff line number Diff line change @@ -434,33 +434,6 @@ - (void)setContentsScaleForDisplay:(CGFloat)contentsScaleForDisplay
434434 _contentsScaleForDisplay = contentsScaleForDisplay;
435435}
436436
437- - (void )display
438- {
439- ASDisplayNodeAssertMainThread ();
440- ASDisplayNodeAssert (self.nodeLoaded , @" backing store must be loaded before calling -display" );
441-
442- // rendering a backing store requires a node be laid out
443- [self __layout ];
444-
445- CALayer *layer = [self isLayerBacked ] ? self.layer : self.view .layer ;
446-
447- if (layer.contents ) {
448- return ;
449- }
450-
451- [layer setNeedsDisplay ];
452- [layer displayIfNeeded ];
453- }
454-
455- - (void )recursivelyDisplay
456- {
457- for (ASDisplayNode *node in self.subnodes ) {
458- [node recursivelyDisplay ];
459- }
460-
461- [self display ];
462- }
463-
464437- (void )displayImmediately
465438{
466439 ASDisplayNodeAssertMainThread ();
Original file line number Diff line number Diff line change 1313#import " ASDisplayNodeInternal.h"
1414#import " ASRangeControllerInternal.h"
1515
16+ @interface ASDisplayNode (ASRangeController)
17+
18+ - (void )display ;
19+ - (void )recursivelyDisplay ;
20+
21+ @end
22+
23+ @implementation ASDisplayNode (ASRangeController)
24+
25+ - (void )display
26+ {
27+ ASDisplayNodeAssertMainThread ();
28+ ASDisplayNodeAssert (self.nodeLoaded , @" backing store must be loaded before calling -display" );
29+
30+ CALayer *layer = self.layer ;
31+
32+ // rendering a backing store requires a node be laid out
33+ [layer setNeedsLayout ];
34+ [layer layoutIfNeeded ];
35+
36+ if (layer.contents ) {
37+ return ;
38+ }
39+
40+ [layer setNeedsDisplay ];
41+ [layer displayIfNeeded ];
42+ }
43+
44+ - (void )recursivelyDisplay
45+ {
46+ for (ASDisplayNode *node in self.subnodes ) {
47+ [node recursivelyDisplay ];
48+ }
49+
50+ [self display ];
51+ }
52+
53+ @end
54+
1655@interface ASRangeController () {
1756 // index path -> node mapping
1857 NSMutableDictionary *_nodes;
Original file line number Diff line number Diff line change @@ -115,6 +115,9 @@ void ASDisplayNodePerformBlockOnMainThread(void (^block)());
115115// Call didExitHierarchy if necessary and set inHierarchy = NO if visibility notifications are enabled on all of its parents
116116- (void )__exitHierarchy ;
117117
118+ // Display the node's view/layer immediately on the current thread, bypassing the background thread rendering. Will be deprecated.
119+ - (void )displayImmediately ;
120+
118121// Returns the ancestor node that rasterizes descendants, or nil if none.
119122- (ASDisplayNode *)__rasterizedContainerNode ;
120123
You can’t perform that action at this time.
0 commit comments