* Add test case for TextKit truncation style
* Add fast path for text node measurement with default truncation
* Use fast path more often
* Reverse options order
* Simplify implementation – no functional change
* Share "isScaled" variable
* Intersect with constrained rect
* Add a failing test case for fast-path truncation
* Add some more truncation tests, using slow path as reference image
* Update the tests
* In ASTextKitRenderer, intersect bounds with constrained rect
* Add test case for TextKit truncation style
* Add fast path for text node measurement with default truncation
* Use fast path more often
* Reverse options order
* Simplify implementation – no functional change
* Share "isScaled" variable
* Intersect with constrained rect
* Add a failing test case for fast-path truncation
* Add some more truncation tests, using slow path as reference image
* Update the tests
* In ASTextKitRenderer, intersect bounds with constrained rect
* Use maximumNumberOfLines property in text kit fast path
Add reference images
Disable fast-path for max-one-line case
* Remove unneeded snapshot files
* [ASRunLoopQueue - Performance] Add ASDeallocQueue for efficient object teardown.
This measurably reduces block overhead and context switching. In the layout benchmark,
it increases ops/s while actually reducing CPU utilization. This suggests that we are
now at a lock-bounded local maximum, at least for tri-core devices.
* [ASDeallocQueue] Update convenience helper method and adopt in ASImageNode etc.
* [ASDeallocQueue] Reimplement the queue using a timer-based runloop.
* [Debugging] Re-enable ASDisplayNode Event Log.
* [ASDeallocQueue] Final refinements, comments, code minimization.
* [ASDeallocQueue] Fix for lock release needed in early return (refactoring typo from last commit)
* Initial commit for adding a size constraint to ASLayoutable's
* Some more commits
* Fix sample projects in extra/
* Remove preferredFrameSize test of ASEditableTextNode
* Remove preferredFrameSize from examples_extra
* Add deprecation warning to -[ASDisplayNode preferredFrameSize]
* Add deprecation warning to -[ASDisplayNode measureWithSizeRange:]
* Commit
* Commit
* Remove ASRelativeSizeRange
* Make ASRelativeSize private
* Adjust examples
* Improve setting of -[ASLayoutable size] with points or fractions
* Add ASWrapperLayoutSpec
* Improve creation of ASRelativeDimension
* Add `preferredFrameSize` back and add deprecated logging
* Add `layoutSpecBlock` setter and getter and add locking for it
* Add better documentation and fix macros to create ASRelativeDimension
* Create new ASSizeRangeMake with just a CGSize as parameter
* Update Kitten and Social App Layout example
* Add layoutThatFits: and deprecate measure:
* Rename ASRelativeDimension to ASDimension
* Fix examples for ASDimension renaming
* Remove fancy height and width setter
* Fix ASDimension helper
* Rename -[ASLayout layoutableObject] to -[ASLayout layoutable]
* Update layout related methods and more clearer documentation around how to use it
* Deprecate old ASLayout class constructors
* Don't unnecessary recalculate layout if constrained or parent size did not change
* Use shared pointer for ASDisplayNodeLayout
* Fix rebase conflicts
* Add documentation and move implementation in mm file of ASDisplayNodeLayout
* Fix test errors
* Rename ASSize to ASLayoutableSize
* Address comments
* Rename setSizeFromCGSize to setSizeWithCGSize
* Improve inline functions in ASDimension
* Fix rebase conflicts
* Add cache implementation
* Remove old ASEqualityHashHelpers
* Some more ASEquality and ASEqualityHashHelper cleanup
* Add cache for text renderer in ASTextNode
* Move from C++ LRU renderer cache to NSCache based renderer cache
* [Optimization] Convert to type-generic math
* add std:: prefix in obj-c++ files
* more cleanup
* revert test changes
* convert min and max back to fmin/fmax
Throw away the all subcomponents to create them with the new constrained size new as well as let the truncater do it's job again for the new constrained size. This is necessary as after a truncation did happen the context would use the truncated string and not the original string to truncate based on the new constrained size
This reverts commit 6238e5edbde55fb82982ce4a19a0cbca7fe7eb9d.
We will re-apply this change, but there are some early signs of performance impacts that need to be investigated.
* Before truncate a text storage in ASTextKitContext reset the text storage to original value
* Fix ASTextNode tests
We should pass in the constrained size in both cases and the sizes should be the same. We adjust the calculated size in ASTextNode to be a bit narrower in the second case if we truncate again with the calculated size as constrained size it will truncate more and the resulting size will shrink.
The crash happens in the placeholderImage of ASTextNode. The node is not visible in the time it try to get the `placeholderImage` and so the `visibleRange` has count 0 and a crash happens while accessing the first object of an empty array.
Summary: Previously the first thing we did when calculating the size of text was to truncate it. This could lead to ASFontSizeAdjuster being sent a truncated string which, obviously, never needed to shrink. If we change the order then we first shrink, then truncate if still necessary.
Reviewers: scottg, levi, garrett
Differential Revision: https://phabricator.pinadmin.com/D89780
Summary: Looks like this isn't being locked when it should be.
Reviewers: ricky, levi, scottg, schneider
Reviewed By: scottg, schneider
Subscribers: jenkins
Differential Revision: https://phabricator.pinadmin.com/D84952