mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 11:20:18 +00:00
Clean up timing of layout tree flattening/ copying of unflattened tree for Weaver (#1157)
* Simpler Huy fix for more efficient delayed flattening of the layout tree * Nit * Remove pbx changes * Update CHANGELOG.md * Add note about change in timing of _flattenedLayout capture
This commit is contained in:
parent
5e0579308d
commit
9588692361
@ -51,6 +51,7 @@
|
|||||||
- Optimize layout process by removing `ASRectMap`. [Adlai Holler](https://github.com/Adlai-Holler)
|
- Optimize layout process by removing `ASRectMap`. [Adlai Holler](https://github.com/Adlai-Holler)
|
||||||
- Remove necessity to use view to access rangeController in ASTableNode, ASCollectionNode. [Michael Schneider](https://github.com/maicki)
|
- Remove necessity to use view to access rangeController in ASTableNode, ASCollectionNode. [Michael Schneider](https://github.com/maicki)
|
||||||
- Remove display node's reliance on shared_ptr. [Adlai Holler](https://github.com/Adlai-Holler)
|
- Remove display node's reliance on shared_ptr. [Adlai Holler](https://github.com/Adlai-Holler)
|
||||||
|
- Clean up timing of layout tree flattening/ copying of unflattened tree for Weaver. [Michael Zuccarino](https://github.com/mikezucc) [#1157](https://github.com/TextureGroup/Texture/pull/1157)
|
||||||
|
|
||||||
## 2.7
|
## 2.7
|
||||||
- Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877)
|
- Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877)
|
||||||
|
|||||||
@ -993,12 +993,6 @@ ASLayoutElementStyleExtensibilityForwarding
|
|||||||
_pendingLayoutTransition = nil;
|
_pendingLayoutTransition = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)_setCalculatedDisplayNodeLayout:(const ASDisplayNodeLayout &)displayNodeLayout
|
|
||||||
{
|
|
||||||
ASDN::MutexLocker l(__instanceLock__);
|
|
||||||
[self _locked_setCalculatedDisplayNodeLayout:displayNodeLayout];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)_locked_setCalculatedDisplayNodeLayout:(const ASDisplayNodeLayout &)displayNodeLayout
|
- (void)_locked_setCalculatedDisplayNodeLayout:(const ASDisplayNodeLayout &)displayNodeLayout
|
||||||
{
|
{
|
||||||
ASAssertLocked(__instanceLock__);
|
ASAssertLocked(__instanceLock__);
|
||||||
@ -1007,12 +1001,6 @@ ASLayoutElementStyleExtensibilityForwarding
|
|||||||
ASDisplayNodeAssertTrue(displayNodeLayout.layout.size.height >= 0.0);
|
ASDisplayNodeAssertTrue(displayNodeLayout.layout.size.height >= 0.0);
|
||||||
|
|
||||||
_calculatedDisplayNodeLayout = displayNodeLayout;
|
_calculatedDisplayNodeLayout = displayNodeLayout;
|
||||||
|
|
||||||
// Flatten the layout if it wasn't done before (@see -calculateLayoutThatFits:).
|
|
||||||
if ([ASDisplayNode shouldStoreUnflattenedLayouts]) {
|
|
||||||
_unflattenedLayout = _calculatedDisplayNodeLayout.layout;
|
|
||||||
_calculatedDisplayNodeLayout.layout = [_unflattenedLayout filteredNodeLayoutTree];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -1220,11 +1220,11 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__);
|
|||||||
}
|
}
|
||||||
ASDisplayNodeLogEvent(self, @"computedLayout: %@", layout);
|
ASDisplayNodeLogEvent(self, @"computedLayout: %@", layout);
|
||||||
|
|
||||||
// Return the (original) unflattened layout if it needs to be stored. The layout will be flattened later on (@see _locked_setCalculatedDisplayNodeLayout:).
|
// PR #1157: Reduces accuracy of _unflattenedLayout for debugging/Weaver
|
||||||
// Otherwise, flatten it right away.
|
if ([ASDisplayNode shouldStoreUnflattenedLayouts]) {
|
||||||
if (! [ASDisplayNode shouldStoreUnflattenedLayouts]) {
|
_unflattenedLayout = layout;
|
||||||
layout = [layout filteredNodeLayoutTree];
|
|
||||||
}
|
}
|
||||||
|
layout = [layout filteredNodeLayoutTree];
|
||||||
|
|
||||||
return layout;
|
return layout;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user