Skip to content

Commit

Permalink
[fuchsia] Disable memory mitigations for visible LayerTreeHostImpls.
Browse files Browse the repository at this point in the history
Attempting to unlock/release memory used by visible LayerTreeHostImpls
on receipt of CRITICAL memory pressure notifications causes flickering
when the content needs to be re-composited.

Disable these mitigations for visible instances, and re-enable memory
pressure handling in WebEngine renderer processes by default.

Bug: 1189208
Bug: 1175858, 1173685
Bug: b/181245064
Change-Id: Iee9160b312299d53e665d03991fe3e29019786ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2773224
Commit-Queue: Wez <wez@chromium.org>
Auto-Submit: Wez <wez@chromium.org>
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Reviewed-by: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#864726}
  • Loading branch information
Wez authored and Chromium LUCI CQ committed Mar 19, 2021
1 parent 7aa2449 commit 3e9e1e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions cc/trees/layer_tree_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3308,6 +3308,13 @@ void LayerTreeHostImpl::OnMemoryPressure(
if (level != base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL)
return;

// TODO(crbug.com/1189208): Unlocking decoded-image-tracker images causes
// flickering in visible trees if Out-Of-Process rasterization is enabled.
#if defined(OS_FUCHSIA)
if (use_oop_rasterization() && visible())
return;
#endif // defined(OS_FUCHSIA)

ReleaseTileResources();
active_tree_->OnPurgeMemory();
if (pending_tree_)
Expand All @@ -3322,6 +3329,7 @@ void LayerTreeHostImpl::OnMemoryPressure(
}
if (resource_pool_)
resource_pool_->OnMemoryPressure(level);

tile_manager_.decoded_image_tracker().UnlockAllImages();
}

Expand Down
2 changes: 1 addition & 1 deletion fuchsia/engine/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace features {

constexpr base::Feature kHandleMemoryPressureInRenderer{
"HandleMemoryPressureInRenderer", base::FEATURE_DISABLED_BY_DEFAULT};
"HandleMemoryPressureInRenderer", base::FEATURE_ENABLED_BY_DEFAULT};

} // namespace features

Expand Down

0 comments on commit 3e9e1e8

Please sign in to comment.