mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Fling: Cleanup virtualViewHysteresisRatio (#55099)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55099 Deletes the `virtualViewHysteresisRatio` feature flag. It was never rolled out and not found to significantly improve performance. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D90337120 fbshipit-source-id: 93b79574a1304b3f4fce8c336b77d4a60453d7bc
This commit is contained in:
1 parent
876bf20788
commit
bb980b0c08
23 files changed
+48
-207
No files matched your search
+1
-7
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<e12e5425f1a51acfd0f244e5d4f46a3e>>
|
||||
* @generated SignedSource<<f65e9c6c5c404c0db2fe537917b27557>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -516,12 +516,6 @@ public object ReactNativeFeatureFlags {
|
||||
@JvmStatic
|
||||
public fun viewCullingOutsetRatio(): Double = accessor.viewCullingOutsetRatio()
|
||||
|
||||
/**
|
||||
* Sets a hysteresis window for transition between prerender and hidden modes.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun virtualViewHysteresisRatio(): Double = accessor.virtualViewHysteresisRatio()
|
||||
|
||||
/**
|
||||
* Initial prerender ratio for VirtualView.
|
||||
*/
|
||||
|
||||
+1
-11
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<fe103b59da0f78a6e834ca92603531fb>>
|
||||
* @generated SignedSource<<907fd6d60faaeb4c28ffd3b40928347e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -101,7 +101,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
private var useTurboModuleInteropCache: Boolean? = null
|
||||
private var useTurboModulesCache: Boolean? = null
|
||||
private var viewCullingOutsetRatioCache: Double? = null
|
||||
private var virtualViewHysteresisRatioCache: Double? = null
|
||||
private var virtualViewPrerenderRatioCache: Double? = null
|
||||
|
||||
override fun commonTestFlag(): Boolean {
|
||||
@@ -833,15 +832,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun virtualViewHysteresisRatio(): Double {
|
||||
var cached = virtualViewHysteresisRatioCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.virtualViewHysteresisRatio()
|
||||
virtualViewHysteresisRatioCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun virtualViewPrerenderRatio(): Double {
|
||||
var cached = virtualViewPrerenderRatioCache
|
||||
if (cached == null) {
|
||||
|
||||
+1
-3
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<0ae5a806950b4bfaaaccde774114ab4e>>
|
||||
* @generated SignedSource<<497416e09c55455dccb439c15955ee00>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -190,8 +190,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun viewCullingOutsetRatio(): Double
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun virtualViewHysteresisRatio(): Double
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun virtualViewPrerenderRatio(): Double
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun override(provider: Any)
|
||||
|
||||
+1
-3
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<532504ff7b4a7f4c45649fc59ecade3a>>
|
||||
* @generated SignedSource<<26eb9af61fedaacaadc23a8698ff6117>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -185,7 +185,5 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun viewCullingOutsetRatio(): Double = 0.0
|
||||
|
||||
override fun virtualViewHysteresisRatio(): Double = 0.0
|
||||
|
||||
override fun virtualViewPrerenderRatio(): Double = 5.0
|
||||
}
|
||||
+1
-12
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<d4caae6713b5c26f17841839903ea529>>
|
||||
* @generated SignedSource<<a1aced60121b0dc49c55b2141a331cf2>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -105,7 +105,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
private var useTurboModuleInteropCache: Boolean? = null
|
||||
private var useTurboModulesCache: Boolean? = null
|
||||
private var viewCullingOutsetRatioCache: Double? = null
|
||||
private var virtualViewHysteresisRatioCache: Double? = null
|
||||
private var virtualViewPrerenderRatioCache: Double? = null
|
||||
|
||||
override fun commonTestFlag(): Boolean {
|
||||
@@ -918,16 +917,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun virtualViewHysteresisRatio(): Double {
|
||||
var cached = virtualViewHysteresisRatioCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.virtualViewHysteresisRatio()
|
||||
accessedFeatureFlags.add("virtualViewHysteresisRatio")
|
||||
virtualViewHysteresisRatioCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun virtualViewPrerenderRatio(): Double {
|
||||
var cached = virtualViewPrerenderRatioCache
|
||||
if (cached == null) {
|
||||
|
||||
+1
-3
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<351ae3b05fae543b52eaa7bcf7f5f479>>
|
||||
* @generated SignedSource<<d6f937b2829cc1f0e49a136aae1044e9>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -185,7 +185,5 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun viewCullingOutsetRatio(): Double
|
||||
|
||||
@DoNotStrip public fun virtualViewHysteresisRatio(): Double
|
||||
|
||||
@DoNotStrip public fun virtualViewPrerenderRatio(): Double
|
||||
}
|
||||
+2
-16
@@ -47,12 +47,10 @@ internal fun rectsOverlap(rect1: Rect, rect2: Rect): Boolean {
|
||||
|
||||
internal abstract class VirtualViewContainerState {
|
||||
protected val prerenderRatio: Double = ReactNativeFeatureFlags.virtualViewPrerenderRatio()
|
||||
protected val hysteresisRatio: Double = ReactNativeFeatureFlags.virtualViewHysteresisRatio()
|
||||
protected abstract val virtualViews: MutableCollection<VirtualView>
|
||||
protected val emptyRect: Rect = Rect()
|
||||
protected val visibleRect: Rect = Rect()
|
||||
protected val prerenderRect: Rect = Rect()
|
||||
protected val hysteresisRect: Rect = Rect()
|
||||
protected val scrollView: ViewGroup
|
||||
|
||||
companion object {
|
||||
@@ -92,10 +90,7 @@ internal abstract class VirtualViewContainerState {
|
||||
updateModes()
|
||||
}
|
||||
|
||||
/**
|
||||
* Refreshes the coordinates for the Rects this class cares about (visibleRect, prerenderRect,
|
||||
* hysteresisRect)
|
||||
*/
|
||||
/** Refreshes the coordinates for the Rects this class cares about (visibleRect, prerenderRect) */
|
||||
protected fun updateRects() {
|
||||
scrollView.getDrawingRect(visibleRect)
|
||||
|
||||
@@ -107,7 +102,6 @@ internal abstract class VirtualViewContainerState {
|
||||
// should set the other rects here in case scrollview is suddenly empty after the other rects
|
||||
// are non-empty
|
||||
prerenderRect.set(visibleRect)
|
||||
hysteresisRect.set(prerenderRect)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -117,17 +111,9 @@ internal abstract class VirtualViewContainerState {
|
||||
(-prerenderRect.height() * prerenderRatio).toInt(),
|
||||
)
|
||||
|
||||
hysteresisRect.set(prerenderRect)
|
||||
hysteresisRect.inset(
|
||||
(-visibleRect.width() * hysteresisRatio).toInt(),
|
||||
(-visibleRect.height() * hysteresisRatio).toInt(),
|
||||
)
|
||||
|
||||
debugLog(
|
||||
"updateRects",
|
||||
{
|
||||
"visibleRect ${visibleRect.toString()} prerenderRect ${prerenderRect.toString()} hysteresisRect ${hysteresisRect.toString()}"
|
||||
},
|
||||
{ "visibleRect ${visibleRect.toString()} prerenderRect ${prerenderRect.toString()}" },
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+6
-21
@@ -33,20 +33,12 @@ internal class VirtualViewContainerStateClassic(scrollView: ViewGroup) :
|
||||
(-prerenderRect.height() * prerenderRatio).toInt(),
|
||||
)
|
||||
|
||||
if (hysteresisRatio > 0.0) {
|
||||
hysteresisRect.set(prerenderRect)
|
||||
hysteresisRect.inset(
|
||||
(-visibleRect.width() * hysteresisRatio).toInt(),
|
||||
(-visibleRect.height() * hysteresisRatio).toInt(),
|
||||
)
|
||||
}
|
||||
|
||||
val virtualViewsIt =
|
||||
if (virtualView != null) listOf(virtualView) else virtualViews.toMutableSet()
|
||||
virtualViewsIt.forEach { vv ->
|
||||
val rect = vv.containerRelativeRect
|
||||
|
||||
var mode: VirtualViewMode? = VirtualViewMode.Hidden
|
||||
var mode: VirtualViewMode = VirtualViewMode.Hidden
|
||||
var thresholdRect = emptyRect
|
||||
when {
|
||||
rectsOverlap(rect, visibleRect) -> {
|
||||
@@ -57,20 +49,13 @@ internal class VirtualViewContainerStateClassic(scrollView: ViewGroup) :
|
||||
mode = VirtualViewMode.Prerender
|
||||
thresholdRect = prerenderRect
|
||||
}
|
||||
(hysteresisRatio > 0.0 && rectsOverlap(rect, hysteresisRect)) -> {
|
||||
mode = null
|
||||
}
|
||||
}
|
||||
|
||||
if (mode != null) {
|
||||
vv.onModeChange(mode, thresholdRect)
|
||||
debugLog(
|
||||
"updateModes",
|
||||
{
|
||||
"virtualView=${vv.virtualViewID} mode=$mode rect=$rect thresholdRect=$thresholdRect"
|
||||
},
|
||||
)
|
||||
}
|
||||
vv.onModeChange(mode, thresholdRect)
|
||||
debugLog(
|
||||
"updateModes",
|
||||
{ "virtualView=${vv.virtualViewID} mode=$mode rect=$rect thresholdRect=$thresholdRect" },
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+19
-32
@@ -24,8 +24,8 @@ internal class VirtualViewContainerStateExperimental(scrollView: ViewGroup) :
|
||||
}
|
||||
override val virtualViews = IntervalTree(horizontal)
|
||||
|
||||
// set of all VirtualViews that are in hysteresis, prerender, or visible range
|
||||
var HPV: MutableSet<String> = mutableSetOf()
|
||||
// set of all VirtualViews that are in prerender or visible ranges
|
||||
var PV: MutableSet<String> = mutableSetOf()
|
||||
// set of all VirtualViews that are in prerender (not in viewport)
|
||||
var P: MutableSet<String> = mutableSetOf()
|
||||
// set of all VirtualViews that are in viewport
|
||||
@@ -51,7 +51,7 @@ internal class VirtualViewContainerStateExperimental(scrollView: ViewGroup) :
|
||||
|
||||
override fun remove(virtualView: VirtualView) {
|
||||
super.remove(virtualView)
|
||||
HPV.remove(virtualView.virtualViewID)
|
||||
PV.remove(virtualView.virtualViewID)
|
||||
P.remove(virtualView.virtualViewID)
|
||||
V.remove(virtualView.virtualViewID)
|
||||
}
|
||||
@@ -63,7 +63,7 @@ internal class VirtualViewContainerStateExperimental(scrollView: ViewGroup) :
|
||||
private fun updateMode(virtualView: VirtualView) {
|
||||
val rect = virtualView.containerRelativeRect
|
||||
|
||||
var mode: VirtualViewMode? = VirtualViewMode.Hidden
|
||||
var mode: VirtualViewMode = VirtualViewMode.Hidden
|
||||
var thresholdRect = emptyRect
|
||||
when {
|
||||
rectsOverlap(rect, visibleRect) -> {
|
||||
@@ -74,38 +74,27 @@ internal class VirtualViewContainerStateExperimental(scrollView: ViewGroup) :
|
||||
mode = VirtualViewMode.Prerender
|
||||
thresholdRect = prerenderRect
|
||||
}
|
||||
(hysteresisRatio > 0.0 && rectsOverlap(rect, hysteresisRect)) -> {
|
||||
mode = null
|
||||
}
|
||||
}
|
||||
|
||||
if (mode != null) {
|
||||
virtualView.onModeChange(mode, thresholdRect)
|
||||
}
|
||||
virtualView.onModeChange(mode, thresholdRect)
|
||||
|
||||
// move the virtualView into the correct set(s)
|
||||
when {
|
||||
mode == VirtualViewMode.Visible -> {
|
||||
HPV.add(virtualView.virtualViewID)
|
||||
when (mode) {
|
||||
VirtualViewMode.Visible -> {
|
||||
PV.add(virtualView.virtualViewID)
|
||||
P.remove(virtualView.virtualViewID)
|
||||
V.add(virtualView.virtualViewID)
|
||||
}
|
||||
|
||||
mode == VirtualViewMode.Prerender -> {
|
||||
HPV.add(virtualView.virtualViewID)
|
||||
VirtualViewMode.Prerender -> {
|
||||
PV.add(virtualView.virtualViewID)
|
||||
P.add(virtualView.virtualViewID)
|
||||
V.remove(virtualView.virtualViewID)
|
||||
}
|
||||
|
||||
mode == VirtualViewMode.Hidden -> {
|
||||
VirtualViewMode.Hidden -> {
|
||||
// remove from all sets
|
||||
HPV.remove(virtualView.virtualViewID)
|
||||
P.remove(virtualView.virtualViewID)
|
||||
V.remove(virtualView.virtualViewID)
|
||||
}
|
||||
|
||||
else -> { // hysteresis
|
||||
HPV.add(virtualView.virtualViewID)
|
||||
PV.remove(virtualView.virtualViewID)
|
||||
P.remove(virtualView.virtualViewID)
|
||||
V.remove(virtualView.virtualViewID)
|
||||
}
|
||||
@@ -117,27 +106,25 @@ internal class VirtualViewContainerStateExperimental(scrollView: ViewGroup) :
|
||||
* n), where m = size of the prerender window in terms of index
|
||||
*/
|
||||
private fun updateModesAll() {
|
||||
// collect V', PV', HPV' sets
|
||||
// collect V' and PV' sets
|
||||
val VPrime = virtualViews.query(visibleRect)
|
||||
val PVPrime = virtualViews.query(prerenderRect)
|
||||
val HPVPrime = virtualViews.query(hysteresisRect)
|
||||
|
||||
debugLog("updateModes", { "V: ${V}, P: ${P}, HPV: ${HPV}" })
|
||||
debugLog("updateModes", { "V: ${V}, P: ${P}, PV: ${PV}" })
|
||||
|
||||
/** Perform utility set differences: */
|
||||
// P'=PV'-V'
|
||||
val PPrime = PVPrime.minus(VPrime)
|
||||
|
||||
debugLog("updateModes", { "V': ${VPrime}, P': ${PPrime}, HPV': ${HPVPrime}" })
|
||||
debugLog("updateModes", { "V': ${VPrime}, P': ${PPrime}, PV': ${PVPrime}" })
|
||||
|
||||
/** Get useful set differences */
|
||||
// V'-V - update to visible
|
||||
val toVisible = VPrime.minus(V)
|
||||
// P'-P - update to prerender
|
||||
val toPrerender = PPrime.minus(P)
|
||||
// ignore H' - we don't care about VVs in hysteresis
|
||||
// HPV-HPV' - update to hidden
|
||||
val toHidden = HPV.minus(HPVPrime)
|
||||
// PV-PV' - update to hidden
|
||||
val toHidden = PV.minus(PVPrime)
|
||||
|
||||
debugLog("updateModes", { "toV: ${toVisible}, toP: ${toPrerender}, toH: ${toHidden}" })
|
||||
|
||||
@@ -152,10 +139,10 @@ internal class VirtualViewContainerStateExperimental(scrollView: ViewGroup) :
|
||||
virtualViews.getVirtualView(vvID)?.onModeChange(VirtualViewMode.Hidden, emptyRect)
|
||||
}
|
||||
|
||||
/** update old sets - V, P, and HPV */
|
||||
/** update old sets - V, P, and PV */
|
||||
V = VPrime
|
||||
P = PPrime.toMutableSet()
|
||||
HPV = HPVPrime.toMutableSet()
|
||||
PV = PVPrime.toMutableSet()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-15
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<9841e9badfe84669fde89f35467d4c13>>
|
||||
* @generated SignedSource<<4e42a02fba11d92d390e1e60de492214>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -525,12 +525,6 @@ class ReactNativeFeatureFlagsJavaProvider
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
double virtualViewHysteresisRatio() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jdouble()>("virtualViewHysteresisRatio");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
double virtualViewPrerenderRatio() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jdouble()>("virtualViewPrerenderRatio");
|
||||
@@ -946,11 +940,6 @@ double JReactNativeFeatureFlagsCxxInterop::viewCullingOutsetRatio(
|
||||
return ReactNativeFeatureFlags::viewCullingOutsetRatio();
|
||||
}
|
||||
|
||||
double JReactNativeFeatureFlagsCxxInterop::virtualViewHysteresisRatio(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::virtualViewHysteresisRatio();
|
||||
}
|
||||
|
||||
double JReactNativeFeatureFlagsCxxInterop::virtualViewPrerenderRatio(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::virtualViewPrerenderRatio();
|
||||
@@ -1230,9 +1219,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"viewCullingOutsetRatio",
|
||||
JReactNativeFeatureFlagsCxxInterop::viewCullingOutsetRatio),
|
||||
makeNativeMethod(
|
||||
"virtualViewHysteresisRatio",
|
||||
JReactNativeFeatureFlagsCxxInterop::virtualViewHysteresisRatio),
|
||||
makeNativeMethod(
|
||||
"virtualViewPrerenderRatio",
|
||||
JReactNativeFeatureFlagsCxxInterop::virtualViewPrerenderRatio),
|
||||
|
||||
+1
-4
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<65067f69d2477016b20b52596e22085d>>
|
||||
* @generated SignedSource<<51f172946b8ecb5c5d637112237a5b83>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -273,9 +273,6 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
static double viewCullingOutsetRatio(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static double virtualViewHysteresisRatio(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static double virtualViewPrerenderRatio(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<4c09707a70b2e3ced763abf51b230d3c>>
|
||||
* @generated SignedSource<<b58aac8de8af5726c9a415ff389090f7>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -350,10 +350,6 @@ double ReactNativeFeatureFlags::viewCullingOutsetRatio() {
|
||||
return getAccessor().viewCullingOutsetRatio();
|
||||
}
|
||||
|
||||
double ReactNativeFeatureFlags::virtualViewHysteresisRatio() {
|
||||
return getAccessor().virtualViewHysteresisRatio();
|
||||
}
|
||||
|
||||
double ReactNativeFeatureFlags::virtualViewPrerenderRatio() {
|
||||
return getAccessor().virtualViewPrerenderRatio();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<e48f5e20876690cc1b8d74f78b721650>>
|
||||
* @generated SignedSource<<6c608c49510a61153dd2c5c3e659930d>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -444,11 +444,6 @@ class ReactNativeFeatureFlags {
|
||||
*/
|
||||
RN_EXPORT static double viewCullingOutsetRatio();
|
||||
|
||||
/**
|
||||
* Sets a hysteresis window for transition between prerender and hidden modes.
|
||||
*/
|
||||
RN_EXPORT static double virtualViewHysteresisRatio();
|
||||
|
||||
/**
|
||||
* Initial prerender ratio for VirtualView.
|
||||
*/
|
||||
|
||||
+2
-20
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<828d9d1aafc49a5308ecc1181648cd86>>
|
||||
* @generated SignedSource<<e99f20f513f191ba3a8265e6d77aafd2>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -1487,24 +1487,6 @@ double ReactNativeFeatureFlagsAccessor::viewCullingOutsetRatio() {
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
double ReactNativeFeatureFlagsAccessor::virtualViewHysteresisRatio() {
|
||||
auto flagValue = virtualViewHysteresisRatio_.load();
|
||||
|
||||
if (!flagValue.has_value()) {
|
||||
// This block is not exclusive but it is not necessary.
|
||||
// If multiple threads try to initialize the feature flag, we would only
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(81, "virtualViewHysteresisRatio");
|
||||
|
||||
flagValue = currentProvider_->virtualViewHysteresisRatio();
|
||||
virtualViewHysteresisRatio_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
double ReactNativeFeatureFlagsAccessor::virtualViewPrerenderRatio() {
|
||||
auto flagValue = virtualViewPrerenderRatio_.load();
|
||||
|
||||
@@ -1514,7 +1496,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewPrerenderRatio() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(82, "virtualViewPrerenderRatio");
|
||||
markFlagAsAccessed(81, "virtualViewPrerenderRatio");
|
||||
|
||||
flagValue = currentProvider_->virtualViewPrerenderRatio();
|
||||
virtualViewPrerenderRatio_ = flagValue;
|
||||
|
||||
+2
-4
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<275c3f7a627c07f470c9ac1949d9fbcc>>
|
||||
* @generated SignedSource<<3fed1e352144c1a440eaec5c66056964>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -113,7 +113,6 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
bool useTurboModuleInterop();
|
||||
bool useTurboModules();
|
||||
double viewCullingOutsetRatio();
|
||||
double virtualViewHysteresisRatio();
|
||||
double virtualViewPrerenderRatio();
|
||||
|
||||
void override(std::unique_ptr<ReactNativeFeatureFlagsProvider> provider);
|
||||
@@ -126,7 +125,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
|
||||
bool wasOverridden_;
|
||||
|
||||
std::array<std::atomic<const char*>, 83> accessedFeatureFlags_;
|
||||
std::array<std::atomic<const char*>, 82> accessedFeatureFlags_;
|
||||
|
||||
std::atomic<std::optional<bool>> commonTestFlag_;
|
||||
std::atomic<std::optional<bool>> cdpInteractionMetricsEnabled_;
|
||||
@@ -209,7 +208,6 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::atomic<std::optional<bool>> useTurboModuleInterop_;
|
||||
std::atomic<std::optional<bool>> useTurboModules_;
|
||||
std::atomic<std::optional<double>> viewCullingOutsetRatio_;
|
||||
std::atomic<std::optional<double>> virtualViewHysteresisRatio_;
|
||||
std::atomic<std::optional<double>> virtualViewPrerenderRatio_;
|
||||
};
|
||||
|
||||
|
||||
+1
-5
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<159c2185b5aabf5bc0bb0a32fcd0473d>>
|
||||
* @generated SignedSource<<850823d53427909b153b30321da66e34>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -351,10 +351,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double virtualViewHysteresisRatio() override {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double virtualViewPrerenderRatio() override {
|
||||
return 5.0;
|
||||
}
|
||||
|
||||
+1
-10
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<4664498d96f4b4e3e85d96e81c981f83>>
|
||||
* @generated SignedSource<<a93a0133f27eddcea803f0a879d23018>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -774,15 +774,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
|
||||
return ReactNativeFeatureFlagsDefaults::viewCullingOutsetRatio();
|
||||
}
|
||||
|
||||
double virtualViewHysteresisRatio() override {
|
||||
auto value = values_["virtualViewHysteresisRatio"];
|
||||
if (!value.isNull()) {
|
||||
return value.getDouble();
|
||||
}
|
||||
|
||||
return ReactNativeFeatureFlagsDefaults::virtualViewHysteresisRatio();
|
||||
}
|
||||
|
||||
double virtualViewPrerenderRatio() override {
|
||||
auto value = values_["virtualViewPrerenderRatio"];
|
||||
if (!value.isNull()) {
|
||||
|
||||
+1
-2
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<85e69738d9f20fb3d9da17304546956c>>
|
||||
* @generated SignedSource<<7068f47bca01d79ddd86856ab9953cdf>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -106,7 +106,6 @@ class ReactNativeFeatureFlagsProvider {
|
||||
virtual bool useTurboModuleInterop() = 0;
|
||||
virtual bool useTurboModules() = 0;
|
||||
virtual double viewCullingOutsetRatio() = 0;
|
||||
virtual double virtualViewHysteresisRatio() = 0;
|
||||
virtual double virtualViewPrerenderRatio() = 0;
|
||||
};
|
||||
|
||||
|
||||
+1
-6
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<938d098abe72c4e65078380234d8f818>>
|
||||
* @generated SignedSource<<4a89696ef1000ff112e00ccd1e29f0d9>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -449,11 +449,6 @@ double NativeReactNativeFeatureFlags::viewCullingOutsetRatio(
|
||||
return ReactNativeFeatureFlags::viewCullingOutsetRatio();
|
||||
}
|
||||
|
||||
double NativeReactNativeFeatureFlags::virtualViewHysteresisRatio(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::virtualViewHysteresisRatio();
|
||||
}
|
||||
|
||||
double NativeReactNativeFeatureFlags::virtualViewPrerenderRatio(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::virtualViewPrerenderRatio();
|
||||
|
||||
+1
-3
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<8143c4446642b5777a48dc76172d65b6>>
|
||||
* @generated SignedSource<<90f350fbc5382eb023571098a3ab92a2>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -198,8 +198,6 @@ class NativeReactNativeFeatureFlags
|
||||
|
||||
double viewCullingOutsetRatio(jsi::Runtime& runtime);
|
||||
|
||||
double virtualViewHysteresisRatio(jsi::Runtime& runtime);
|
||||
|
||||
double virtualViewPrerenderRatio(jsi::Runtime& runtime);
|
||||
};
|
||||
|
||||
|
||||
@@ -909,17 +909,6 @@ const definitions: FeatureFlagDefinitions = {
|
||||
},
|
||||
ossReleaseStage: 'none',
|
||||
},
|
||||
virtualViewHysteresisRatio: {
|
||||
defaultValue: 0,
|
||||
metadata: {
|
||||
dateAdded: '2025-08-22',
|
||||
description:
|
||||
'Sets a hysteresis window for transition between prerender and hidden modes.',
|
||||
expectedReleaseValue: 1,
|
||||
purpose: 'experimentation',
|
||||
},
|
||||
ossReleaseStage: 'none',
|
||||
},
|
||||
virtualViewPrerenderRatio: {
|
||||
defaultValue: 5,
|
||||
metadata: {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<fcf8bc19a86d7c5ffc3b36c01348df26>>
|
||||
* @generated SignedSource<<ec42c40fee769dd30d97942a76b9c8f4>>
|
||||
* @flow strict
|
||||
* @noformat
|
||||
*/
|
||||
@@ -129,7 +129,6 @@ export type ReactNativeFeatureFlags = $ReadOnly<{
|
||||
useTurboModuleInterop: Getter<boolean>,
|
||||
useTurboModules: Getter<boolean>,
|
||||
viewCullingOutsetRatio: Getter<number>,
|
||||
virtualViewHysteresisRatio: Getter<number>,
|
||||
virtualViewPrerenderRatio: Getter<number>,
|
||||
}>;
|
||||
|
||||
@@ -526,10 +525,6 @@ export const useTurboModules: Getter<boolean> = createNativeFlagGetter('useTurbo
|
||||
* Outset the culling context frame with the provided ratio. The culling context frame size will be outset by width * ratio on the left and right, and height * ratio on the top and bottom.
|
||||
*/
|
||||
export const viewCullingOutsetRatio: Getter<number> = createNativeFlagGetter('viewCullingOutsetRatio', 0);
|
||||
/**
|
||||
* Sets a hysteresis window for transition between prerender and hidden modes.
|
||||
*/
|
||||
export const virtualViewHysteresisRatio: Getter<number> = createNativeFlagGetter('virtualViewHysteresisRatio', 0);
|
||||
/**
|
||||
* Initial prerender ratio for VirtualView.
|
||||
*/
|
||||
|
||||
+1
-2
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<935799fffbb56ea085dca694dc8272a0>>
|
||||
* @generated SignedSource<<f7e343a1f033680a9882fb5da9879b4e>>
|
||||
* @flow strict
|
||||
* @noformat
|
||||
*/
|
||||
@@ -106,7 +106,6 @@ export interface Spec extends TurboModule {
|
||||
+useTurboModuleInterop?: () => boolean;
|
||||
+useTurboModules?: () => boolean;
|
||||
+viewCullingOutsetRatio?: () => number;
|
||||
+virtualViewHysteresisRatio?: () => number;
|
||||
+virtualViewPrerenderRatio?: () => number;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user