* Remove experimental features
* prevent blocking main thread
* remove small content all together as none is the default
* Update ASExperimentalFeatures.h
~/Texture/Source/Private/ASMutableElementMap.mm:32:24: warning: Conversion from value of type 'NSMutableArray<NSMutableArray *> *' to incompatible type 'ASMutableCollectionElementTwoDimensionalArray *'
_sectionsOfItems = (id)ASTwoDimensionalArrayDeepMutableCopy(items);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
* Rename ASDN C++ namespace to "AS." Referring to the framework as ASDisplayNode is pretty out-dated and verbose. See CoreAnimation which usees CA for their internal namespace.
More using
* More cases
* Adds support for using UIGraphicsImageRenderer in ASTextNode.
In many cases this reduces the backing store of text nodes by 1/2.
* Guard for UIGraphicsRenderer availability.
* Comma
Found by Clang Static Analyzer:
~/Texture/Source/ASTextNode2.mm:663:39: warning: Potential leak of an object stored into 'truncationTokenLine'
CTLineRef truncationTokenLine = CTLineCreateWithAttributedString((CFAttributedStringRef)_truncationAttributedText);
^
~/Texture/Source/ASTextNode2.mm:666:49: warning: Potential leak of an object stored into 'additionalTruncationTokenLine'
CTLineRef additionalTruncationTokenLine = CTLineCreateWithAttributedString((CFAttributedStringRef)_additionalTruncationMessage);
^
2 warnings generated.
Before the change: both - (void)setShouldInvertStrongReference:(BOOL)shouldInvertStrongReference and - (void)setNode:(ASDisplayNode *)node will call through [self setupReferencesWithNode:node]; which call the [node addInterfaceStateDelegate:self];
Luckily it seems this didn't cause huge memory bloat because there's
a check below that keeps the display flag from being set in low memory
conditions when the node is off the screen.
Right now when an image node enters preload state, we kick off an image request with the default priority. Then when it enters display state, we change the priority to "imminent" which is mapped to the default priority as well. This means that requests from preload and display nodes have the same priority and are put to the same pool. The right behavior would be that preload requests should have a lower priority from the beginning.
Another problem is that, due to the execution order of -didEnter(Preload|Display|Visible)State calls, a node may kick off a low priority request when it enters preload state even though it knows that it's also visible. By the time -didEnterVisibleState is called, the low priority request may have already been consumed and the download/data task won't pick up the new higher priority, or some work needs to be done to move it to another queue. A better behavior would be to always use the current interface state to determine the priority. This means that visible nodes will kick off high priority requests as soon as -didEnterPreloadState is called.
The last (and smaller) issue is that a node marks its request as preload/low priority as soon as it exits visible state. I'd argue that this is too agressive. It may be reasonble for nodes in the trailing direction. Even so, we already handle this case by (almost always) have smaller trailing buffers. So this diff makes sure that nodes that exited visible state will have imminent/default priority if they remain in the display range.
All of these new behaviors are wrapped in an experiment and will be tested carefully before being rolled out.
* Add imports
* Fix build failure
* Encapsulate common logics into methods
* Address comments
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.