Commit 18ba607a authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

CC: Make LayerTreeHostImpl::OnMemoryPressure work for the desktop as well

LayerTreeHostImpl::OnMemoryPressure has only worked for low-end devices.
But it would be good if it works for all devices.

Bug: 839687
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I9f670ab08587ad4c5f626eb74fe5d7c9db256150
Reviewed-on: https://chromium-review.googlesource.com/1107025
Commit-Queue: Gyuyoung Kim <gyuyoung.kim@lge.com>
Reviewed-by: default avatarEric Karl <ericrk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572216}
parent b34409ec
......@@ -2794,18 +2794,14 @@ void LayerTreeHostImpl::ActivateStateForImages() {
void LayerTreeHostImpl::OnMemoryPressure(
base::MemoryPressureListener::MemoryPressureLevel level) {
// Only work for low-end devices for now.
if (!base::SysInfo::IsLowEndDevice())
return;
switch (level) {
case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE:
case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE:
break;
case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL:
ReleaseTileResources();
ReleaseTreeResources();
ClearUIResources();
ReleaseTreeResources();
ReleaseTileResources();
if (image_decode_cache_) {
image_decode_cache_->SetShouldAggressivelyFreeResources(true);
image_decode_cache_->SetShouldAggressivelyFreeResources(false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment