* 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)
* Improve ASDimensionMake via NSString
- ASXCTAssertEqualDimensions
- Add support for "auto"
- Assert if given an empty or invalid string
* Address comments
* Add ASCGFloatFromString and ASCGFloatFromNumber
* Rename CGRect+ASConvenience to CoreGraphics+ASConvenience
* Add style property to ASLayoutable
* Add styles property to further layout specs
* Adjust some examples
* Add `loadStyle` to create the style object in a ASLayoutable
* Revert "Add `loadStyle` to create the style object in a ASLayoutable"
This reverts commit 2b7240f2c7dc993e38cadf290cfdf08482dd70c7.
* Revert "Adjust some examples"
This reverts commit 3254ae0a321e75db3ecfa80adee9d96bde93a33d.
* Revert "Add styles property to further layout specs"
This reverts commit c779dcb876ead27122c1af1300146a6ad36912cb.
* Rename ASLayoutableStyleDeclaration to ASLayoutableStyle
* Add styleClass class property for extensibility support of the ASLayoutable style object
* flexShrink should not be YES by default
* 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
* Add a mechanism to save attributed strings given to text nodes
* Setup performance tests to have an iteration variable
* Use realistic data in new text node performance test case
* Revert temporary changes
* [ASTextNode] Fix highlighting when textContainerInsets are set.
* Add ASTextNodeSnapshotTests to xcodeproj.
* Add snapshot test for container inset and highlighting.
* [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
Using Objective-C attributes, in this case `unavailable`, we can hide
unsupported APIs at compile time instead of detecting and warn about it
at runtime with a set of asserts.
* Fix ASTextNode's ascender to also include the line height specified by paragraph style in the attributed string.
* Merge conflict (original patch is for an old version)
I have a subclass of `ASTextNode` that uses `pointSizeScaleFactors`. Currently I have to recompute the scale factors any time the font size changes. If `_rendererAttributes` used the property accesor for the scale factors I would only have to create them when asked. I hope this little change can make it in :)
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
* [ASTextNode, ASVideoNode] Use ASDisplayNode base class lock for subclass property synchronization
* fix headers to match master
* address @appleguy, @maicki comments
* import header
* Swap lock in ASNetworkImageNode as well
* remove invalid comment
* more cleanup of locks
Update drawing on demand if properties change and not on every drawing cycle. This should reduce the overhead to access properties from the view / layer for the drawing parameters.
- Add locking to _linkAttributeValueAtPoint:attributeName:range:inAdditionalTruncationMessage:forHighlighting: as we access the attributed text in there
- Add locking to touchesBegan:withEvent: as we are accessing the [ASTextKitRenderer firstVisibleRange]
- Add locking for highlightStyle
- Move accessing delegate property access to instance variable access
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.
- Deprecate attributedString in ASTextNode in favor of attributedText to be aligned with UILabel
- Deprecate truncationAttributedString in ASTextNode in favor of truncationAttributedText to be aligned with attributedText
- Refactor naming of ASEnvironmentCollection to ASEnvironmentState
- Remove struct pointers
- Move ASEnvironmentStatePropagation to a enum class
- Move merge functions to pure functions
- Move ASLayoutOptionsForwarding and ASLayoutableExtensibility into ASLayoutSpec and ASDisplayNode
- Remove ASLayoutableSetValuesForLayoutable and move into explicit classes (ASDisplayNode, ASTextNode)