mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-13 09:50:17 +00:00
Add experiment flag to skip layoutIfNeeded in enterPreloadState for ASM nodes (#1201)
This commit is contained in:
parent
706396f7d1
commit
ecfc7835da
@ -3377,7 +3377,8 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) {
|
|||||||
// - If it doesn't have a calculated or pending layout that fits its current bounds, a measurement pass will occur
|
// - If it doesn't have a calculated or pending layout that fits its current bounds, a measurement pass will occur
|
||||||
// (see -__layout and -_u_measureNodeWithBoundsIfNecessary:). This scenario is uncommon,
|
// (see -__layout and -_u_measureNodeWithBoundsIfNecessary:). This scenario is uncommon,
|
||||||
// and running a measurement pass here is a fine trade-off because preloading any time after this point would be late.
|
// and running a measurement pass here is a fine trade-off because preloading any time after this point would be late.
|
||||||
if (self.automaticallyManagesSubnodes) {
|
|
||||||
|
if (self.automaticallyManagesSubnodes && !ASActivateExperimentalFeature(ASExperimentalDidEnterPreloadSkipASMLayout)) {
|
||||||
[self layoutIfNeeded];
|
[self layoutIfNeeded];
|
||||||
}
|
}
|
||||||
[self enumerateInterfaceStateDelegates:^(id<ASInterfaceStateDelegate> del) {
|
[self enumerateInterfaceStateDelegates:^(id<ASInterfaceStateDelegate> del) {
|
||||||
|
|||||||
@ -24,6 +24,7 @@ typedef NS_OPTIONS(NSUInteger, ASExperimentalFeatures) {
|
|||||||
ASExperimentalCollectionTeardown = 1 << 6, // exp_collection_teardown
|
ASExperimentalCollectionTeardown = 1 << 6, // exp_collection_teardown
|
||||||
ASExperimentalFramesetterCache = 1 << 7, // exp_framesetter_cache
|
ASExperimentalFramesetterCache = 1 << 7, // exp_framesetter_cache
|
||||||
ASExperimentalClearDataDuringDeallocation = 1 << 8, // exp_clear_data_during_deallocation
|
ASExperimentalClearDataDuringDeallocation = 1 << 8, // exp_clear_data_during_deallocation
|
||||||
|
ASExperimentalDidEnterPreloadSkipASMLayout = 1 << 9, // exp_did_enter_preload_skip_asm_layout
|
||||||
ASExperimentalFeatureAll = 0xFFFFFFFF
|
ASExperimentalFeatureAll = 0xFFFFFFFF
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,8 @@ NSArray<NSString *> *ASExperimentalFeaturesGetNames(ASExperimentalFeatures flags
|
|||||||
@"exp_network_image_queue",
|
@"exp_network_image_queue",
|
||||||
@"exp_collection_teardown",
|
@"exp_collection_teardown",
|
||||||
@"exp_framesetter_cache",
|
@"exp_framesetter_cache",
|
||||||
@"exp_clear_data_during_deallocation"]));
|
@"exp_clear_data_during_deallocation",
|
||||||
|
@"exp_did_enter_preload_skip_asm_layout"]));
|
||||||
|
|
||||||
if (flags == ASExperimentalFeatureAll) {
|
if (flags == ASExperimentalFeatureAll) {
|
||||||
return allNames;
|
return allNames;
|
||||||
|
|||||||
@ -21,7 +21,8 @@ static ASExperimentalFeatures features[] = {
|
|||||||
ASExperimentalNetworkImageQueue,
|
ASExperimentalNetworkImageQueue,
|
||||||
ASExperimentalCollectionTeardown,
|
ASExperimentalCollectionTeardown,
|
||||||
ASExperimentalFramesetterCache,
|
ASExperimentalFramesetterCache,
|
||||||
ASExperimentalClearDataDuringDeallocation
|
ASExperimentalClearDataDuringDeallocation,
|
||||||
|
ASExperimentalDidEnterPreloadSkipASMLayout
|
||||||
};
|
};
|
||||||
|
|
||||||
@interface ASConfigurationTests : ASTestCase <ASConfigurationDelegate>
|
@interface ASConfigurationTests : ASTestCase <ASConfigurationDelegate>
|
||||||
@ -42,7 +43,8 @@ static ASExperimentalFeatures features[] = {
|
|||||||
@"exp_network_image_queue",
|
@"exp_network_image_queue",
|
||||||
@"exp_collection_teardown",
|
@"exp_collection_teardown",
|
||||||
@"exp_framesetter_cache",
|
@"exp_framesetter_cache",
|
||||||
@"exp_clear_data_during_deallocation"
|
@"exp_clear_data_during_deallocation",
|
||||||
|
@"exp_did_enter_preload_skip_asm_layout",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user