Commit f935630e authored by Khushal's avatar Khushal Committed by Commit Bot

gpu: Release all skia's cached memory when app backgrounded.

R=ericrk@chromium.org

Bug: 859635
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I0afc80a877b5fdae5a4459bb5fa6f767ad842a7d
Reviewed-on: https://chromium-review.googlesource.com/1138750Reviewed-by: default avatarEric Karl <ericrk@chromium.org>
Commit-Queue: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575504}
parent 40749675
......@@ -30,6 +30,7 @@
#include "gpu/ipc/service/gpu_channel.h"
#include "gpu/ipc/service/gpu_channel_manager_delegate.h"
#include "gpu/ipc/service/gpu_memory_buffer_factory.h"
#include "third_party/skia/include/core/SkGraphics.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_share_group.h"
#include "ui/gl/gl_version_info.h"
......@@ -298,6 +299,8 @@ void GpuChannelManager::OnBackgroundCleanup() {
raster_decoder_context_state_->context_lost = true;
raster_decoder_context_state_.reset();
}
SkGraphics::PurgeAllCaches();
}
#endif
......@@ -307,6 +310,9 @@ void GpuChannelManager::OnApplicationBackgrounded() {
base::MemoryPressureListener::MemoryPressureLevel::
MEMORY_PRESSURE_LEVEL_CRITICAL);
}
// Release all skia caching when the application is backgrounded.
SkGraphics::PurgeAllCaches();
}
void GpuChannelManager::HandleMemoryPressure(
......
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