From 6f7428e27bae89a5aa52cd25ae66671251ecff97 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Wed, 25 Jan 2023 05:43:38 -0800 Subject: [PATCH] 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 --- React/Fabric/RCTScheduler.mm | 4 -- .../LayoutAnimationKeyFrameManager.cpp | 42 ------------------- .../LayoutAnimationKeyFrameManager.h | 8 ---- 3 files changed, 54 deletions(-) diff --git a/React/Fabric/RCTScheduler.mm b/React/Fabric/RCTScheduler.mm index a27ce8c718c2d1..8fc513f1f923d7 100644 --- a/React/Fabric/RCTScheduler.mm +++ b/React/Fabric/RCTScheduler.mm @@ -115,10 +115,6 @@ - (instancetype)initWithToolbox:(SchedulerToolbox)toolbox _layoutAnimationDelegateProxy = std::make_shared((__bridge void *)self); _animationDriver = std::make_shared( 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()); diff --git a/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp b/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp index e1337fd95f8d06..34aed3a676046f 100644 --- a/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +++ b/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp @@ -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( - 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 diff --git a/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h b/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h index 337f1159ddf21d..18c356d2cf3acb 100644 --- a/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +++ b/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h @@ -90,8 +90,6 @@ class LayoutAnimationKeyFrameManager : public UIManagerAnimationDelegate, void setClockNow(std::function now); - void enableSimulateImagePropsMemoryAccess(); - protected: SharedComponentDescriptorRegistry componentDescriptorRegistry_; mutable std::optional currentAnimation_{}; @@ -150,12 +148,6 @@ class LayoutAnimationKeyFrameManager : public UIManagerAnimationDelegate, mutable butter::set 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 now_;