mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: An experiment where we use `LayoutMetrics::overflowInset` to optimize performance of hit-testing algorithm. In my measurements enabling this feature drastically (2x) reduced amount of calls to `hitTest:withEvent:` method. Reviewed By: sammy-SC Differential Revision: D23669091 fbshipit-source-id: ac6dadc90b6a2fbb45e41e0d4a113bd5ae8f1218
57 lines
1.2 KiB
Objective-C
57 lines
1.2 KiB
Objective-C
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import "RCTConstants.h"
|
|
|
|
NSString *const RCTUserInterfaceStyleDidChangeNotification = @"RCTUserInterfaceStyleDidChangeNotification";
|
|
NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollectionKey = @"traitCollection";
|
|
|
|
/*
|
|
* On-demand view mounting
|
|
*/
|
|
static BOOL RCTExperimentOnDemandViewMounting = NO;
|
|
|
|
BOOL RCTExperimentGetOnDemandViewMounting()
|
|
{
|
|
return RCTExperimentOnDemandViewMounting;
|
|
}
|
|
|
|
void RCTExperimentSetOnDemandViewMounting(BOOL value)
|
|
{
|
|
RCTExperimentOnDemandViewMounting = value;
|
|
}
|
|
|
|
/*
|
|
* Sync performance flag
|
|
*/
|
|
static BOOL RCTExperimentSyncPerformanceFlag = NO;
|
|
|
|
BOOL RCTExperimentGetSyncPerformanceFlag()
|
|
{
|
|
return RCTExperimentSyncPerformanceFlag;
|
|
}
|
|
|
|
void RCTExperimentSetSyncPerformanceFlag(BOOL value)
|
|
{
|
|
RCTExperimentSyncPerformanceFlag = value;
|
|
}
|
|
|
|
/*
|
|
* Optimized hit-testing
|
|
*/
|
|
static BOOL RCTExperimentOptimizedHitTesting = NO;
|
|
|
|
BOOL RCTExperimentGetOptimizedHitTesting()
|
|
{
|
|
return RCTExperimentOptimizedHitTesting;
|
|
}
|
|
|
|
void RCTExperimentSetOptimizedHitTesting(BOOL value)
|
|
{
|
|
RCTExperimentOptimizedHitTesting = value;
|
|
}
|