Skip to content

Commit

Permalink
Deletes unnecessary wrapping method [1/n]
Browse files Browse the repository at this point in the history
Summary: [BE][litho] Deletes unnecessary wrapping method [1/n]

Reviewed By: pentiumao

Differential Revision: D57967700

fbshipit-source-id: d9d834cfe74a2990beaf851b4338f88596613d69
  • Loading branch information
adityasharat authored and facebook-github-bot committed May 31, 2024
1 parent 92bf77f commit 5b89a27
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions litho-core/src/main/java/com/facebook/litho/BaseMountingView.java
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,21 @@ void mount(

layoutState.setShouldProcessVisibilityOutputs(processVisibilityOutputs);

mountWithMountDelegateTarget(layoutState, currentVisibleArea);
final boolean needsMount = isMountStateDirty() || mountStateNeedsRemount();
if (currentVisibleArea != null && !needsMount) {
Preconditions.checkNotNull(mMountState.getMountDelegate())
.notifyVisibleBoundsChanged(currentVisibleArea);
} else {
// Generate the renderTree here so that any operations
// that occur in toRenderTree() happen prior to "beforeMount".
final RenderTree renderTree = layoutState.toRenderTree();
setupMountExtensions();
Preconditions.checkNotNull(mLithoHostListenerCoordinator);
mLithoHostListenerCoordinator.beforeMount(layoutState, currentVisibleArea);
mMountState.mount(renderTree);
LithoStats.incrementComponentMountCount();
drawDebugOverlay(this, layoutState.getComponentTreeId());
}

onAfterMount(onBeforeMountResult);
mIsMountStateDirty = false;
Expand All @@ -535,25 +549,6 @@ Object onBeforeMount() {
*/
void onAfterMount(@Nullable Object fromOnBeforeMount) {}

private void mountWithMountDelegateTarget(
LayoutState layoutState, @Nullable Rect currentVisibleArea) {
final boolean needsMount = isMountStateDirty() || mountStateNeedsRemount();
if (currentVisibleArea != null && !needsMount) {
Preconditions.checkNotNull(mMountState.getMountDelegate())
.notifyVisibleBoundsChanged(currentVisibleArea);
} else {
// Generate the renderTree here so that any operations
// that occur in toRenderTree() happen prior to "beforeMount".
final RenderTree renderTree = layoutState.toRenderTree();
setupMountExtensions();
Preconditions.checkNotNull(mLithoHostListenerCoordinator);
mLithoHostListenerCoordinator.beforeMount(layoutState, currentVisibleArea);
mMountState.mount(renderTree);
LithoStats.incrementComponentMountCount();
drawDebugOverlay(this, layoutState.getComponentTreeId());
}
}

// We pause mounting while the visibility hint is set to false, because the visible rect of
// the BaseMountingView is not consistent with what's currently on screen.
private boolean shouldPauseMountingWithVisibilityHintFalse() {
Expand Down

0 comments on commit 5b89a27

Please sign in to comment.