Delete feature flag enable_simulate_image_props_memory_access

Summary:
changelog: [internal]

Clean up unused feature flag

Reviewed By: fkgozali

Differential Revision: D42709723

fbshipit-source-id: 289697dfb0c0378ff0369e1474150f7be68c8635
This commit is contained in:
Samuel Susla
2023-01-25 05:43:38 -08:00
committed by Facebook GitHub Bot
parent 8863be41b1
commit 6f7428e27b
3 changed files with 0 additions and 54 deletions
-4
View File
@@ -115,10 +115,6 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
_layoutAnimationDelegateProxy = std::make_shared<LayoutAnimationDelegateProxy>((__bridge void *)self);
_animationDriver = std::make_shared<LayoutAnimationDriver>(
toolbox.runtimeExecutor, toolbox.contextContainer, _layoutAnimationDelegateProxy.get());
if (reactNativeConfig->getBool("react_fabric:enable_simulate_image_props_memory_access")) {
_animationDriver->enableSimulateImagePropsMemoryAccess();
}
_uiRunLoopObserver =
toolbox.mainRunLoopObserverFactory(RunLoopObserver::Activity::BeforeWaiting, _layoutAnimationDelegateProxy);
_uiRunLoopObserver->setDelegate(_layoutAnimationDelegateProxy.get());
@@ -171,7 +171,6 @@ LayoutAnimationKeyFrameManager::pullTransaction(
MountingTransaction::Number transactionNumber,
TransactionTelemetry const &telemetry,
ShadowViewMutationList mutations) const {
simulateImagePropsMemoryAccess(mutations);
// Current time in milliseconds
uint64_t now = now_();
@@ -1086,8 +1085,6 @@ LayoutAnimationKeyFrameManager::pullTransaction(
}
}
simulateImagePropsMemoryAccess(mutations);
return MountingTransaction{
surfaceId, transactionNumber, std::move(mutations), telemetry};
}
@@ -1108,10 +1105,6 @@ void LayoutAnimationKeyFrameManager::setClockNow(
now_ = std::move(now);
}
void LayoutAnimationKeyFrameManager::enableSimulateImagePropsMemoryAccess() {
simulateImagePropsMemoryAccess_ = true;
}
#pragma mark - Protected
bool LayoutAnimationKeyFrameManager::hasComponentDescriptorForShadowView(
@@ -1665,39 +1658,4 @@ void LayoutAnimationKeyFrameManager::deleteAnimationsForStoppedSurfaces()
}
}
void LayoutAnimationKeyFrameManager::simulateImagePropsMemoryAccess(
ShadowViewMutationList const &mutations) const {
if (!simulateImagePropsMemoryAccess_) {
return;
}
for (auto const &mutation : mutations) {
if (mutation.type != ShadowViewMutation::Type::Insert) {
continue;
}
if (strcmp(mutation.newChildShadowView.componentName, "Image") == 0) {
auto const &imageProps = *std::static_pointer_cast<ImageProps const>(
mutation.newChildShadowView.props);
int temp = 0;
switch (imageProps.resizeMode) {
case ImageResizeMode::Cover:
temp = 1;
break;
case ImageResizeMode::Contain:
temp = 2;
break;
case ImageResizeMode::Stretch:
temp = 3;
break;
case ImageResizeMode::Center:
temp = 4;
break;
case ImageResizeMode::Repeat:
temp = 5;
break;
}
(void)temp;
}
}
}
} // namespace facebook::react
@@ -90,8 +90,6 @@ class LayoutAnimationKeyFrameManager : public UIManagerAnimationDelegate,
void setClockNow(std::function<uint64_t()> now);
void enableSimulateImagePropsMemoryAccess();
protected:
SharedComponentDescriptorRegistry componentDescriptorRegistry_;
mutable std::optional<LayoutAnimation> currentAnimation_{};
@@ -150,12 +148,6 @@ class LayoutAnimationKeyFrameManager : public UIManagerAnimationDelegate,
mutable butter::set<SurfaceId> surfaceIdsToStop_{};
bool reduceDeleteCreateMutation_{false};
/*
* Feature flag that enables simulation of memory access. This is a temporary
* flag to diagnose where crashes are coming from in LayoutAnimations on iOS.
*/
bool simulateImagePropsMemoryAccess_{false};
// Function that returns current time in milliseconds
std::function<uint64_t()> now_;