Skip to content

Commit

Permalink
Ship ASExperimentalFixRangeController (TextureGroup#1486)
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhuy authored and hebertialmeida committed May 10, 2019
1 parent cdfa08f commit d758fc7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 28 deletions.
1 change: 0 additions & 1 deletion Schemas/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"exp_dispatch_apply",
"exp_image_downloader_priority",
"exp_text_drawing",
"exp_fix_range_controller",
"exp_oom_bg_dealloc_disable",
"exp_transaction_operation_retain_cycle",
"exp_remove_textkit_initialising_lock"
Expand Down
9 changes: 4 additions & 5 deletions Source/ASExperimentalFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ typedef NS_OPTIONS(NSUInteger, ASExperimentalFeatures) {
ASExperimentalDispatchApply = 1 << 9, // exp_dispatch_apply
ASExperimentalImageDownloaderPriority = 1 << 10, // exp_image_downloader_priority
ASExperimentalTextDrawing = 1 << 11, // exp_text_drawing
ASExperimentalFixRangeController = 1 << 12, // exp_fix_range_controller
ASExperimentalOOMBackgroundDeallocDisable = 1 << 13, // exp_oom_bg_dealloc_disable
ASExperimentalTransactionOperationRetainCycle = 1 << 14, // exp_transaction_operation_retain_cycle
ASExperimentalRemoveTextKitInitialisingLock = 1 << 15, // exp_remove_textkit_initialising_lock
ASExperimentalDrawingGlobal = 1 << 16, // exp_drawing_global
ASExperimentalOOMBackgroundDeallocDisable = 1 << 12, // exp_oom_bg_dealloc_disable
ASExperimentalTransactionOperationRetainCycle = 1 << 13, // exp_transaction_operation_retain_cycle
ASExperimentalRemoveTextKitInitialisingLock = 1 << 14, // exp_remove_textkit_initialising_lock
ASExperimentalDrawingGlobal = 1 << 15, // exp_drawing_global
ASExperimentalFeatureAll = 0xFFFFFFFF
};

Expand Down
1 change: 0 additions & 1 deletion Source/ASExperimentalFeatures.mm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
@"exp_dispatch_apply",
@"exp_image_downloader_priority",
@"exp_text_drawing",
@"exp_fix_range_controller",
@"exp_oom_bg_dealloc_disable",
@"exp_transaction_operation_retain_cycle",
@"exp_remove_textkit_initialising_lock",
Expand Down
22 changes: 3 additions & 19 deletions Source/Details/ASRangeController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -356,29 +356,13 @@ - (void)_updateVisibleNodeIndexPaths
// DO NOT set Visible: even though these elements are in the visible range / "viewport",
// our overall container object is itself not yet, or no longer, visible.
// The moment it becomes visible, we will run the condition above.

ASInterfaceState interfaceStateBeforeFix = interfaceState;
if ([allCurrentIndexPaths containsObject:indexPath]) {
interfaceStateBeforeFix |= ASInterfaceStatePreload;
if (rangeMode != ASLayoutRangeModeLowMemory) {
interfaceStateBeforeFix |= ASInterfaceStateDisplay;
}
}

ASInterfaceState interfaceStateAfterFix = interfaceState;
if ([visibleIndexPaths containsObject:indexPath]) {
interfaceStateAfterFix |= ASInterfaceStatePreload;
interfaceState |= ASInterfaceStatePreload;
if (rangeMode != ASLayoutRangeModeLowMemory) {
interfaceStateAfterFix |= ASInterfaceStateDisplay;
interfaceState |= ASInterfaceStateDisplay;
}
} else if ([displayIndexPaths containsObject:indexPath]) {
interfaceStateAfterFix |= ASInterfaceStatePreload;
}

if (interfaceStateBeforeFix != interfaceStateAfterFix && ASActivateExperimentalFeature(ASExperimentalFixRangeController)) {
interfaceState = interfaceStateAfterFix;
} else {
interfaceState = interfaceStateBeforeFix;
interfaceState |= ASInterfaceStatePreload;
}
}

Expand Down
2 changes: 0 additions & 2 deletions Tests/ASConfigurationTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
ASExperimentalDispatchApply,
ASExperimentalImageDownloaderPriority,
ASExperimentalTextDrawing,
ASExperimentalFixRangeController,
ASExperimentalOOMBackgroundDeallocDisable,
ASExperimentalTransactionOperationRetainCycle,
ASExperimentalRemoveTextKitInitialisingLock,
Expand Down Expand Up @@ -59,7 +58,6 @@ + (NSArray *)names {
@"exp_dispatch_apply",
@"exp_image_downloader_priority",
@"exp_text_drawing",
@"exp_fix_range_controller",
@"exp_oom_bg_dealloc_disable",
@"exp_transaction_operation_retain_cycle",
@"exp_remove_textkit_initialising_lock",
Expand Down

0 comments on commit d758fc7

Please sign in to comment.